sunchao commented on a change in pull request #33989: URL: https://github.com/apache/spark/pull/33989#discussion_r712337711
########## File path: sql/hive-shaded/pom.xml ########## @@ -0,0 +1,216 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ~ 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. + --> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.spark</groupId> + <artifactId>spark-parent_2.12</artifactId> + <version>3.3.0-SNAPSHOT</version> + <relativePath>../../pom.xml</relativePath> + </parent> + + <artifactId>spark-hive-shaded_2.12</artifactId> + <packaging>jar</packaging> + <name>Spark Project Hive Shaded</name> + <url>http://spark.apache.org/</url> + <properties> + <sbt.project.name>hive-shaded</sbt.project.name> + </properties> + + <!-- dependencies in the following are optional because we don't want to leak them as + transitive dependencies, as they are already included in the shaded jar --> + <dependencies> + <dependency> + <groupId>${hive.group}</groupId> + <artifactId>hive-common</artifactId> + <scope>${hive.common.scope}</scope> + <optional>true</optional> + </dependency> + <dependency> + <groupId>${hive.group}</groupId> + <artifactId>hive-exec</artifactId> + <classifier>${hive.classifier}</classifier> + <optional>true</optional> + </dependency> + <dependency> + <groupId>${hive.group}</groupId> + <artifactId>hive-metastore</artifactId> + <optional>true</optional> + </dependency> + <dependency> + <groupId>${hive.group}</groupId> + <artifactId>hive-serde</artifactId> + <scope>${hive.serde.scope}</scope> + <optional>true</optional> + </dependency> + <dependency> + <groupId>${hive.group}</groupId> Review comment: You mean replace `org.apache.hive` with `${hive.group}`? yes we should do it, although I just copied these verbatim from the existing `hive/pom.xml` :) ########## File path: sql/hive-shaded/pom.xml ########## @@ -0,0 +1,216 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ~ 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. + --> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.spark</groupId> + <artifactId>spark-parent_2.12</artifactId> + <version>3.3.0-SNAPSHOT</version> + <relativePath>../../pom.xml</relativePath> + </parent> + + <artifactId>spark-hive-shaded_2.12</artifactId> + <packaging>jar</packaging> + <name>Spark Project Hive Shaded</name> + <url>http://spark.apache.org/</url> + <properties> + <sbt.project.name>hive-shaded</sbt.project.name> + </properties> + + <!-- dependencies in the following are optional because we don't want to leak them as + transitive dependencies, as they are already included in the shaded jar --> + <dependencies> + <dependency> + <groupId>${hive.group}</groupId> + <artifactId>hive-common</artifactId> + <scope>${hive.common.scope}</scope> + <optional>true</optional> + </dependency> + <dependency> + <groupId>${hive.group}</groupId> + <artifactId>hive-exec</artifactId> + <classifier>${hive.classifier}</classifier> + <optional>true</optional> + </dependency> + <dependency> + <groupId>${hive.group}</groupId> + <artifactId>hive-metastore</artifactId> + <optional>true</optional> + </dependency> + <dependency> + <groupId>${hive.group}</groupId> + <artifactId>hive-serde</artifactId> + <scope>${hive.serde.scope}</scope> + <optional>true</optional> + </dependency> + <dependency> + <groupId>${hive.group}</groupId> + <artifactId>hive-shims</artifactId> + <scope>${hive.shims.scope}</scope> + <optional>true</optional> + </dependency> + <dependency> + <groupId>org.apache.hive</groupId> + <artifactId>hive-llap-common</artifactId> + <scope>${hive.llap.scope}</scope> + <optional>true</optional> + </dependency> + <dependency> + <groupId>org.apache.hive</groupId> + <artifactId>hive-llap-client</artifactId> + <scope>${hive.llap.scope}</scope> + <optional>true</optional> + </dependency> + <!-- re-import guava here since it's declared as provided in parent pom --> + <dependency> + <groupId>com.google.guava</groupId> + <artifactId>guava</artifactId> + <version>14.0.1</version> + <scope>compile</scope> + <optional>true</optional> + </dependency> + </dependencies> + + <profiles> + <profile> + <id>hive-thriftserver</id> Review comment: I believe we always publish binaries with `-Phive-thriftserver`, see [here](https://github.com/apache/spark/blob/master/dev/create-release/release-build.sh#L195). ########## File path: sql/hive/pom.xml ########## @@ -168,6 +128,18 @@ <groupId>org.datanucleus</groupId> <artifactId>datanucleus-core</artifactId> </dependency> + <dependency> + <groupId>org.datanucleus</groupId> Review comment: I'm trying to follow the existing approach on handling `datanucleus-core` here, and explicitly import these instead of putting them into the uber jar. These will become transitive dependencies of the `spark-hive` module. Some other dependencies from Hive are handled in the same way. ########## File path: sql/hive-shaded/pom.xml ########## @@ -0,0 +1,216 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ~ 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. + --> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.spark</groupId> + <artifactId>spark-parent_2.12</artifactId> + <version>3.3.0-SNAPSHOT</version> + <relativePath>../../pom.xml</relativePath> + </parent> + + <artifactId>spark-hive-shaded_2.12</artifactId> + <packaging>jar</packaging> + <name>Spark Project Hive Shaded</name> + <url>http://spark.apache.org/</url> + <properties> + <sbt.project.name>hive-shaded</sbt.project.name> + </properties> + + <!-- dependencies in the following are optional because we don't want to leak them as + transitive dependencies, as they are already included in the shaded jar --> + <dependencies> + <dependency> + <groupId>${hive.group}</groupId> + <artifactId>hive-common</artifactId> + <scope>${hive.common.scope}</scope> + <optional>true</optional> + </dependency> + <dependency> + <groupId>${hive.group}</groupId> + <artifactId>hive-exec</artifactId> + <classifier>${hive.classifier}</classifier> + <optional>true</optional> + </dependency> + <dependency> + <groupId>${hive.group}</groupId> + <artifactId>hive-metastore</artifactId> + <optional>true</optional> + </dependency> + <dependency> + <groupId>${hive.group}</groupId> + <artifactId>hive-serde</artifactId> + <scope>${hive.serde.scope}</scope> + <optional>true</optional> + </dependency> + <dependency> + <groupId>${hive.group}</groupId> + <artifactId>hive-shims</artifactId> + <scope>${hive.shims.scope}</scope> + <optional>true</optional> + </dependency> + <dependency> + <groupId>org.apache.hive</groupId> + <artifactId>hive-llap-common</artifactId> + <scope>${hive.llap.scope}</scope> + <optional>true</optional> + </dependency> + <dependency> + <groupId>org.apache.hive</groupId> + <artifactId>hive-llap-client</artifactId> + <scope>${hive.llap.scope}</scope> + <optional>true</optional> + </dependency> + <!-- re-import guava here since it's declared as provided in parent pom --> + <dependency> + <groupId>com.google.guava</groupId> + <artifactId>guava</artifactId> + <version>14.0.1</version> + <scope>compile</scope> + <optional>true</optional> + </dependency> + </dependencies> + + <profiles> + <profile> + <id>hive-thriftserver</id> + <dependencies> + <dependency> + <groupId>${hive.group}</groupId> + <artifactId>hive-cli</artifactId> + <optional>true</optional> + </dependency> + <dependency> + <groupId>${hive.group}</groupId> + <artifactId>hive-jdbc</artifactId> + <optional>true</optional> + </dependency> + <dependency> + <groupId>${hive.group}</groupId> + <artifactId>hive-beeline</artifactId> + <optional>true</optional> + </dependency> + <dependency> + <groupId>${hive.group}</groupId> + <artifactId>hive-service-rpc</artifactId> + <optional>true</optional> + </dependency> + </dependencies> + </profile> + </profiles> + + <build> + <outputDirectory>target/scala-${scala.binary.version}/classes</outputDirectory> + <testOutputDirectory>target/scala-${scala.binary.version}/test-classes</testOutputDirectory> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-shade-plugin</artifactId> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>shade</goal> + </goals> + <configuration> + <shadedArtifactAttached>false</shadedArtifactAttached> + <artifactSet combine.self="override"> + <includes> + <include>*:*</include> + </includes> Review comment: Good point. Let me check on those. ########## File path: sql/hive-shaded/pom.xml ########## @@ -0,0 +1,216 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ~ 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. + --> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.spark</groupId> + <artifactId>spark-parent_2.12</artifactId> + <version>3.3.0-SNAPSHOT</version> + <relativePath>../../pom.xml</relativePath> + </parent> + + <artifactId>spark-hive-shaded_2.12</artifactId> + <packaging>jar</packaging> + <name>Spark Project Hive Shaded</name> + <url>http://spark.apache.org/</url> + <properties> + <sbt.project.name>hive-shaded</sbt.project.name> + </properties> + + <!-- dependencies in the following are optional because we don't want to leak them as + transitive dependencies, as they are already included in the shaded jar --> + <dependencies> + <dependency> + <groupId>${hive.group}</groupId> + <artifactId>hive-common</artifactId> + <scope>${hive.common.scope}</scope> + <optional>true</optional> + </dependency> + <dependency> + <groupId>${hive.group}</groupId> + <artifactId>hive-exec</artifactId> + <classifier>${hive.classifier}</classifier> + <optional>true</optional> + </dependency> + <dependency> + <groupId>${hive.group}</groupId> + <artifactId>hive-metastore</artifactId> + <optional>true</optional> + </dependency> + <dependency> + <groupId>${hive.group}</groupId> + <artifactId>hive-serde</artifactId> + <scope>${hive.serde.scope}</scope> + <optional>true</optional> + </dependency> + <dependency> + <groupId>${hive.group}</groupId> + <artifactId>hive-shims</artifactId> + <scope>${hive.shims.scope}</scope> + <optional>true</optional> + </dependency> + <dependency> + <groupId>org.apache.hive</groupId> + <artifactId>hive-llap-common</artifactId> + <scope>${hive.llap.scope}</scope> + <optional>true</optional> + </dependency> + <dependency> + <groupId>org.apache.hive</groupId> + <artifactId>hive-llap-client</artifactId> + <scope>${hive.llap.scope}</scope> + <optional>true</optional> + </dependency> + <!-- re-import guava here since it's declared as provided in parent pom --> + <dependency> + <groupId>com.google.guava</groupId> + <artifactId>guava</artifactId> + <version>14.0.1</version> + <scope>compile</scope> + <optional>true</optional> + </dependency> + </dependencies> + + <profiles> + <profile> + <id>hive-thriftserver</id> + <dependencies> + <dependency> + <groupId>${hive.group}</groupId> + <artifactId>hive-cli</artifactId> + <optional>true</optional> + </dependency> + <dependency> + <groupId>${hive.group}</groupId> + <artifactId>hive-jdbc</artifactId> + <optional>true</optional> + </dependency> + <dependency> + <groupId>${hive.group}</groupId> + <artifactId>hive-beeline</artifactId> + <optional>true</optional> + </dependency> + <dependency> + <groupId>${hive.group}</groupId> + <artifactId>hive-service-rpc</artifactId> + <optional>true</optional> + </dependency> + </dependencies> + </profile> + </profiles> + + <build> + <outputDirectory>target/scala-${scala.binary.version}/classes</outputDirectory> + <testOutputDirectory>target/scala-${scala.binary.version}/test-classes</testOutputDirectory> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-shade-plugin</artifactId> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>shade</goal> + </goals> + <configuration> + <shadedArtifactAttached>false</shadedArtifactAttached> + <artifactSet combine.self="override"> + <includes> + <include>*:*</include> + </includes> + </artifactSet> + <filters> + <filter> + <artifact>*:*</artifact> + <excludes> + <exclude>META-INF/*.SF</exclude> + <exclude>META-INF/*.DSA</exclude> + <exclude>META-INF/*.RSA</exclude> + </excludes> + </filter> + </filters> + <relocations combine.self="override"> + <relocation> + <pattern>com.google.common</pattern> + <shadedPattern>${spark.shade.packageName}.hive.guava</shadedPattern> + </relocation> + <relocation> + <pattern>com.google.protobuf</pattern> + <shadedPattern>${spark.shade.packageName}.hive.com.google.protobuf</shadedPattern> + </relocation> + <relocation> + <pattern>com.google.gson</pattern> + <shadedPattern>${spark.shade.packageName}.hive.com.google.gson</shadedPattern> + </relocation> + <relocation> + <pattern>com.github.joshelser</pattern> + <shadedPattern>${spark.shade.packageName}.hive.com.github.joshelser</shadedPattern> + </relocation> + <relocation> + <pattern>com.jolbox.bonecp</pattern> + <shadedPattern>${spark.shade.packageName}.hive.com.jolbox.bonecp</shadedPattern> + </relocation> + <relocation> + <pattern>com.zaxxer.hikari</pattern> + <shadedPattern>${spark.shade.packageName}.hive.com.zaxxer.hikari</shadedPattern> + </relocation> + <relocation> + <pattern>au.com.bytecode</pattern> + <shadedPattern>${spark.shade.packageName}.hive.au.com.bytecode</shadedPattern> + </relocation> + <relocation> + <pattern>org.apache.commons</pattern> + <shadedPattern>${spark.shade.packageName}.hive.org.apache.commons</shadedPattern> + </relocation> + <relocation> + <pattern>org.antlr.runtime</pattern> + <shadedPattern>${spark.shade.packageName}.hive.org.antlr.runtime</shadedPattern> + </relocation> + <relocation> + <pattern>org.apache.velocity</pattern> + <shadedPattern>${spark.shade.packageName}.hive.org.apache.velocity</shadedPattern> + </relocation> + <relocation> <!-- from org.antlr:ST4 --> + <pattern>org.stringtemplate.v4</pattern> + <shadedPattern>${spark.shade.packageName}.hive.org.stringtemplate.v4</shadedPattern> + </relocation> + <relocation> + <pattern>javolution</pattern> + <shadedPattern>${spark.shade.packageName}.hive.javolution</shadedPattern> + </relocation> + </relocations> Review comment: Oops forgot these. I'm thinking to add these `javax.*` dependencies explicitly in `spark-hive` and exclude them from the uber jar, since they seem relatively stable. What do you think? On the other hand, seems we should exclude `org.json` from Hive due to SPARK-18262. ########## File path: sql/hive/pom.xml ########## @@ -185,6 +157,10 @@ <groupId>org.apache.derby</groupId> <artifactId>derby</artifactId> </dependency> + <dependency> + <groupId>jline</groupId> + <artifactId>jline</artifactId> Review comment: Spark already declared `jline` dependency (with the same version as that from Hive) so I excluded it from the shaded jar and added it here as a transitive dependency of `spark-hive` module. -- 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]
