-
Notifications
You must be signed in to change notification settings - Fork 82
Show original characters for string literals instead of escaping #675
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
Conversation
assertSqlFormatter("U&'!+10FFFF!6d4B!8Bd5ABC!6d4B!8Bd5' UESCAPE '!'", "'\uDBFF\uDFFF测试ABC测试'"); | ||
assertSqlFormatter("U&'\\+10FFFF\\6D4B\\8BD5\\0041\\0042\\0043\\6D4B\\8BD5'", "'\uDBFF\uDFFF测试ABC测试'"); | ||
assertSqlFormatter("U&'\\\\abc\\6D4B'''", "'\\abc测'''"); | ||
assertSqlFormatter("'攻殻機動隊'", "'攻殻機動隊'"); | ||
assertSqlFormatter("'😂'", "'😂'"); | ||
assertSqlFormatter("'시험'", "'시험'"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -33,6 +33,7 @@ | |||
import static java.util.Objects.requireNonNull; | |||
import static org.assertj.core.api.Assertions.assertThat; | |||
|
|||
@Test(singleThreaded = true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: Reloading DuckDB would be triggered by other test cases (set init-sql). Run tests sequentially to avoid testing failure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another test class, TestDuckDBResource
, which uses setDuckDBInitSQL
, is already set to singleThreaded
. They don't affect each other. We don't need to make any adjustments now. If we encounter any issues in the future, we can then modify the test suite as necessary.
} | ||
|
||
StringBuilder builder = new StringBuilder(); | ||
if (dialect == DEFAULT || dialect == DUCKDB || dialect == POSTGRES) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw there're some DuckDB-specific behaviors. Do they work well if we remove the dialect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't worry. This condition has a test called testDecimalRewrite
to cover it by #261. The test is successful after this adjustment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @grieve54706 LGTM.
* Show original characters for string literals instead of escaping * Make TestWrenWithDuckDBTableFunction be single threaded to avoid concurrent issue
Resolve #673
Follow Trino
trinodb/trino#18256