Zoltan Borok-Nagy has posted comments on this change. ( 
https://gerrit.cloudera.org/25284 )

Change subject: IMPALA-15714: Fix parsing error for SQL from UnpivotTableRef
......................................................................


Patch Set 1:

(4 comments)

Thanks for working on the fix!

PivotTableRef.tableRefToSql() has the same quoting gap: PIVOT (sum(a) FOR 
`from` IN (4 AS x)) is stored as `FOR from IN (4 x)` and the view fails to 
load. Fine to fix here or in a follow-up Jira.

https://gerrit.cloudera.org/#/c/25284/1//COMMIT_MSG
Commit Message:

https://gerrit.cloudera.org/#/c/25284/1//COMMIT_MSG@10
PS1, Line 10: the
redundant 'the'


https://gerrit.cloudera.org/#/c/25284/1//COMMIT_MSG@10
PS1, Line 10: folllowed
typo: followed


https://gerrit.cloudera.org/#/c/25284/1/fe/src/main/java/org/apache/impala/analysis/UnpivotTableRef.java
File fe/src/main/java/org/apache/impala/analysis/UnpivotTableRef.java:

https://gerrit.cloudera.org/#/c/25284/1/fe/src/main/java/org/apache/impala/analysis/UnpivotTableRef.java@356
PS1, Line 356: ToSqlUtils.encodeColumnName
encodeColumnName() only checks Impala reserved words, so legal column names 
like `v 1` or `v-2` are still printed bare (`v 1 AS 'v 1'`) and the view still 
fails to load.
Please use ToSqlUtils.getIdentSql() as SelectListItem/TableRef do, this way can 
also keep encodeColumnName() private.


https://gerrit.cloudera.org/#/c/25284/1/testdata/workloads/functional-query/queries/QueryTest/unpivot-clause.test
File testdata/workloads/functional-query/queries/QueryTest/unpivot-clause.test:

https://gerrit.cloudera.org/#/c/25284/1/testdata/workloads/functional-query/queries/QueryTest/unpivot-clause.test@394
PS1, Line 394: # UNPIVOT clause in a view.
Please add ToSqlTest cases too: identifiers that need backticks (path, 
data/header columns, IN items, alias) and the IN (v1, v2) form without labels.



--
To view, visit https://gerrit.cloudera.org/25284
To unsubscribe, visit https://gerrit.cloudera.org/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I8e9393325130d7da08b5aa9ffab4e0c08e3b9e8a
Gerrit-Change-Number: 25284
Gerrit-PatchSet: 1
Gerrit-Owner: Xuebin Su <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]>
Gerrit-Comment-Date: Wed, 04 Nov 2026 10:03:01 +0000
Gerrit-HasComments: Yes

Reply via email to