-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a shim for Databricks 11.3 spark330db [databricks] (#7152)
* introduce non330db directories * ShimExtractValue * GpuPredicateHelper now extends and shims PredicateHelper * Allow passing TEST_PARALLEL to test.sh to be able to run integration tests on a small instance * No need to override getSparkShimVersion using the same implementation in every shim Fixes #6879 Signed-off-by: Gera Shegalov <[email protected]> Signed-off-by: Ahmed Hussein (amahussein) <[email protected]> Co-authored-by: Ahmed Hussein (amahussein) <[email protected]> Signed-off-by: Niranjan Artal <[email protected]> Co-authored-by: Niranjan Artal <[email protected]>
- Loading branch information
1 parent
2828596
commit a42e328
Showing
78 changed files
with
907 additions
and
399 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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
39 changes: 39 additions & 0 deletions
39
...in/src/main/311until320-all/scala/com/nvidia/spark/rapids/shims/ShimPredicateHelper.scala
This file contains 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,39 @@ | ||
/* | ||
* Copyright (c) 2022, NVIDIA CORPORATION. | ||
* | ||
* Licensed 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 com.nvidia.spark.rapids.shims | ||
|
||
import org.apache.spark.sql.catalyst.expressions._ | ||
import org.apache.spark.sql.rapids._ | ||
|
||
trait ShimPredicateHelper extends PredicateHelper { | ||
// SPARK-30027 from 3.2.0 | ||
// If one expression and its children are null intolerant, it is null intolerant. | ||
protected def isNullIntolerant(expr: Expression): Boolean = expr match { | ||
case e: NullIntolerant => e.children.forall(isNullIntolerant) | ||
case _ => false | ||
} | ||
|
||
override protected def splitConjunctivePredicates( | ||
condition: Expression | ||
): Seq[Expression] = { | ||
condition match { | ||
case GpuAnd(cond1, cond2) => | ||
splitConjunctivePredicates(cond1) ++ splitConjunctivePredicates(cond2) | ||
case other => super.splitConjunctivePredicates(condition) | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains 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 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 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 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
33 changes: 33 additions & 0 deletions
33
sql-plugin/src/main/320+/scala/com/nvidia/spark/rapids/shims/ShimPredicateHelper.scala
This file contains 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,33 @@ | ||
/* | ||
* Copyright (c) 2022, NVIDIA CORPORATION. | ||
* | ||
* Licensed 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 com.nvidia.spark.rapids.shims | ||
|
||
import org.apache.spark.sql.catalyst.expressions._ | ||
import org.apache.spark.sql.rapids._ | ||
|
||
trait ShimPredicateHelper extends PredicateHelper { | ||
// SPARK-30027 provides isNullIntolerant | ||
override protected def splitConjunctivePredicates( | ||
condition: Expression | ||
): Seq[Expression] = { | ||
condition match { | ||
case GpuAnd(cond1, cond2) => | ||
splitConjunctivePredicates(cond1) ++ splitConjunctivePredicates(cond2) | ||
case other => super.splitConjunctivePredicates(condition) | ||
} | ||
} | ||
} |
Oops, something went wrong.