From c48439b95b6260cc82d86e2d1b1b60c0c0448078 Mon Sep 17 00:00:00 2001 From: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com> Date: Tue, 5 Aug 2025 13:41:16 -0500 Subject: [PATCH 1/2] Expose JSON_UNION_DATA_TYPE --- src/common_union.rs | 4 +++- src/lib.rs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common_union.rs b/src/common_union.rs index 14760d1..b462136 100644 --- a/src/common_union.rs +++ b/src/common_union.rs @@ -1,5 +1,5 @@ use std::collections::HashMap; -use std::sync::{Arc, OnceLock}; +use std::sync::{Arc, LazyLock, OnceLock}; use datafusion::arrow::array::{ Array, ArrayRef, AsArray, BooleanArray, Float64Array, Int64Array, NullArray, StringArray, UnionArray, @@ -48,6 +48,8 @@ pub(crate) fn json_from_union_scalar<'a>( None } +pub static JSON_UNION_DATA_TYPE: LazyLock = LazyLock::new(JsonUnion::data_type); + #[derive(Debug)] pub(crate) struct JsonUnion { bools: Vec>, diff --git a/src/lib.rs b/src/lib.rs index 884fce5..5a9c377 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -21,7 +21,7 @@ mod json_length; mod json_object_keys; mod rewrite; -pub use common_union::{JsonUnionEncoder, JsonUnionValue}; +pub use common_union::{JsonUnionEncoder, JsonUnionValue, JSON_UNION_DATA_TYPE}; pub mod functions { pub use crate::json_as_text::json_as_text; From 52983716ce5be85f35b1cab4e0576edbfc9479d5 Mon Sep 17 00:00:00 2001 From: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com> Date: Tue, 5 Aug 2025 13:43:50 -0500 Subject: [PATCH 2/2] minor version bump --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 4820ca0..2180949 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "datafusion-functions-json" -version = "0.49.0" +version = "0.49.1" edition = "2021" description = "JSON functions for DataFusion" readme = "README.md"