adragomir opened a new issue, #15118:
URL: https://github.com/apache/datafusion/issues/15118

   ### Describe the bug
   
   with SQLParser 0.53, this works: 
   ```
   SELECT * 
   FROM
       (meta_asset_featurization AS asset_meta
       INNER JOIN meta_asset_summary_metrics AS asset_metrics ON (
           asset_meta.struct_field['substruct']['substruct'] = 
asset_metrics.struct_field['substruct']['substruct']
       ))
   
   ```
   
   with SQLParser 0.54, this no longer works, the newly added 
`sql_compound_field_access_to_expr` interprets the `root` (in this case for 
example `asset_meta`) as a column name instead of a table. 
   The solution (workaround) for SQLParser 0.54 is to do 
   ```
   SELECT * 
   FROM
       (meta_asset_featurization AS asset_meta
       INNER JOIN meta_asset_summary_metrics AS asset_metrics ON (
           asset_meta.struct_field.substruct.substruct = 
asset_metrics.struct_field.substruct.substruct
       ))
   ```
   
   Is this intended ? I have tried to see the history, but unsure which 
behavior is correct. Since we do interpret the `[]` index access in the case of 
NOT having to specify the table correctly (so, if I have a single table and I 
specify directly the column `col['substruct']['substruct']` it works), why 
wouldn't this case work ? 
   
   ### To Reproduce
   
   _No response_
   
   ### Expected behavior
   
   Structure field access with either dot acess `.subfield` or subscript 
access`['subfield']` should work in the same way and yield the same result in 
all conditions
   
   ### Additional context
   
   _No response_


-- 
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.

To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to