tedyu commented on a change in pull request #31613:
URL: https://github.com/apache/spark/pull/31613#discussion_r581342459



##########
File path: sql/core/src/test/resources/sql-tests/results/postgreSQL/join.sql.out
##########
@@ -3225,7 +3225,7 @@ select * from
 struct<>
 -- !query output
 org.apache.spark.sql.AnalysisException
-Reference 'f1' is ambiguous, could be: j.f1, j.f1.; line 2 pos 63
+Reference 'f1' is ambiguous, could be: j.f1#x, j.f1#x.; line 2 pos 63

Review comment:
       For json path expression case, one expression is from filter and the 
other is from projection.
   ```
         String query = "SELECT id, address, get_json_string(phone, 
'$.key[1].m[2].b') as key " +
                       "FROM mycatalog.test.person " +
                       "WHERE get_json_string(phone, '$.key[1].m[2].b') >= 
'100' order by id limit 2";
   ```
   get_json_string produces the json path expression.
   
   See innerResolve() of 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:
   ```
   2021-02-21 04:04:00,467 (Time-limited test) [DEBUG - 
org.apache.spark.internal.Logging.logDebug(Logging.scala:61)] inner Resolving 
'phone->'key'->1->'m'->2->>'b' to phone->'key'->1->'m'->2->>'b'#25
   ```
   I am willing to get input from people who are familiar with the analyzer.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to