[BugFix] Respect ALLOW_THROW_EXCEPTION in parse_json#74953
Conversation
parse_json() swallowed JSON parse errors by appending NULL even when sql_mode='ALLOW_THROW_EXCEPTION', while get_json_string was fixed to raise in that mode by StarRocks#73199. Mirror that fix in JsonFunctions::parse_json so malformed JSON fails the query (e.g. INSERT..SELECT) instead of silently producing NULL. Default (non-strict) behavior is unchanged. Add test/sql/test_json SQL test covering parse_json vs get_json_string under ALLOW_THROW_EXCEPTION. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
hyper seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Signed-off-by: Hyper-FF <253014618+Hyper-FF@users.noreply.github.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[FE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[BE Incremental Coverage Report]❌ fail : 1 / 2 (50.00%) file detail
|
Why I'm doing:
parse_json() swallowed JSON parse errors by appending NULL even when sql_mode='ALLOW_THROW_EXCEPTION', while get_json_string was fixed to raise in that mode by #73199. Mirror that fix in JsonFunctions::parse_json so malformed JSON fails the query (e.g. INSERT..SELECT) instead of silently producing NULL. Default (non-strict) behavior is unchanged.
Add test/sql/test_json SQL test covering parse_json vs get_json_string under ALLOW_THROW_EXCEPTION.
What I'm doing:
Fixes #issue
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: