Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
PHILO-HE committed Mar 14, 2024
1 parent 379e6e9 commit a1e9be0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion velox/functions/sparksql/SIMDJsonFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ struct SIMDGetJsonObjectFunction {
double numberResult;
error = rawResult.get_double().get(numberResult);
if (!error) {
ss << numberResult;
ss << rawResult;
result.append(ss.str());
}
return error;
Expand Down
3 changes: 3 additions & 0 deletions velox/functions/sparksql/tests/JsonFunctionsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ TEST_F(JsonFunctionTest, getJsonObject) {
EXPECT_EQ(getJsonObject(R"({"my": {"hello": 3.5}})", "$.my.hello"), "3.5");
EXPECT_EQ(getJsonObject(R"({"my": {"hello": true}})", "$.my.hello"), "true");
EXPECT_EQ(getJsonObject(R"({"hello": ""})", "$.hello"), "");
EXPECT_EQ(
"0.0215434648799772",
getJsonObject(R"({"score":0.0215434648799772})", "$.score"));
EXPECT_EQ(
getJsonObject(R"({"name": "Alice", "age": 5, "id": "001"})", "$.age"),
"5");
Expand Down

0 comments on commit a1e9be0

Please sign in to comment.