Skip to content

Commit e2c563d

Browse files
committed
[SPARK-54002][DEPLOY] Support integrating BeeLine with Connect JDBC driver
1 parent 96093bd commit e2c563d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

launcher/src/main/java/org/apache/spark/launcher/AbstractCommandBuilder.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ abstract class AbstractCommandBuilder {
6666
*/
6767
protected boolean isRemote = System.getenv().containsKey("SPARK_REMOTE");
6868

69+
protected boolean isBeeLine = false;
70+
6971
AbstractCommandBuilder() {
7072
this.appArgs = new ArrayList<>();
7173
this.childEnv = new HashMap<>();
@@ -195,6 +197,9 @@ List<String> buildClassPath(String appClassPath) throws IOException {
195197
if (isRemote && "1".equals(getenv("SPARK_SCALA_SHELL")) && project.equals("sql/core")) {
196198
continue;
197199
}
200+
if (isBeeLine && project.equals("sql/core")) {
201+
continue;
202+
}
198203
// SPARK-49534: The assumption here is that if `spark-hive_xxx.jar` is not in the
199204
// classpath, then the `-Phive` profile was not used during package, and therefore
200205
// the Hive-related jars should also not be in the classpath. To avoid failure in
@@ -241,7 +246,7 @@ List<String> buildClassPath(String appClassPath) throws IOException {
241246
}
242247
}
243248

244-
if (isRemote) {
249+
if (isRemote || isBeeLine) {
245250
for (File f: new File(jarsDir).listFiles()) {
246251
// Exclude Spark Classic SQL and Spark Connect server jars
247252
// if we're in Spark Connect Shell. Also exclude Spark SQL API and

launcher/src/main/java/org/apache/spark/launcher/SparkClassCommandBuilder.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ class SparkClassCommandBuilder extends AbstractCommandBuilder {
3838
SparkClassCommandBuilder(String className, List<String> classArgs) {
3939
this.className = className;
4040
this.classArgs = classArgs;
41+
if ("org.apache.hive.beeline.BeeLine".equals(className)) {
42+
this.isBeeLine = true;
43+
}
4144
}
4245

4346
@Override

0 commit comments

Comments
 (0)