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-3130]Implement JSON_UNQUOTE, JSON_QUOTE function #1272

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

XuQianJin-Stars
Copy link
Contributor

@michaelmior
Copy link
Member

@XuQianJin-Stars Could you resolve the merge conflicts here?

@XuQianJin-Stars
Copy link
Contributor Author

hi @michaelmior I rebase this pr now, maybe the CI is broken.

*
* <p>Default value is "" from
* {@link System#getProperty(String)}. */
SQL_MODE("sqlMode", String.class);
Copy link
Member

Choose a reason for hiding this comment

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

SQL mode appears to be a MySQL-specific thing. Could you explain why it's needed here?

@michaelmior
Copy link
Member

@XuQianJin-Stars Thanks! The master branch seems to be failing on the same test and is unrelated to your changes.

@XuQianJin-Stars
Copy link
Contributor Author

hi @michaelmior Because the JSON_UNQUOTE function needs to use the NO_BACKSLASH_ESCAPES parameter to deal with the hexadecimal data escaping. And NO_BACKSLASH_ESCAPES is a kind of sqlmode in mysql. For specific explanations, please refer to the following link:
https://dev.mysql.com/doc/refman/8.0/en/json-modification-functions.html

@michaelmior
Copy link
Member

The semantics don't really match since backslash escape sequences are not disabled everywhere as they are in MySQL. Does the disabling of escape sequences really need to be supported? It seems like SQLite and SQL Server both don't have this functionality (although they have similar methods for quoting JSON strings). If we really do need to support it, I think we should find a cleaner way to configure things.

@XuQianJin-Stars
Copy link
Contributor Author

hi @michaelmior So let's not support the disabling of the escape sequence first, and when I think of a more cleaner way to configure things, I will add the disable of the escape sequence.

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