File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -97,13 +97,13 @@ impl From<i64> for JsonPath<'_> {
9797}
9898
9999#[ derive( Debug ) ]
100- enum JsonPathArgs < ' a > {
100+ pub enum JsonPathArgs < ' a > {
101101 Array ( & ' a ArrayRef ) ,
102102 Scalars ( Vec < JsonPath < ' a > > ) ,
103103}
104104
105105impl < ' s > JsonPathArgs < ' s > {
106- fn extract_path ( path_args : & ' s [ ColumnarValue ] ) -> DataFusionResult < Self > {
106+ pub fn extract_path ( path_args : & ' s [ ColumnarValue ] ) -> DataFusionResult < Self > {
107107 // If there is a single argument as an array, we know how to handle it
108108 if let Some ( ( ColumnarValue :: Array ( array) , & [ ] ) ) = path_args. split_first ( ) {
109109 return Ok ( Self :: Array ( array) ) ;
Original file line number Diff line number Diff line change @@ -101,6 +101,13 @@ impl JsonUnion {
101101 }
102102}
103103
104+ /// Get the `DataType` for a `JsonUnion`.
105+ /// This will be the data type of the result of `json_array->'field'`.
106+ #[ must_use]
107+ pub fn json_union_data_type ( ) -> DataType {
108+ JsonUnion :: data_type ( )
109+ }
110+
104111/// So we can do `collect::<JsonUnion>()`
105112impl FromIterator < Option < JsonUnionField > > for JsonUnion {
106113 fn from_iter < I : IntoIterator < Item = Option < JsonUnionField > > > ( iter : I ) -> Self {
Original file line number Diff line number Diff line change @@ -20,7 +20,9 @@ mod json_length;
2020mod json_object_keys;
2121mod rewrite;
2222
23- pub use common_union:: { JsonUnionEncoder , JsonUnionValue } ;
23+ pub use common_union:: { json_union_data_type, JsonUnionEncoder , JsonUnionValue } ;
24+
25+ pub use common:: JsonPath ;
2426
2527pub mod functions {
2628 pub use crate :: json_as_text:: json_as_text;
You can’t perform that action at this time.
0 commit comments