Skip to content

Commit 955c1d0

Browse files
committed
add nested
Signed-off-by: jayzhan211 <[email protected]>
1 parent 56ef414 commit 955c1d0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

datafusion/sql/src/expr/identifier.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
135135
let nested_name = nested_names[0].to_string();
136136

137137
let col = Expr::Column(Column::from((qualifier, field)));
138-
println!("col: {:?} nested_name: {:?}", col, nested_name);
139138
if let Some(udf) =
140139
self.context_provider.get_function_meta("get_field")
141140
{

datafusion/sqllogictest/test_files/struct.slt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,3 +226,9 @@ query T
226226
select arrow_typeof({'first': 1, 'second': 2, 'third': 3});
227227
----
228228
Struct([Field { name: "first", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "second", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "third", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }])
229+
230+
# test nested struct literal
231+
query ?
232+
select {'animal': {'cat': 1, 'dog': 2, 'bird': {'parrot': 3, 'canary': 1}}, 'genre': {'fiction': ['mystery', 'sci-fi', 'fantasy'], 'non-fiction': {'biography': 5, 'history': 7, 'science': {'physics': 2, 'biology': 3}}}, 'vehicle': {'car': {'sedan': 4, 'suv': 2}, 'bicycle': 3, 'boat': ['sailboat', 'motorboat']}, 'weather': {'sunny': True, 'temperature': 25.5, 'wind': {'speed': 10, 'direction': 'NW'}}};
233+
----
234+
{animal: {cat: 1, dog: 2, bird: {parrot: 3, canary: 1}}, genre: {fiction: [mystery, sci-fi, fantasy], non-fiction: {biography: 5, history: 7, science: {physics: 2, biology: 3}}}, vehicle: {car: {sedan: 4, suv: 2}, bicycle: 3, boat: [sailboat, motorboat]}, weather: {sunny: true, temperature: 25.5, wind: {speed: 10, direction: NW}}}

0 commit comments

Comments
 (0)