Skip to content

Commit

Permalink
combine api
Browse files Browse the repository at this point in the history
  • Loading branch information
liujiayi771 committed Nov 30, 2023
1 parent 5d1cceb commit b37c3db
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ object FilterHandler {
ScanTransformerFactory.createFileSourceScanTransformer(
fileSourceScan,
reuseSubquery,
filter)
filter = filter)
case batchScan: BatchScanExec =>
if (ScanTransformerFactory.supportedBatchScan(batchScan.scan)) {
ScanTransformerFactory.createBatchScanTransformer(batchScan, reuseSubquery)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,35 +36,19 @@ object ScanTransformerFactory {
def createFileSourceScanTransformer(
scanExec: FileSourceScanExec,
reuseSubquery: Boolean,
filter: FilterExec = null,
validation: Boolean = false): FileSourceScanExecTransformer = {
// TODO: Add delta match here
val leftFilters = if (filter != null) {
getLeftFilters(scanExec.dataFilters, flattenCondition(filter.condition))
} else {
Seq.empty
}
// transform BroadcastExchangeExec to ColumnarBroadcastExchangeExec in partitionFilters
val newPartitionFilters = if (validation) {
scanExec.partitionFilters
} else {
ExpressionConverter.transformDynamicPruningExpr(scanExec.partitionFilters, reuseSubquery)
}
new FileSourceScanExecTransformer(
scanExec.relation,
scanExec.output,
scanExec.requiredSchema,
newPartitionFilters,
scanExec.optionalBucketSet,
scanExec.optionalNumCoalescedBuckets,
scanExec.dataFilters,
scanExec.tableIdentifier,
scanExec.disableBucketedScan
)
}

def createFileSourceScanTransformer(
scanExec: FileSourceScanExec,
reuseSubquery: Boolean,
filter: FilterExec): FileSourceScanExecTransformer = {
val leftFilters =
getLeftFilters(scanExec.dataFilters, flattenCondition(filter.condition))
// transform BroadcastExchangeExec to ColumnarBroadcastExchangeExec in partitionFilters
val newPartitionFilters =
ExpressionConverter.transformDynamicPruningExpr(scanExec.partitionFilters, reuseSubquery)
new FileSourceScanExecTransformer(
scanExec.relation,
scanExec.output,
Expand Down

0 comments on commit b37c3db

Please sign in to comment.