Skip to content

Conversation

@Zouxxyy
Copy link
Contributor

@Zouxxyy Zouxxyy commented Nov 13, 2025

What changes are proposed in this pull request?

Before we use getRemainingCondition to caculate the real fitler condiction in FilterExecTransformer, in this pr, just remove pushed down filter in FilterExecTransformer to reflect the node's actual behavior.

How was this patch tested?

@github-actions github-actions bot added CORE works for Gluten Core VELOX labels Nov 13, 2025
@github-actions
Copy link

Run Gluten Clickhouse CI on x86

@github-actions
Copy link

Run Gluten Clickhouse CI on x86

1 similar comment
@github-actions
Copy link

Run Gluten Clickhouse CI on x86

} else {
val remainingFilters =
FilterHandler.getRemainingFilters(scanFilters, splitConjunctivePredicates(filter.cond))
val newCond = remainingFilters.reduceLeftOption(And).orNull
Copy link
Contributor Author

@Zouxxyy Zouxxyy Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we could remove the filterNode if newCond is null. If guys agree, I can include this change in this PR CC @zhztheplayer

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we could remove the filterNode if newCond is null.

I previously attempted something similar, but ended up facing some attribute mismatch errors from Catalyst.

I didn't look into that issue too much, so feel free to try from your end if you're interested.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

facing some attribute mismatch errors from Catalyst.

@zhztheplayer I checked the logic of FilterExec and confirmed that its output indeed changes—it equals the child's output plus some NOT NULL attributes added by the condition. Therefore, I made the following modifications:

  • Extracted a helper method buildNewOutput(output, conds) from FilterExec.
  • If pushedFilter nonEmpty:
    • Set ScanNode's newOutput = buildNewOutput(output, pushedFilter).
    • Set FilterNode's newCond = cond -- pushedFilter. (If newCond == null, remove the filter node.)

I believe this better reflects Node's correct behavior, although perhaps all golden files should be updated.

@wForget
Copy link
Member

wForget commented Nov 14, 2025

Do pushedDownFilters always work for all datasource scans? I'm worried that some datasource scan implementations might ignore some unsupported pushedDownFilters.

@Zouxxyy
Copy link
Contributor Author

Zouxxyy commented Nov 14, 2025

Do pushedDownFilters always work for all datasource scans? I'm worried that some datasource scan implementations might ignore some unsupported pushedDownFilters.

The logic should be the same as before, because we were already using getRemainingCondition to generate the Filter Transform previously. I just made the execution plan more accurately reflect its actual behavior. For example, users might notice there's a filter node, but in reality, it doesn't do anything.

@wForget
Copy link
Member

wForget commented Nov 14, 2025

Do pushedDownFilters always work for all datasource scans? I'm worried that some datasource scan implementations might ignore some unsupported pushedDownFilters.

The logic should be the same as before, because we were already using getRemainingCondition to generate the Filter Transform previously. I just made the execution plan more accurately reflect its actual behavior. For example, users might notice there's a filter node, but in reality, it doesn't do anything.

Got it, thank you for your explanation.

@github-actions
Copy link

Run Gluten Clickhouse CI on x86

@github-actions
Copy link

Run Gluten Clickhouse CI on x86

@Zouxxyy Zouxxyy marked this pull request as draft November 15, 2025 10:30
@github-actions
Copy link

Run Gluten Clickhouse CI on x86

@github-actions
Copy link

Run Gluten Clickhouse CI on x86

@github-actions
Copy link

Run Gluten Clickhouse CI on x86

@github-actions
Copy link

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the stale stale label Dec 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants