[jira] [Commented] (CALCITE-2542) SqlNode AtomicRowExpression + DOT operation does not work for constructed ROWs
[ https://issues.apache.org/jira/browse/CALCITE-2542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16706419#comment-16706419 ] Julian Hyde commented on CALCITE-2542: -- I reviewed, and it makes sense to check for "*" (e.g. tableName.columnName.*.field) at validation time rather than parse time. Fixed in [45258404|http://git-wip-us.apache.org/repos/asf/calcite/commit/45258404]; thanks for the PR, [~walterddr]! > SqlNode AtomicRowExpression + DOT operation does not work for constructed ROWs > -- > > Key: CALCITE-2542 > URL: https://issues.apache.org/jira/browse/CALCITE-2542 > Project: Calcite > Issue Type: Bug > Components: core >Reporter: Rong Rong >Assignee: Julian Hyde >Priority: Major > > It seems like some of the {{AtomicRowExpression}} (such as > {{NamedFunctionCall}}) or rowSpan with {{}} operator does not allow > following DOT operators in Parser.jj > To named a few, the following does not parse correctly. > {code} > SELECT ROW(col1, col2, col3).col1 FROM t > SELECT myFunc(arg1, arg2).col1 FROM t > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CALCITE-2542) SqlNode AtomicRowExpression + DOT operation does not work for constructed ROWs
[ https://issues.apache.org/jira/browse/CALCITE-2542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16695452#comment-16695452 ] Rong Rong commented on CALCITE-2542: Created PR: https://github.com/apache/calcite/pull/933. I wasn't able to find an easy way to look behind for {{*}} operator when parsing dot so i move the logic to validation phase. Please kindly take a look. > SqlNode AtomicRowExpression + DOT operation does not work for constructed ROWs > -- > > Key: CALCITE-2542 > URL: https://issues.apache.org/jira/browse/CALCITE-2542 > Project: Calcite > Issue Type: Bug > Components: core >Reporter: Rong Rong >Assignee: Julian Hyde >Priority: Major > > It seems like some of the {{AtomicRowExpression}} (such as > {{NamedFunctionCall}}) or rowSpan with {{}} operator does not allow > following DOT operators in Parser.jj > To named a few, the following does not parse correctly. > {code} > SELECT ROW(col1, col2, col3).col1 FROM t > SELECT myFunc(arg1, arg2).col1 FROM t > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CALCITE-2542) SqlNode AtomicRowExpression + DOT operation does not work for constructed ROWs
[ https://issues.apache.org/jira/browse/CALCITE-2542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16680800#comment-16680800 ] Julian Hyde commented on CALCITE-2542: -- That's fine. > SqlNode AtomicRowExpression + DOT operation does not work for constructed ROWs > -- > > Key: CALCITE-2542 > URL: https://issues.apache.org/jira/browse/CALCITE-2542 > Project: Calcite > Issue Type: Bug > Components: core >Reporter: Rong Rong >Assignee: Julian Hyde >Priority: Major > > It seems like some of the {{AtomicRowExpression}} (such as > {{NamedFunctionCall}}) or rowSpan with {{}} operator does not allow > following DOT operators in Parser.jj > To named a few, the following does not parse correctly. > {code} > SELECT ROW(col1, col2, col3).col1 FROM t > SELECT myFunc(arg1, arg2).col1 FROM t > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CALCITE-2542) SqlNode AtomicRowExpression + DOT operation does not work for constructed ROWs
[ https://issues.apache.org/jira/browse/CALCITE-2542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16680772#comment-16680772 ] Rong Rong commented on CALCITE-2542: Thanks for the clarification [~suez1224] [~julianhyde]. I like the idea of separating support for {{}} into a another JIRA. In this JIRA I will make '.' as infix operator that supports "identifier" first on the RHS. > SqlNode AtomicRowExpression + DOT operation does not work for constructed ROWs > -- > > Key: CALCITE-2542 > URL: https://issues.apache.org/jira/browse/CALCITE-2542 > Project: Calcite > Issue Type: Bug > Components: core >Reporter: Rong Rong >Assignee: Julian Hyde >Priority: Major > > It seems like some of the {{AtomicRowExpression}} (such as > {{NamedFunctionCall}}) or rowSpan with {{}} operator does not allow > following DOT operators in Parser.jj > To named a few, the following does not parse correctly. > {code} > SELECT ROW(col1, col2, col3).col1 FROM t > SELECT myFunc(arg1, arg2).col1 FROM t > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CALCITE-2542) SqlNode AtomicRowExpression + DOT operation does not work for constructed ROWs
[ https://issues.apache.org/jira/browse/CALCITE-2542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16678858#comment-16678858 ] Julian Hyde commented on CALCITE-2542: -- If we implemented types with member functions we'd need function syntax on the RHS of a dot. It would be nice if we were able to parse the syntax now. > SqlNode AtomicRowExpression + DOT operation does not work for constructed ROWs > -- > > Key: CALCITE-2542 > URL: https://issues.apache.org/jira/browse/CALCITE-2542 > Project: Calcite > Issue Type: Bug > Components: core >Reporter: Rong Rong >Assignee: Julian Hyde >Priority: Major > > It seems like some of the {{AtomicRowExpression}} (such as > {{NamedFunctionCall}}) or rowSpan with {{}} operator does not allow > following DOT operators in Parser.jj > To named a few, the following does not parse correctly. > {code} > SELECT ROW(col1, col2, col3).col1 FROM t > SELECT myFunc(arg1, arg2).col1 FROM t > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CALCITE-2542) SqlNode AtomicRowExpression + DOT operation does not work for constructed ROWs
[ https://issues.apache.org/jira/browse/CALCITE-2542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16678780#comment-16678780 ] Shuyi Chen commented on CALCITE-2542: - Thanks for the work, Rong! I think you need to also add test in SqlValidatorTest and SqlToRelConverterTest as well. [~julianhyde], can you give an example of a function(arg, ...) on the right side of a dot operator? I think method is not supported for record type, right? > SqlNode AtomicRowExpression + DOT operation does not work for constructed ROWs > -- > > Key: CALCITE-2542 > URL: https://issues.apache.org/jira/browse/CALCITE-2542 > Project: Calcite > Issue Type: Bug > Components: core >Reporter: Rong Rong >Assignee: Julian Hyde >Priority: Major > > It seems like some of the {{AtomicRowExpression}} (such as > {{NamedFunctionCall}}) or rowSpan with {{}} operator does not allow > following DOT operators in Parser.jj > To named a few, the following does not parse correctly. > {code} > SELECT ROW(col1, col2, col3).col1 FROM t > SELECT myFunc(arg1, arg2).col1 FROM t > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CALCITE-2542) SqlNode AtomicRowExpression + DOT operation does not work for constructed ROWs
[ https://issues.apache.org/jira/browse/CALCITE-2542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16677732#comment-16677732 ] Rong Rong commented on CALCITE-2542: Yes. I agree that {{emp.*.xx}} should definitely not be allowed. Working on a solid fix based on the suggestions. Thanks for helpful suggestions [~julianhyde]! > SqlNode AtomicRowExpression + DOT operation does not work for constructed ROWs > -- > > Key: CALCITE-2542 > URL: https://issues.apache.org/jira/browse/CALCITE-2542 > Project: Calcite > Issue Type: Bug > Components: core >Reporter: Rong Rong >Assignee: Julian Hyde >Priority: Major > > It seems like some of the {{AtomicRowExpression}} (such as > {{NamedFunctionCall}}) or rowSpan with {{}} operator does not allow > following DOT operators in Parser.jj > To named a few, the following does not parse correctly. > {code} > SELECT ROW(col1, col2, col3).col1 FROM t > SELECT myFunc(arg1, arg2).col1 FROM t > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CALCITE-2542) SqlNode AtomicRowExpression + DOT operation does not work for constructed ROWs
[ https://issues.apache.org/jira/browse/CALCITE-2542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16677091#comment-16677091 ] Julian Hyde commented on CALCITE-2542: -- I hope we agree that "SELECT emp.*.xx FROM myTable" is invalid and should remain so. Yes, it's similar to CALCITE-2016, but you need to go further, and make '.' an infix operator. On the left side of the '.' we should allow any expression. (The parser should accept anything, except "*" or ".*", and the validator can fail if the left-hand side is not a record type.) On the right side of the '.' we need to allow "identifier" or "function(arg,...)". > SqlNode AtomicRowExpression + DOT operation does not work for constructed ROWs > -- > > Key: CALCITE-2542 > URL: https://issues.apache.org/jira/browse/CALCITE-2542 > Project: Calcite > Issue Type: Bug > Components: core >Reporter: Rong Rong >Assignee: Julian Hyde >Priority: Major > > It seems like some of the {{AtomicRowExpression}} (such as > {{NamedFunctionCall}}) or rowSpan with {{}} operator does not allow > following DOT operators in Parser.jj > To named a few, the following does not parse correctly. > {code} > SELECT ROW(col1, col2, col3).col1 FROM t > SELECT myFunc(arg1, arg2).col1 FROM t > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CALCITE-2542) SqlNode AtomicRowExpression + DOT operation does not work for constructed ROWs
[ https://issues.apache.org/jira/browse/CALCITE-2542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16608105#comment-16608105 ] Rong Rong commented on CALCITE-2542: This might have been similar to CALCITE-2016, I actually tried to modify the {{Parser.jj}} to allow generically a {{}} operator afterwards. Seems like it also breaks some validation test which the SQL are suppose to be invalid. For example: {code} SELECT emp.*^.^xx FROM table {code} should not be allowed. > SqlNode AtomicRowExpression + DOT operation does not work for constructed ROWs > -- > > Key: CALCITE-2542 > URL: https://issues.apache.org/jira/browse/CALCITE-2542 > Project: Calcite > Issue Type: Bug > Components: core >Reporter: Rong Rong >Assignee: Julian Hyde >Priority: Major > > It seems like some of the {{AtomicRowExpression}} (such as > {{NamedFunctionCall}}) or rowSpan with {{}} operator does not allow > following DOT operators in Parser.jj > To named a few, the following does not parse correctly. > {code} > SELECT ROW(col1, col2, col3).col1 FROM t > SELECT myFunc(arg1, arg2).col1 FROM t > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)