Skip to content

Commit

Permalink
fix tests apache#1
Browse files Browse the repository at this point in the history
  • Loading branch information
Igosuki committed Jan 12, 2022
1 parent 4344454 commit 257a7c5
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion datafusion/src/datasource/file_format/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ mod tests {
let projection = Some(vec![0]);
let exec = get_exec(&projection, 1024, None).await?;

let batches = collect(exec).await.expect("Collect batches");
let batches = collect(exec).await?;

assert_eq!(1, batches.len());
assert_eq!(1, batches[0].num_columns());
Expand Down
4 changes: 2 additions & 2 deletions datafusion/src/execution/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1959,7 +1959,7 @@ mod tests {
"+-----------------+",
"| SUM(d_table.c1) |",
"+-----------------+",
"| 100.000 |",
"| 100.0 |",
"+-----------------+",
];
assert_eq!(
Expand All @@ -1983,7 +1983,7 @@ mod tests {
"+-----------------+",
"| AVG(d_table.c1) |",
"+-----------------+",
"| 5.0000000 |",
"| 5.0 |",
"+-----------------+",
];
assert_eq!(
Expand Down
7 changes: 4 additions & 3 deletions datafusion/src/logical_plan/dfschema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -536,9 +536,10 @@ mod tests {
fn from_qualified_schema_into_arrow_schema() -> Result<()> {
let schema = DFSchema::try_from_qualified_schema("t1", &test_schema_1())?;
let arrow_schema: Schema = schema.into();
let expected = "Field { name: \"c0\", data_type: Boolean, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: None }, \
Field { name: \"c1\", data_type: Boolean, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: None }";
assert_eq!(expected, format!("{:?}", arrow_schema));
let expected =
"[Field { name: \"c0\", data_type: Boolean, nullable: true, metadata: {} }, \
Field { name: \"c1\", data_type: Boolean, nullable: true, metadata: {} }]";
assert_eq!(expected, format!("{:?}", arrow_schema.fields));
Ok(())
}

Expand Down
6 changes: 3 additions & 3 deletions datafusion/src/physical_plan/expressions/average.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ mod tests {

generic_test_op!(
array,
DataType::Decimal(10, 0),
DataType::Decimal(32, 32),
Avg,
ScalarValue::Decimal128(Some(35000), 14, 4),
DataType::Decimal(14, 4)
Expand All @@ -283,7 +283,7 @@ mod tests {
let array: ArrayRef = decimal_builder.as_arc();
generic_test_op!(
array,
DataType::Decimal(10, 0),
DataType::Decimal(32, 32),
Avg,
ScalarValue::Decimal128(Some(32500), 14, 4),
DataType::Decimal(14, 4)
Expand All @@ -300,7 +300,7 @@ mod tests {
let array: ArrayRef = decimal_builder.as_arc();
generic_test_op!(
array,
DataType::Decimal(10, 0),
DataType::Decimal(32, 32),
Avg,
ScalarValue::Decimal128(None, 14, 4),
DataType::Decimal(14, 4)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ mod tests {
fn get_indexed_field_invalid_list_index() -> Result<()> {
let schema = list_schema("l");
let expr = col("l", &schema).unwrap();
get_indexed_field_test_failure(schema, expr, ScalarValue::Int8(Some(0)), "This feature is not implemented: get indexed field is only possible on lists with int64 indexes. Tried List(Field { name: \"item\", data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: None }) with 0 index")
get_indexed_field_test_failure(schema, expr, ScalarValue::Int8(Some(0)), "This feature is not implemented: get indexed field is only possible on lists with int64 indexes. Tried List(Field { name: \"item\", data_type: Utf8, nullable: true, metadata: {} }) with 0 index")
}

fn build_struct(
Expand Down
2 changes: 1 addition & 1 deletion datafusion/src/physical_plan/file_format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ use super::{ColumnStatistics, Statistics};
lazy_static! {
/// The datatype used for all partitioning columns for now
pub static ref DEFAULT_PARTITION_COLUMN_DATATYPE: DataType =
DataType::Dictionary(IntegerType::UInt8, Box::new(DataType::Utf8), true);
DataType::Dictionary(IntegerType::UInt8, Box::new(DataType::Utf8), false);
}

/// The base configurations to provide when creating a physical plan for
Expand Down
8 changes: 7 additions & 1 deletion datafusion/src/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3223,11 +3223,17 @@ mod tests {
.try_push(Some(vec![
Some(vec![Some(1), Some(2), Some(3)]),
Some(vec![Some(4), Some(5)]),
]))
.unwrap();
outer_builder
.try_push(Some(vec![
Some(vec![Some(6)]),
Some(vec![Some(7), Some(8)]),
Some(vec![Some(9)]),
]))
.unwrap();
outer_builder
.try_push(Some(vec![Some(vec![Some(9)])]))
.unwrap();

let expected = outer_builder.as_box();

Expand Down

0 comments on commit 257a7c5

Please sign in to comment.