Conversation
There was a problem hiding this comment.
is it possible to test this?
also, cmt title is too long. Maybe just Fix translation of FieldDereference to DereferenceExpression.
There was a problem hiding this comment.
@findepi Fixed the message. Added a test in TestConnectorExpressionTranslator. I haven't added literals for the test since the translation for them would rely on how ExpressionAnalyzer and LiteralEncoder.
There was a problem hiding this comment.
Capitalize "Mismatch", include list sizes in the error message.
| checkState(newConnectorProjections.size() == projections.size(), "mismatch between input and output projections from the connector"); | |
| checkState(newConnectorProjections.size() == projections.size(), "Mismatch between input and output projections from the connector: expected %s but got %s", projections.size(), newConnectorProjections.size()); |
(maybe you need to rewrap this)
There was a problem hiding this comment.
We have a very similar class for this already: ReferenceAwareExpressionNodeInliner
There was a problem hiding this comment.
I generally try to avoid generic "Util" classes, as they tend to become junk drawers over time. Instead, I'd create dedicated utilities (i.e., PartialTranslator, ExpressionReplacer). See, for example ExpressionNodeInliner, ExpressionExtractor or SortExpressionExtractor.
There was a problem hiding this comment.
Unnecessary formatting change. This was previously:
Map<String, ColumnHandle> assignments = tableScan.getAssignments()
.entrySet().stream()d1553c7 to
4c4ade5
Compare
|
@martint Thanks for the review, I've addressed your comments. |
|
@phd3 please see Travis. |
4c4ade5 to
488cafc
Compare
|
thanks @findepi, I've fixed related errors. |
martint
left a comment
There was a problem hiding this comment.
One minor comment, but otherwise, it looks good. Let me know once you've addressed it and I'll merge it. Thanks for working on this!
There was a problem hiding this comment.
Rephrase the commit message: "Update constructor visibility in ReferenceAwareExpressionNodeInliner"
488cafc to
1f7a1d9
Compare
|
@martint Modified the commit message and cleanly rebased. |
1f7a1d9 to
9ff9864
Compare
|
@martint There's one non-trivial change for catering to lambda expressions that I've made after the rebase. All tests seem to pass now. Curious if there are other cases of context-dependent symbols like in lambda expressions. |
The only other case would be in the context of a correlated subquery. But those appear at the "top level" from the point of view of the plan operation (i.e., not within a nested context like lambda expressions), are are not bound to columns. |
|
Merged, thanks for working on this! |
Splitting partial projection extraction from #1720. cc @martint @wagnermarkd
Some notes:
Currently, PushProjectionIntoTableScan is applied only in cases where all expressions are completely convertible to a connector level expressions. The only expressions that satisfy this criteria are simple column references, dereference expressions and constants. Any expression that involves anything more complex will not invoke PushProjectionIntoTableScan. So there is no opportunity for pushing down such expressions into the connector.
For example, for projections [“a.b.c”, “d”], the PushProjectionIntoTableScan rule will be invoked. But, for projections [“a.b.c” + “c.d”, “e”], it will be a no-op. This is very primitive, because such a pushdown will not work for even slightly complex projections. In such cases, we know that even if “a.b.c” + “c.d” cannot be pushed down, the individual subexpressions “a.b.c” and “c.d” can be. We need to implement the partial projection pushdown support for that.
After the partial projection support, the PushProjectionIntoTableScan would look like the following: