LuciferYang commented on code in PR #52619:
URL: https://github.com/apache/spark/pull/52619#discussion_r2434989220
##########
project/SparkBuild.scala:
##########
@@ -826,6 +829,97 @@ object SparkConnect {
(assembly / assemblyMergeStrategy) := {
case m if m.toLowerCase(Locale.ROOT).endsWith("manifest.mf") =>
MergeStrategy.discard
+ case m if m.toLowerCase(Locale.ROOT).matches("meta-inf.*\\.sf$") =>
MergeStrategy.discard
+ case m if m.toLowerCase(Locale.ROOT).startsWith("meta-inf/services/") =>
MergeStrategy.filterDistinctLines
+ // Drop all proto files that are not needed as artifacts of the build.
+ case m if m.toLowerCase(Locale.ROOT).endsWith(".proto") =>
MergeStrategy.discard
+ case _ => MergeStrategy.first
+ }
+ )
+}
+
+object SparkConnectJdbc {
+ import BuildCommons.protoVersion
+ val buildTestDeps = TaskKey[Unit]("buildTestDeps", "Build needed
dependencies for test.")
+
+ lazy val settings = Seq(
+ // For some reason the resolution from the imported Maven build does not
work for some
+ // of these dependendencies that we need to shade later on.
+ libraryDependencies ++= {
+ val guavaVersion =
+ SbtPomKeys.effectivePom.value.getProperties.get(
+ "connect.guava.version").asInstanceOf[String]
+ Seq(
+ "com.google.guava" % "guava" % guavaVersion,
+ "com.google.protobuf" % "protobuf-java" % protoVersion % "protobuf"
+ )
+ },
+ dependencyOverrides ++= {
Review Comment:
Are `libraryDependencies` and `dependencyOverrides` still needed here?
##########
dev/sparktestsupport/modules.py:
##########
@@ -437,6 +437,7 @@ def __hash__(self):
sbt_test_goals=[
"connect/test",
"connect-client-jvm/test",
+ "connect-client-jdbc/test",
Review Comment:
Please confirm whether maven_test.yml needs to be modified.
##########
sql/connect/client/jdbc/src/main/scala/org/apache/spark/sql/connect/client/jdbc/NonRegisteringSparkConnectDriver.scala:
##########
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.sql.connect.client.jdbc
+
+import java.sql.{Connection, Driver, DriverPropertyInfo,
SQLFeatureNotSupportedException}
+import java.util.Properties
+import java.util.logging.Logger
+
+import org.apache.spark.SparkBuildInfo.{spark_version => SPARK_VERSION}
+import org.apache.spark.util.VersionUtils
+
+class NonRegisteringSparkConnectDriver extends Driver {
Review Comment:
I'm not sure whether we should implement everything using Java.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]