github-actions[bot] commented on code in PR #65733: URL: https://github.com/apache/doris/pull/65733#discussion_r3600173894
########## fe/be-java-extensions/hive-udf-shade/pom.xml: ########## @@ -0,0 +1,114 @@ +<?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"> + <parent> + <artifactId>be-java-extensions</artifactId> + <groupId>org.apache.doris</groupId> + <version>${revision}</version> + </parent> + <modelVersion>4.0.0</modelVersion> + + <artifactId>hive-udf-shade</artifactId> + <packaging>jar</packaging> + <name>Doris BE Java Extensions - Hive UDF Contract Shade</name> + <description> + Minimal shaded jar carrying ONLY the Hive UDF contract classes + (org.apache.hadoop.hive.ql.exec.UDF plus its load-time closure) that a + user Hive UDF extends. Replaces the ~122MB shaded Hive catalog fat jar + that java-udf previously bundled just to provide this handful of classes. + </description> + + <dependencies> + <!-- + Source of the UDF contract classes. Marked optional so java-udf, which + depends on this shaded module, does NOT transitively re-pull the full + hive-exec:core jar: the ~handful of classes it needs are already baked + into hive-udf-shade.jar by the shade filter below. The wildcard + exclusion prunes hive-exec's heavy transitive tree (calcite/orc/...) + from resolution entirely, since we bundle nothing but hive-exec itself. + --> + <dependency> + <groupId>org.apache.hive</groupId> + <artifactId>hive-exec</artifactId> + <classifier>core</classifier> + <version>${hive.version}</version> + <optional>true</optional> + <exclusions> + <exclusion> + <groupId>*</groupId> + <artifactId>*</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + + <build> + <finalName>hive-udf-shade</finalName> + <directory>${project.basedir}/target/</directory> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-shade-plugin</artifactId> + <version>3.2.4</version> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>shade</goal> + </goals> + </execution> + </executions> + <configuration> + <createDependencyReducedPom>false</createDependencyReducedPom> + <!-- Bundle only hive-exec; the project itself has no sources. --> + <artifactSet> + <includes> + <include>org.apache.hive:hive-exec</include> + </includes> + </artifactSet> + <!-- + Keep ONLY the Hive UDF contract + its load-time closure: + - ql/exec/UDF* UDF base class, UDFMethodResolver, + UDFArgument*Exception, UDFClassLoader + - ql/exec/DefaultUDFMethodResolver instantiated by the UDF ctor + - ql/exec/Description the @Description annotation + - ql/metadata/HiveException* declared by some user UDFs + FunctionRegistry is referenced only inside the never-called + DefaultUDFMethodResolver.getEvalMethod(), so it is intentionally + excluded. Everything else in hive-exec is dropped. + --> + <filters> + <filter> + <artifact>org.apache.hive:hive-exec</artifact> + <includes> + <include>org/apache/hadoop/hive/ql/exec/UDF*.class</include> + <include>org/apache/hadoop/hive/ql/exec/DefaultUDFMethodResolver*.class</include> + <include>org/apache/hadoop/hive/ql/exec/Description*.class</include> + <include>org/apache/hadoop/hive/ql/metadata/HiveException*.class</include> Review Comment: [P1] Keep the retained Hive API classes runtime-linkable. In Hive 3.1.3 every `HiveException` constructor executes `canonicalErrorMsg = ErrorMsg.GENERIC_ERROR`, but this filter keeps `HiveException*.class` and drops `org/apache/hadoop/hive/ql/ErrorMsg`. The repository's `AssertUDF.evaluate(false, ...)` constructs that exception from a jar whose Hive dependencies are `provided`, so a new BE now gets `NoClassDefFoundError` instead of executing the UDF's exception path; the existing regression only calls `assert(true, ...)`. The retained `UDFArgumentException` is similarly unusable because its superclass `SemanticException` is filtered out and Doris's `Class.getMethods()` scan resolves it for a UDF that declares that exception. Please retain and validate the executable closure of every promised contract class, and exercise these negative/reflection paths against the final assembled `java-udf` jar. -- 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]
