[CALCITE-6744] RelMetadataQuery.getColumnOrigins should return null when column origin includes correlation variables#4145
Conversation
| if (inputSet != null) { | ||
| set.addAll(inputSet); | ||
| if (inputSet == null) { | ||
| return null; |
There was a problem hiding this comment.
The logic here doesn't seem to fit the documentation.
set of origin columns, or null if this information cannot be determined (whereas empty set indicates definitely no origin columns at all)
| return null; | ||
| } | ||
|
|
||
| @Override public Void visitFieldAccess(RexFieldAccess fieldAccess) { |
There was a problem hiding this comment.
why does this indicate an access in a correlated variable?
could this be an access into a field with type ROW?
There was a problem hiding this comment.
You're right, there's a processing problem here. I fixed it.
There was a problem hiding this comment.
I think there is a bug. What if fieldAccess.getReferenceExpr() is input ref ? For example: 'struct_column.field1.field2'. struct_column is InputRef.
Or:
$cor0.struct_field.field_1I think implementation should be:
@Override public Void visitFieldAccess(RexFieldAccess fieldAccess) {
if (fieldAccess.getReferenceExpr() instanceof RexCorrelVariable) {
throw Util.FoundOne.NULL;
}
return super.visitFieldAccess(fieldAccess)
}Or probably just use
@Override public R visitCorrelVariable(RexCorrelVariable correlVariable) {
throw Util.FoundOne.NULL;
}There was a problem hiding this comment.
@dssysolyatin comments on a closed PR will be easy to overlook, if you think there is a problem, please file another JIRA issue.
|
PR and commit should match JIRA |
…hen column origin includes correlation variables
957de76 to
bc5b23e
Compare
|
Done. |



…lation variable