@@ -26,7 +26,7 @@ import org.apache.spark.sql.delta.util.DeltaFileOperations.absolutePath
26
26
27
27
import org .apache .spark .broadcast .Broadcast
28
28
import org .apache .spark .sql .{Column , SparkSession }
29
- import org .apache .spark .sql .catalyst .expressions .AttributeReference
29
+ import org .apache .spark .sql .catalyst .expressions .{ AttributeReference , EqualTo , Literal }
30
30
import org .apache .spark .sql .catalyst .expressions .Literal .TrueLiteral
31
31
import org .apache .spark .sql .catalyst .plans .logical .{Filter , LogicalPlan , Project }
32
32
import org .apache .spark .sql .catalyst .rules .Rule
@@ -44,7 +44,7 @@ import org.apache.spark.util.SerializableConfiguration
44
44
* After rule:
45
45
* <Parent Node> ->
46
46
* Project(key, value) ->
47
- * Filter (udf( __skip_row == 0) ->
47
+ * Filter (__skip_row == 0) ->
48
48
* Delta Scan (key, value, __skip_row)
49
49
* - Here we insert a new column `__skip_row` in Delta scan. This value is populated by the
50
50
* Parquet reader using the DV corresponding to the Parquet file read
@@ -160,11 +160,7 @@ object ScanWithDeletionVectors {
160
160
s " Expected only one column with name= $IS_ROW_DELETED_COLUMN_NAME" )
161
161
val skipRowColumnRef = skipRowColumnRefs.head
162
162
163
- val keepRow = DeltaUDF .booleanFromByte( _ == RowIndexFilter .KEEP_ROW_VALUE )
164
- .asNondeterministic() // To avoid constant folding the filter based on stats.
165
-
166
- val filterExp = keepRow(new Column (skipRowColumnRef)).expr
167
- Filter (filterExp, newScan)
163
+ Filter (EqualTo (skipRowColumnRef, Literal (RowIndexFilter .KEEP_ROW_VALUE )), newScan)
168
164
}
169
165
170
166
private def createBroadcastDVMap (
0 commit comments