Repository navigation
Commit 02aa2bb
committed
perf: check a repeated argument once when matching a UDF's null guard
BooleanSimplification drops a repeated isnull from the predicate that
HandleNullInputsForUDF builds, so with a column at two primitive
positions, f(a, a) optimizes to if (isnull(a)) null else
f(knownnotnull(a), knownnotnull(a)). The predicate rebuilt for the match
kept every repeat, so those guards stayed native. It is now rebuilt from
an ExpressionSet of the guarded arguments. ExpressionSet keeps every
nondeterministic argument, so a guard over one still stays native.
The first null guard test also covers addBoth(a, a), addThree(a, b, a)
and addBoth(a, 1L), the last with an argument that cannot be null.1 parent 68aac67 commit 02aa2bb
2 files changed
Lines changed: 17 additions & 5 deletions
File tree
- spark/src
- main/scala/org/apache/comet/serde
- test/scala/org/apache/comet
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | | - | |
77 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
110 | 111 | | |
111 | | - | |
| 112 | + | |
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1035 | 1035 | | |
1036 | 1036 | | |
1037 | 1037 | | |
| 1038 | + | |
| 1039 | + | |
1038 | 1040 | | |
1039 | 1041 | | |
1040 | 1042 | | |
| |||
1053 | 1055 | | |
1054 | 1056 | | |
1055 | 1057 | | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
1056 | 1067 | | |
1057 | 1068 | | |
1058 | 1069 | | |
| |||
0 commit comments