Quanlong Huang has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/17811 )

Change subject: IMPALA-9498: Allow returning arrays in select list
......................................................................


Patch Set 28:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/17811/28/fe/src/main/java/org/apache/impala/analysis/Analyzer.java
File fe/src/main/java/org/apache/impala/analysis/Analyzer.java:

http://gerrit.cloudera.org:8080/#/c/17811/28/fe/src/main/java/org/apache/impala/analysis/Analyzer.java@770
PS28, Line 770:     tableRefMap_.put(desc.getId(), ref);
I think this causes an issue that the collection can be incorrectly used in the 
SelectList (not just used in the FROM clause). E.g., query "select pos from 
(select int_array from functional_parquet.complextypestbl) v" should raise 
error about cannot resolve "pos". But the analyzer is able to resolve "pos", 
because it sees "v.int_array" in the tableRefMap_.

Take another example, query "select pos from (select int_array from 
functional_parquet.complextypestbl) v, v.int_array" should work without 
ambiguation. But it fails because the analyzer sees two "v.int_array" in 
tableRefMap_ and they both have the "pos" field.

I think calling ref.setHidden(true) might solve this. But not sure if it 
introduces other issues.


http://gerrit.cloudera.org:8080/#/c/17811/28/fe/src/main/java/org/apache/impala/analysis/Analyzer.java@1405
PS28, Line 1405:     collTblRef.setInSelectList(true);
Is it possible to add a check about this? I wonder if all the code paths go 
here are analyzing the SelectList clause.



--
To view, visit http://gerrit.cloudera.org:8080/17811
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibb1e42ffb21c7ddc033aba0f754b0108e46f34d0
Gerrit-Change-Number: 17811
Gerrit-PatchSet: 28
Gerrit-Owner: Csaba Ringhofer <[email protected]>
Gerrit-Reviewer: Attila Jeges <[email protected]>
Gerrit-Reviewer: Csaba Ringhofer <[email protected]>
Gerrit-Reviewer: Daniel Becker <[email protected]>
Gerrit-Reviewer: Gabor Kaszab <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Qifan Chen <[email protected]>
Gerrit-Reviewer: Quanlong Huang <[email protected]>
Gerrit-Comment-Date: Thu, 23 Dec 2021 03:30:54 +0000
Gerrit-HasComments: Yes

Reply via email to