-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[CALCITE-7345] Quidem test support for Field Trimmer #4708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| int thresholdValue = ((BigDecimal) value).intValue(); | ||
| closer.add(Prepare.THREAD_INSUBQUERY_THRESHOLD.push(thresholdValue)); | ||
| } | ||
| if (propertyName.equals("trimfields")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what I don't understand is "at which point during compilation is field trimming executed"?
The result will depend on the optimizations that are executed before and after.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The field trimmer is executed in two phases: the first one occurs after the SQL is converted into a Rel, and the second one takes place during the optimization of the RelNode.
xiedeyantu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look fine, only one small problem remains.
| if (propertyName.equals("trimfields")) { | ||
| final boolean b = value instanceof Boolean | ||
| && (Boolean) value; | ||
| closer.add( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be the same issue as with Mihai: will there be two places in the entire process where Trimer is performed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. The field trimmer occurs twice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a question that might not be directly related to the PR: why is column pruning necessary in both phases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first fields trimmer occurs after the SQL is converted into a RelNode. At this stage, the RelNode should be simplified before optimization, making subsequent optimization plans more lightweight. The second fields trimmer happens during or after optimization—during this phase, certain columns may no longer be needed. For example, a condition like (age <> 5 OR age = 5) can be directly simplified to True, allowing the age column to be eliminated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your detailed explanation. We'll wait and see if @mihaibudiu has any further comments; if not, I think you can merge them anytime.
|



No description provided.