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

[CALCITE-3933] Incorrect SQL Emitted for Unicode for Several Dialects #3474

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

zhougit86
Copy link

No description provided.

Copy link
Contributor

@mihaibudiu mihaibudiu left a comment

Choose a reason for hiding this comment

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

Can you also take a look at https://issues.apache.org/jira/browse/CALCITE-6006?
Does this affect RelToSql?
Is it necessary to update the corresponding tests in #3429?

@@ -537,7 +537,19 @@ public interface SqlConformance {
*/
boolean isValueAllowed();

/**
/**
Copy link
Contributor

Choose a reason for hiding this comment

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

indentation seems to be off here

Copy link
Author

Choose a reason for hiding this comment

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

modified

@@ -1486,6 +1486,9 @@ private static String toSql(RelNode root, SqlDialect dialect,
assertThat(toSql(root), isLinux(expectedSql));
}


Copy link
Contributor

Choose a reason for hiding this comment

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

are these necessary?

Copy link
Author

Choose a reason for hiding this comment

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

removed

@@ -7133,6 +7136,19 @@ private void checkLiteral2(String expression, String expected) {
sql(query).ok(expected);
}

@Test void testBigQueryUnicode() {
Copy link
Contributor

Choose a reason for hiding this comment

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

would this need a JavaDoc comment indicating the solved issue?

@Test void testParsingNonIsoCharacter() {
String sql = "select 'ק' ";
sql(sql).ok("SELECT u&'\\05e7'");
Copy link
Contributor

Choose a reason for hiding this comment

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

why remove this test? The u& is valid standard SQL and is still valid Calcite SQL

Copy link
Author

Choose a reason for hiding this comment

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

the CALCITE-6001 mentioned
'This means that when converting a query like:
select 'ק' as result;
you will get the following the error: Failed to encode 'ק' in character set 'ISO-8859-1'.'

I justed it according to this behavior

@tanclary
Copy link
Contributor

i see you based this on a couple of my commits, there's some more updated work on #3425 which might be a bit better. Let me know what you think and we can work together. Feel free to review that also^

@zhougit86
Copy link
Author

@tanclary I think rework covers more dialects, #3425 looks good to me

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.

4 participants