-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Support alternate format for Utf8 unparsing (CHAR) #11494
Conversation
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 for the contribution @sgrebnov . I had a suggestion on the API -- let me know what you think
@alamb - 👍 I was thinking about this as well, but was unable to come up with other good potential types for string unparsing (asf data types) so decided to proceed with this approach. As we have more people thinking that we should better to return the type here I'll update my PR. Note - as we have different types for |
e263539
to
6c3b941
Compare
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.
Looks good to me -- thank you @sgrebnov
* Add dialect param to use CHAR instead of TEXT for Utf8 unparsing for MySQL (apache#12) * Configurable data type instead of flag for Utf8 unparsing * Fix type in comment
* Add dialect param to use CHAR instead of TEXT for Utf8 unparsing for MySQL (apache#12) * Configurable data type instead of flag for Utf8 unparsing * Fix type in comment
* Add dialect param to use CHAR instead of TEXT for Utf8 unparsing for MySQL (apache#12) * Configurable data type instead of flag for Utf8 unparsing * Fix type in comment
* Add dialect param to use CHAR instead of TEXT for Utf8 unparsing for MySQL (#12) * Configurable data type instead of flag for Utf8 unparsing * Fix type in comment
Which issue does this PR close?
PR addresses Utf8 unparser issue producing invalid
CAST(col AS TEXT)
SQL for MySQL.Rationale for this change
MySQL cast function does not support
TEXT
and requiresCHAR
for CAST (automatically returns VARCHAR, TEXT, LONGTEXT)Example query:
Before this change (fails in MySQL)
After this change (works in MySQL)
What changes are included in this PR?
PR introduces configurable
use_char_for_utf8_cast
dialect parameter that controls whether CHAR vs TEXT/VARCHAR is used for Utf8 unparsing.Are these changes tested?
Yes, added unit tests + manual testing
Are there any user-facing changes?
CustomDialectBuilder
now supportsuse_char_for_utf8_cast
that can be used to specify whether CHAR vs TEXT/VARCHAR data type should be used for Utf8 unparsing.