Skip to content

Commit

Permalink
[GLUTEN-2777][CH]Bug fix get_json_object parse json error while path …
Browse files Browse the repository at this point in the history
…is number (apache#2780)

What changes were proposed in this pull request?
(Please fill in changes proposed in this fix)

(Fixes: apache#2777)

based on pr: ClickHouse/ClickHouse#53470 ClickHouse/ClickHouse#57096

How was this patch tested?
UT

(If this patch involves UI changes, please attach a screenshot; otherwise, remove this)
  • Loading branch information
KevinyhZou authored Dec 12, 2023
1 parent 9c98620 commit 3274a91
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,20 @@ class GlutenFunctionValidateSuite extends GlutenClickHouseWholeStageTransformerS
}
}

test("Test get_json_object 10") {
runQueryAndCompare("SELECT get_json_object(string_field1, '$.12345') from json_test") { _ => }
runQueryAndCompare("SELECT get_json_object(string_field1, '$.123.abc') from json_test") { _ => }
runQueryAndCompare("SELECT get_json_object(string_field1, '$.123.123') from json_test") { _ => }
runQueryAndCompare("SELECT get_json_object(string_field1, '$.123abc.123') from json_test") {
_ =>
}
runQueryAndCompare("SELECT get_json_object(string_field1, '$.abc.123') from json_test") { _ => }
runQueryAndCompare("SELECT get_json_object(string_field1, '$.123[0]') from json_test") { _ => }
runQueryAndCompare("SELECT get_json_object(string_field1, '$.123[0].123') from json_test") {
_ =>
}
}

test("Test covar_samp") {
runQueryAndCompare("SELECT covar_samp(double_field1, int_field1) from json_test") { _ => }
}
Expand Down

0 comments on commit 3274a91

Please sign in to comment.