File tree 1 file changed +5
-0
lines changed
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ fn dict_key_type(d: &DataType) -> Option<DataType> {
68
68
None
69
69
}
70
70
71
+ /// Parsed representation of a JSON path element.
71
72
#[ derive( Debug ) ]
72
73
pub enum JsonPath < ' s > {
73
74
Key ( & ' s str ) ,
@@ -103,6 +104,10 @@ pub enum JsonPathArgs<'a> {
103
104
}
104
105
105
106
impl < ' s > JsonPathArgs < ' s > {
107
+ /// Extract the JSON path from the arguments to a json function.
108
+ /// The path can be:
109
+ /// - A single array argument (`json_get(json_data, keys_column)`)
110
+ /// - One or more scalar arguments (`json_get(json_data, 'foo', 0)`)
106
111
pub fn extract_path ( path_args : & ' s [ ColumnarValue ] ) -> DataFusionResult < Self > {
107
112
// If there is a single argument as an array, we know how to handle it
108
113
if let Some ( ( ColumnarValue :: Array ( array) , & [ ] ) ) = path_args. split_first ( ) {
You can’t perform that action at this time.
0 commit comments