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

[Coral-Trino] Remove characters sets from TrinoSqlDialect #460

Merged
merged 1 commit into from
Oct 13, 2023

Conversation

KevinGe00
Copy link
Contributor

@KevinGe00 KevinGe00 commented Oct 5, 2023

What changes are proposed in this pull request, and why are they necessary?

Previously, charSetName was dropped from VARCHAR/CHAR fields when a Coral RelNode is being converted to a Trino SqlNode. This happened by overriding supportsCharSet to be false in TrinoSqlDialect. As art of merging TrinoSqlDialect -> CoralSqlDialect, we want TrinoSqlDialect to match CoralSqlDialect meaning the override needed to be undone.

Now, charSetName is instead dropped from VARCHAR/CHAR fields dropped as part of SqlNode rewriting in TrinoSqlRewriter by adding a datatype replacement rule.

How was this patch tested?

  1. clean build
  2. new unit test to test character sets are removed in CAST calls that are nested
  3. i-test passed

@KevinGe00 KevinGe00 changed the title remove char sets from TrinoSqlDialect [Coral-Trino] Remove characters sets from TrinoSqlDialect Oct 5, 2023
@aastha25
Copy link
Contributor

thanks for the PR @KevinGe00!
Please add an example in the description elaborating the previous and newer workflow - that charSetName was dropped from VARCHAR/CHAR fields when Coral RelNode converted to Trino SqlNode. Now it is dropped as part of SqlNode rewriting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants