Open willie-valdez opened 3 years ago
setting the node text to lower case for identifiers in the
com.linkedin.coral.hive.hive2rel.parsetree.ParseTreeBuilder
class
This is not unreasonable, given that HiveQL seems to be case insensitive, right?
@wmoustafa @losipiuk @funcheetah wdyt?
Maybe we can useorg.apache.calcite.rel.type.RelDataTypeSystem.isCaseSensitive()
, I encountered a similar problem and solved it by isCaseSensitive()
.
If we do, we will need a new RelDataTypeSystemImpl
, it's not a small change.
@wmoustafa do you think we can go with change to com.linkedin.coral.hive.hive2rel.parsetree.ParseTreeBuilder
proposed by @will-i-e? Seems easy to go but maybe you some fundamental problems with that approach?
I think the change to com.linkedin.coral.hive.hive2rel.parsetree.ParseTreeBuilder
proposed by @will-i-e might affect the case preservation of Coral-Schema. @wmoustafa @funcheetah any thoughts?
I am having a problem with hive view translation to Trino that results in a query with an ambiguous column.
I narrowed down the issue to a simple view that reproduces the issue. I also identified why this happens which is a combination of how the select is rewritten and the column aliases used.
Conditions:
Given these 2 tables:
These 2 views will have the same issue:
The translated view hive in Trino will look like this:
As you can see there are 2 columns with the same alias in the first sub-query
The problem goes away if the alias is specified in lower case in the hive view definition. Which would seem like an easy change unless you have 50k+ views owned by many different teams across the organization.
I managed to fix the issue in my local environment by setting the node text to lower case for identifiers in the
com.linkedin.coral.hive.hive2rel.parsetree.ParseTreeBuilder
class but I am not sure if this is the best place to do this or if this is the best way to resolve the problem. Would that be an acceptable change?