-
Notifications
You must be signed in to change notification settings - Fork 28.5k
[WIP] Build jar from source #50790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[WIP] Build jar from source #50790
Conversation
@HeartSaVioR, @dongjoon-hyun, @HyukjinKwon, @cloud-fan Please review. Similar approach can be applied to other jars. |
import org.apache.hadoop.io.Text; | ||
|
||
@Description(name = "udaf_max2", value = "_FUNC_(expr) - Returns the maximum value of expr") | ||
public class UDAFExampleMax2 extends UDAF { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where do we get the source code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see
spark/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveUDFDynamicLoadSuite.scala
Line 144 in 3cae318
// The test jars are built from below commit: |
@@ -199,6 +199,10 @@ | |||
<artifactId>scalacheck_${scala.binary.version}</artifactId> | |||
<scope>test</scope> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.apache.maven.shared</groupId> | |||
<artifactId>maven-invoker</artifactId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems too overkill to use Maven here, how about calling javac
directly? https://github.com/apache/hive/blob/branch-4.0/common/src/java/org/apache/hive/common/util/HiveTestUtils.java#L94
Some additional backgrounds: there were some complains that Spark use two building tools, Maven and SBT, which introduces additional complex to align those behaviors, there is a chance that one of the building tools might be dropped someday.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is necessary to build jar and not only compile Java class. Calling javac
directly would require all the dependencies and without Maven it would be necessary to load them.
Using maven invoker here only impacts how test jar is built. It works both with Spark Maven and SBT builds and does not require usage of one over the other to build Spark.
What changes were proposed in this pull request?
Remove
hive-test-udfs.jar
from the source control, add java sources for Hive UDFs and build hive-test-udfs.jar as part ofHiveUDFDynamicLoadSuite
using Maven.Why are the changes needed?
Does this PR introduce any user-facing change?
No, it impacts tests only
How was this patch tested?
It was tested using maven build and running
HiveUDFDynamicLoadSuite
.Was this patch authored or co-authored using generative AI tooling?
No