Skip to content

Commit e505feb

Browse files
committed
Keep ShimPredicate version-specific
1 parent f7c45e2 commit e505feb

4 files changed

Lines changed: 108 additions & 5 deletions

File tree

sql-plugin/src/main/scala/com/nvidia/spark/rapids/shims/TreeNode.scala

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
package com.nvidia.spark.rapids.shims
1818

19-
import org.apache.spark.sql.catalyst.expressions.{BinaryExpression, Expression, Predicate, TernaryExpression, UnaryExpression}
19+
import org.apache.spark.sql.catalyst.expressions.{BinaryExpression, Expression, TernaryExpression, UnaryExpression}
2020
import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, UnaryCommand}
2121
import org.apache.spark.sql.execution.{BinaryExecNode, SparkPlan, UnaryExecNode}
2222
import org.apache.spark.sql.execution.command.DataWritingCommand
@@ -49,10 +49,6 @@ trait ShimTernaryExpression extends TernaryExpression {
4949
}
5050
}
5151

52-
trait ShimPredicate extends Predicate {
53-
def contextIndependentFoldable: Boolean = children.forall(_.foldable)
54-
}
55-
5652
trait ShimSparkPlan extends SparkPlan {
5753
override def withNewChildrenInternal(newChildren: IndexedSeq[SparkPlan]): SparkPlan = {
5854
legacyWithNewChildren(newChildren)
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* Copyright (c) 2026, NVIDIA CORPORATION.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
/*** spark-rapids-shim-json-lines
18+
{"spark": "330"}
19+
{"spark": "330db"}
20+
{"spark": "331"}
21+
{"spark": "332"}
22+
{"spark": "332db"}
23+
{"spark": "333"}
24+
{"spark": "334"}
25+
{"spark": "340"}
26+
{"spark": "341"}
27+
{"spark": "341db"}
28+
{"spark": "342"}
29+
{"spark": "343"}
30+
{"spark": "344"}
31+
{"spark": "350"}
32+
{"spark": "350db143"}
33+
{"spark": "351"}
34+
{"spark": "352"}
35+
{"spark": "353"}
36+
{"spark": "354"}
37+
{"spark": "355"}
38+
{"spark": "356"}
39+
{"spark": "357"}
40+
{"spark": "358"}
41+
spark-rapids-shim-json-lines ***/
42+
package com.nvidia.spark.rapids.shims
43+
44+
import org.apache.spark.sql.catalyst.expressions.Predicate
45+
46+
trait ShimPredicate extends Predicate {
47+
def contextIndependentFoldable: Boolean = children.forall(_.foldable)
48+
}
49+
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright (c) 2026, NVIDIA CORPORATION.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
/*** spark-rapids-shim-json-lines
18+
{"spark": "400"}
19+
{"spark": "400db173"}
20+
{"spark": "401"}
21+
{"spark": "402"}
22+
spark-rapids-shim-json-lines ***/
23+
package com.nvidia.spark.rapids.shims
24+
25+
import org.apache.spark.sql.catalyst.expressions.Predicate
26+
27+
trait ShimPredicate extends Predicate {
28+
def contextIndependentFoldable: Boolean = children.forall(_.foldable)
29+
}
30+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright (c) 2026, NVIDIA CORPORATION.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
/*** spark-rapids-shim-json-lines
18+
{"spark": "411"}
19+
spark-rapids-shim-json-lines ***/
20+
package com.nvidia.spark.rapids.shims
21+
22+
import org.apache.spark.sql.catalyst.expressions.Predicate
23+
24+
trait ShimPredicate extends Predicate {
25+
override def contextIndependentFoldable: Boolean =
26+
children.forall(_.contextIndependentFoldable)
27+
}
28+

0 commit comments

Comments
 (0)