trinodb / trino

Official repository of Trino, the distributed SQL query engine for big data, formerly known as PrestoSQL (https://trino.io)
https://trino.io
Apache License 2.0
10.49k stars 3.02k forks source link

Alias is not working as expected #24019

Closed Akanksha-kedia closed 2 weeks ago

Akanksha-kedia commented 2 weeks ago

Create hive table : Image

create hive view Image

Trino 👍 select * from inner_query; Query 20241104_055531_00007_7es2f failed: Failed to translate Hive view 'kite.inner_query': org.apache.calcite.tools.ValidationException: org.apache.calcite.runtime.CalciteContextException: From line 6, column 5 to line 6, column 9: Column '_c4' not found in table 't'

wendigo commented 2 weeks ago

Where is the table t defined?

wendigo commented 2 weeks ago

You need to add explicit names to these CAST calls. Trino doesn't have hive semantics.