Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test translation of view with namesake column aliases which are differing in case #11240

Conversation

findinpath
Copy link
Contributor

@findinpath findinpath commented Mar 1, 2022

Description

In the translation of Hive views with Coral,
when joining tables that have the namesake column names,
irrespective of their case, make sure that the resulting
relation is using names of the columns which are
unique in order to avoid the situation where the
SQL statement created contains ambiguous column names.

Is this change a fix, improvement, new feature, refactoring, or other?

Test

Is this a change to the core query engine, a connector, client library, or the SPI interfaces? (be specific)

This change applies to Hive and specifically to the translation of Hive views.

How would you describe this change to a non-technical end user or system administrator?

Hive translation of views that joined tables having namesake column names spelled in different cases failed before because of ambiguous column name reference. The upgrade of the Coral library contains a fix for such usecases.

Related issues, pull requests, and links

Coral PR: linkedin/coral#234

Documentation

(x) No documentation is needed.
( ) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.

Release notes

( ) No release notes entries required.
(x) Release notes entries required with the following suggested text:

# Hive
* Coral view translation uses unique column names for namesake columns ({issue}`11240`)

@cla-bot cla-bot bot added the cla-signed label Mar 1, 2022
@findinpath findinpath marked this pull request as draft March 1, 2022 06:33
@@ -664,6 +664,28 @@ public void testViewReferencingHiveAndIcebergTables()
onHive().executeQuery("DROP TABLE default.view_iceberg_table");
}

@Test(groups = HIVE_VIEWS)
public void testNamesakeColumnsShouldGetUniqueIdentifiersDuringTheTranslationToAvoidAmbiguity()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testViewWithColumnAliasesDifferingInCase ?

@findinpath findinpath force-pushed the coral-hive-case-insensitive-handling-for-namesake-column-names branch from b72b30e to bd4a197 Compare March 1, 2022 11:29
@findinpath findinpath marked this pull request as ready for review March 8, 2022 17:21
@findinpath findinpath force-pushed the coral-hive-case-insensitive-handling-for-namesake-column-names branch from bd4a197 to e9c6da3 Compare March 8, 2022 17:21
@findinpath
Copy link
Contributor Author

Rebased on master to make use of the coral-trino library update which fixes the problem showcased by the test case from this PR.

@findinpath findinpath requested a review from findepi March 8, 2022 17:30
@findepi
Copy link
Member

findepi commented Mar 8, 2022

Can you please rename commit and PR similar to #11240 (comment) ?

@findinpath findinpath changed the title Use unique identifiers for namesake columns in view translation Test translation of view with namesake column aliases which are differing in case Mar 8, 2022
…ring in case

In the translation of Hive views with Coral,
when joining tables that have the namesake column names,
irrespective of their case, make sure that the resulting
relation is using names of the columns which are
unique in order to avoid the situation where the
SQL statement created contains ambiguous column names.
@findinpath findinpath force-pushed the coral-hive-case-insensitive-handling-for-namesake-column-names branch from e9c6da3 to ab617d1 Compare March 8, 2022 19:31
@findepi findepi merged commit 966f220 into trinodb:master Mar 9, 2022
@findepi findepi mentioned this pull request Mar 9, 2022
@github-actions github-actions bot added this to the 373 milestone Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants