Skip to content

Commit 52fae14

Browse files
authored
Expose JSON_UNION_DATA_TYPE (#95)
1 parent e6fb734 commit 52fae14

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "datafusion-functions-json"
3-
version = "0.49.0"
3+
version = "0.49.1"
44
edition = "2021"
55
description = "JSON functions for DataFusion"
66
readme = "README.md"

src/common_union.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use std::collections::HashMap;
2-
use std::sync::{Arc, OnceLock};
2+
use std::sync::{Arc, LazyLock, OnceLock};
33

44
use datafusion::arrow::array::{
55
Array, ArrayRef, AsArray, BooleanArray, Float64Array, Int64Array, NullArray, StringArray, UnionArray,
@@ -48,6 +48,8 @@ pub(crate) fn json_from_union_scalar<'a>(
4848
None
4949
}
5050

51+
pub static JSON_UNION_DATA_TYPE: LazyLock<DataType> = LazyLock::new(JsonUnion::data_type);
52+
5153
#[derive(Debug)]
5254
pub(crate) struct JsonUnion {
5355
bools: Vec<Option<bool>>,

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ mod json_length;
2121
mod json_object_keys;
2222
mod rewrite;
2323

24-
pub use common_union::{JsonUnionEncoder, JsonUnionValue};
24+
pub use common_union::{JsonUnionEncoder, JsonUnionValue, JSON_UNION_DATA_TYPE};
2525

2626
pub mod functions {
2727
pub use crate::json_as_text::json_as_text;

0 commit comments

Comments
 (0)