-
Notifications
You must be signed in to change notification settings - Fork 204
[AURON #1404] Support for Spark 4.0.1 Compatibility in Auron. #1405
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
Closed
Closed
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
102daec
[AURON#1404] Support for Spark 4.0.1 Compatibility in Auron.
slfan1989 9998991
[AURON#1404] Support for Spark 4.0.1 Compatibility in Auron.
slfan1989 ec39f8c
[AURON#1404] Support for Spark 4.0.1 Compatibility in Auron.
slfan1989 1147f49
Update spark-extension-shims-spark4/pom.xml
slfan1989 e64e4a0
Merge branch 'master' into support-spark-4.0.1
slfan1989 d149380
[AURON#1404] Support for Spark 4.0.1 Compatibility in Auron.
slfan1989 54ac538
Merge branch 'apache:master' into support-spark-4.0.1
slfan1989 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
| <parent> | ||
| <groupId>org.apache.auron</groupId> | ||
| <artifactId>auron-parent_${scalaVersion}</artifactId> | ||
| <version>${project.version}</version> | ||
| <relativePath>../pom.xml</relativePath> | ||
| </parent> | ||
|
|
||
| <artifactId>spark-extension-shims-spark4_${scalaVersion}</artifactId> | ||
| <packaging>jar</packaging> | ||
|
|
||
| <url>http://maven.apache.org</url> | ||
|
|
||
| <properties> | ||
| <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
| </properties> | ||
|
|
||
| <dependencies> | ||
| <dependency> | ||
| <groupId>org.apache.auron</groupId> | ||
| <artifactId>auron-common_${scalaVersion}</artifactId> | ||
| <version>${project.version}</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.auron</groupId> | ||
| <artifactId>spark-extension_${scalaVersion}</artifactId> | ||
| <version>${project.version}</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.scala-lang.modules</groupId> | ||
| <artifactId>scala-java8-compat_${scalaVersion}</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.spark</groupId> | ||
| <artifactId>spark-core_${scalaVersion}</artifactId> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.spark</groupId> | ||
| <artifactId>spark-hive_${scalaVersion}</artifactId> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.spark</groupId> | ||
| <artifactId>spark-sql_${scalaVersion}</artifactId> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.arrow</groupId> | ||
| <artifactId>arrow-c-data</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.arrow</groupId> | ||
| <artifactId>arrow-compression</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.arrow</groupId> | ||
| <artifactId>arrow-memory-unsafe</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.arrow</groupId> | ||
| <artifactId>arrow-vector</artifactId> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>net.bytebuddy</groupId> | ||
| <artifactId>byte-buddy</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>net.bytebuddy</groupId> | ||
| <artifactId>byte-buddy-agent</artifactId> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>org.apache.auron</groupId> | ||
| <artifactId>auron-common_${scalaVersion}</artifactId> | ||
| <version>${project.version}</version> | ||
| <type>test-jar</type> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.spark</groupId> | ||
| <artifactId>spark-core_${scalaVersion}</artifactId> | ||
| <type>test-jar</type> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.spark</groupId> | ||
| <artifactId>spark-catalyst_${scalaVersion}</artifactId> | ||
| <type>test-jar</type> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.spark</groupId> | ||
| <artifactId>spark-sql_${scalaVersion}</artifactId> | ||
| <type>test-jar</type> | ||
| </dependency> | ||
| </dependencies> | ||
| </project> | ||
43 changes: 43 additions & 0 deletions
43
...s-spark4/src/main/java/org/apache/spark/sql/auron/ForceApplyShuffledHashJoinInjector.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| /* | ||
| * 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.auron; | ||
|
|
||
| import static net.bytebuddy.matcher.ElementMatchers.named; | ||
|
|
||
| import net.bytebuddy.ByteBuddy; | ||
| import net.bytebuddy.agent.ByteBuddyAgent; | ||
| import net.bytebuddy.description.type.TypeDescription; | ||
| import net.bytebuddy.dynamic.ClassFileLocator; | ||
| import net.bytebuddy.dynamic.loading.ClassLoadingStrategy; | ||
| import net.bytebuddy.implementation.MethodDelegation; | ||
| import net.bytebuddy.pool.TypePool; | ||
|
|
||
| public class ForceApplyShuffledHashJoinInjector { | ||
| public static void inject() { | ||
| ByteBuddyAgent.install(); | ||
| ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); | ||
| TypeDescription typeDescription = TypePool.Default.of(contextClassLoader) | ||
| .describe("org.apache.spark.sql.catalyst.optimizer.JoinSelectionHelper") | ||
| .resolve(); | ||
| new ByteBuddy() | ||
| .redefine(typeDescription, ClassFileLocator.ForClassLoader.of(contextClassLoader)) | ||
| .method(named("forceApplyShuffledHashJoin")) | ||
| .intercept(MethodDelegation.to(ForceApplyShuffledHashJoinInterceptor.class)) | ||
| .make() | ||
| .load(contextClassLoader, ClassLoadingStrategy.Default.INJECTION); | ||
| } | ||
| } |
32 changes: 32 additions & 0 deletions
32
...park4/src/main/java/org/apache/spark/sql/auron/ForceApplyShuffledHashJoinInterceptor.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| /* | ||
| * 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.auron; | ||
|
|
||
| import net.bytebuddy.implementation.bind.annotation.Argument; | ||
| import net.bytebuddy.implementation.bind.annotation.RuntimeType; | ||
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
|
|
||
| public class ForceApplyShuffledHashJoinInterceptor { | ||
| private static final Logger logger = LoggerFactory.getLogger(ForceApplyShuffledHashJoinInterceptor.class); | ||
|
|
||
| @RuntimeType | ||
| public static Object intercept(@Argument(0) Object conf) { | ||
| logger.debug("calling JoinSelectionHelper.forceApplyShuffledHashJoin() intercepted by auron"); | ||
| return AuronConf.FORCE_SHUFFLED_HASH_JOIN.booleanConf(); | ||
| } | ||
| } |
34 changes: 34 additions & 0 deletions
34
...ms-spark4/src/main/java/org/apache/spark/sql/auron/ValidateSparkPlanApplyInterceptor.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| /* | ||
| * 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.auron; | ||
|
|
||
| import net.bytebuddy.implementation.bind.annotation.Argument; | ||
| import net.bytebuddy.implementation.bind.annotation.RuntimeType; | ||
| import org.apache.spark.sql.execution.SparkPlan; | ||
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
|
|
||
| public class ValidateSparkPlanApplyInterceptor { | ||
| private static final Logger logger = LoggerFactory.getLogger(ValidateSparkPlanApplyInterceptor.class); | ||
|
|
||
| @RuntimeType | ||
| public static Object intercept(@Argument(0) Object plan) { | ||
| logger.debug("calling ValidateSparkPlan.apply() intercepted by auron"); | ||
| InterceptedValidateSparkPlan$.MODULE$.validate((SparkPlan) plan); | ||
| return plan; | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.