Skip to content

Commit 38ac07f

Browse files
committed
fix test
1 parent 992ecf6 commit 38ac07f

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

ballista/rust/core/src/serde/logical_plan/from_proto.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ use datafusion::physical_plan::window_functions::BuiltInWindowFunction;
3434
use datafusion::prelude::*;
3535
use datafusion::scalar::ScalarValue;
3636

37+
use std::collections::HashMap;
3738
use std::{
3839
convert::{From, TryInto},
3940
sync::Arc,
@@ -58,7 +59,7 @@ impl TryInto<DFSchema> for &protobuf::DfSchema {
5859
.iter()
5960
.map(|c| c.try_into())
6061
.collect::<Result<Vec<DFField>, _>>()?;
61-
Ok(DFSchema::new(fields)?)
62+
Ok(DFSchema::new_with_metadata(fields, HashMap::new())?)
6263
}
6364
}
6465

datafusion-common/src/dfschema.rs

+11-5
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ impl Display for DFSchema {
422422
fn fmt(&self, f: &mut Formatter) -> std::fmt::Result {
423423
write!(
424424
f,
425-
"fields:{}, metadata:{:?}",
425+
"fields:[{}], metadata:{:?}",
426426
self.fields
427427
.iter()
428428
.map(|field| field.qualified_name())
@@ -587,14 +587,14 @@ mod tests {
587587
#[test]
588588
fn from_unqualified_schema() -> Result<()> {
589589
let schema = DFSchema::try_from(test_schema_1())?;
590-
assert_eq!("c0, c1", schema.to_string());
590+
assert_eq!("fields:[c0, c1], metadata:{}", schema.to_string());
591591
Ok(())
592592
}
593593

594594
#[test]
595595
fn from_qualified_schema() -> Result<()> {
596596
let schema = DFSchema::try_from_qualified_schema("t1", &test_schema_1())?;
597-
assert_eq!("t1.c0, t1.c1", schema.to_string());
597+
assert_eq!("fields:[t1.c0, t1.c1], metadata:{}", schema.to_string());
598598
Ok(())
599599
}
600600

@@ -613,7 +613,10 @@ mod tests {
613613
let left = DFSchema::try_from_qualified_schema("t1", &test_schema_1())?;
614614
let right = DFSchema::try_from_qualified_schema("t2", &test_schema_1())?;
615615
let join = left.join(&right)?;
616-
assert_eq!("t1.c0, t1.c1, t2.c0, t2.c1", join.to_string());
616+
assert_eq!(
617+
"fields:[t1.c0, t1.c1, t2.c0, t2.c1], metadata:{}",
618+
join.to_string()
619+
);
617620
// test valid access
618621
assert!(join.field_with_qualified_name("t1", "c0").is_ok());
619622
assert!(join.field_with_qualified_name("t2", "c0").is_ok());
@@ -657,7 +660,10 @@ mod tests {
657660
let left = DFSchema::try_from_qualified_schema("t1", &test_schema_1())?;
658661
let right = DFSchema::try_from(test_schema_2())?;
659662
let join = left.join(&right)?;
660-
assert_eq!("t1.c0, t1.c1, c100, c101", join.to_string());
663+
assert_eq!(
664+
"fields:[t1.c0, t1.c1, c100, c101], metadata:{}",
665+
join.to_string()
666+
);
661667
// test valid access
662668
assert!(join.field_with_qualified_name("t1", "c0").is_ok());
663669
assert!(join.field_with_unqualified_name("c0").is_ok());

datafusion/src/physical_plan/planner.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1629,7 +1629,7 @@ mod tests {
16291629
dict_id: 0, \
16301630
dict_is_ordered: false, \
16311631
metadata: None } }\
1632-
] }, \
1632+
], metadata: {} }, \
16331633
ExecutionPlan schema: Schema { fields: [\
16341634
Field { \
16351635
name: \"b\", \

0 commit comments

Comments
 (0)