Skip to content

Commit

Permalink
feat: add respective get_by_path UDFs for JSON type (#4720)
Browse files Browse the repository at this point in the history
* feat: add respectiv get_by_path udf for json type

* Apply review comments

Co-authored-by: Weny Xu <[email protected]>

* fix: fix compile error

* refactor: change name of UDFs, add some tests

---------

Co-authored-by: Weny Xu <[email protected]>
  • Loading branch information
CookiePieWw and WenyXu authored Sep 11, 2024
1 parent aa03d3b commit 67fb3d0
Show file tree
Hide file tree
Showing 4 changed files with 715 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/common/function/src/scalars/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
// limitations under the License.

use std::sync::Arc;
mod json_get;
mod json_to_string;
mod to_json;

use json_get::{JsonGetBool, JsonGetFloat, JsonGetInt, JsonGetString};
use json_to_string::JsonToStringFunction;
use to_json::ToJsonFunction;

Expand All @@ -27,5 +29,10 @@ impl JsonFunction {
pub fn register(registry: &FunctionRegistry) {
registry.register(Arc::new(JsonToStringFunction));
registry.register(Arc::new(ToJsonFunction));

registry.register(Arc::new(JsonGetInt));
registry.register(Arc::new(JsonGetFloat));
registry.register(Arc::new(JsonGetString));
registry.register(Arc::new(JsonGetBool));
}
}
Loading

0 comments on commit 67fb3d0

Please sign in to comment.