Skip to content

Commit 257a7c5

Browse files
committed
fix tests #1
1 parent 4344454 commit 257a7c5

File tree

7 files changed

+19
-12
lines changed

7 files changed

+19
-12
lines changed

datafusion/src/datasource/file_format/json.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ mod tests {
158158
let projection = Some(vec![0]);
159159
let exec = get_exec(&projection, 1024, None).await?;
160160

161-
let batches = collect(exec).await.expect("Collect batches");
161+
let batches = collect(exec).await?;
162162

163163
assert_eq!(1, batches.len());
164164
assert_eq!(1, batches[0].num_columns());

datafusion/src/execution/context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1959,7 +1959,7 @@ mod tests {
19591959
"+-----------------+",
19601960
"| SUM(d_table.c1) |",
19611961
"+-----------------+",
1962-
"| 100.000 |",
1962+
"| 100.0 |",
19631963
"+-----------------+",
19641964
];
19651965
assert_eq!(
@@ -1983,7 +1983,7 @@ mod tests {
19831983
"+-----------------+",
19841984
"| AVG(d_table.c1) |",
19851985
"+-----------------+",
1986-
"| 5.0000000 |",
1986+
"| 5.0 |",
19871987
"+-----------------+",
19881988
];
19891989
assert_eq!(

datafusion/src/logical_plan/dfschema.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -536,9 +536,10 @@ mod tests {
536536
fn from_qualified_schema_into_arrow_schema() -> Result<()> {
537537
let schema = DFSchema::try_from_qualified_schema("t1", &test_schema_1())?;
538538
let arrow_schema: Schema = schema.into();
539-
let expected = "Field { name: \"c0\", data_type: Boolean, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: None }, \
540-
Field { name: \"c1\", data_type: Boolean, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: None }";
541-
assert_eq!(expected, format!("{:?}", arrow_schema));
539+
let expected =
540+
"[Field { name: \"c0\", data_type: Boolean, nullable: true, metadata: {} }, \
541+
Field { name: \"c1\", data_type: Boolean, nullable: true, metadata: {} }]";
542+
assert_eq!(expected, format!("{:?}", arrow_schema.fields));
542543
Ok(())
543544
}
544545

datafusion/src/physical_plan/expressions/average.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ mod tests {
263263

264264
generic_test_op!(
265265
array,
266-
DataType::Decimal(10, 0),
266+
DataType::Decimal(32, 32),
267267
Avg,
268268
ScalarValue::Decimal128(Some(35000), 14, 4),
269269
DataType::Decimal(14, 4)
@@ -283,7 +283,7 @@ mod tests {
283283
let array: ArrayRef = decimal_builder.as_arc();
284284
generic_test_op!(
285285
array,
286-
DataType::Decimal(10, 0),
286+
DataType::Decimal(32, 32),
287287
Avg,
288288
ScalarValue::Decimal128(Some(32500), 14, 4),
289289
DataType::Decimal(14, 4)
@@ -300,7 +300,7 @@ mod tests {
300300
let array: ArrayRef = decimal_builder.as_arc();
301301
generic_test_op!(
302302
array,
303-
DataType::Decimal(10, 0),
303+
DataType::Decimal(32, 32),
304304
Avg,
305305
ScalarValue::Decimal128(None, 14, 4),
306306
DataType::Decimal(14, 4)

datafusion/src/physical_plan/expressions/get_indexed_field.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ mod tests {
227227
fn get_indexed_field_invalid_list_index() -> Result<()> {
228228
let schema = list_schema("l");
229229
let expr = col("l", &schema).unwrap();
230-
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")
230+
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")
231231
}
232232

233233
fn build_struct(

datafusion/src/physical_plan/file_format/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ use super::{ColumnStatistics, Statistics};
5454
lazy_static! {
5555
/// The datatype used for all partitioning columns for now
5656
pub static ref DEFAULT_PARTITION_COLUMN_DATATYPE: DataType =
57-
DataType::Dictionary(IntegerType::UInt8, Box::new(DataType::Utf8), true);
57+
DataType::Dictionary(IntegerType::UInt8, Box::new(DataType::Utf8), false);
5858
}
5959

6060
/// The base configurations to provide when creating a physical plan for

datafusion/src/scalar.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3223,11 +3223,17 @@ mod tests {
32233223
.try_push(Some(vec![
32243224
Some(vec![Some(1), Some(2), Some(3)]),
32253225
Some(vec![Some(4), Some(5)]),
3226+
]))
3227+
.unwrap();
3228+
outer_builder
3229+
.try_push(Some(vec![
32263230
Some(vec![Some(6)]),
32273231
Some(vec![Some(7), Some(8)]),
3228-
Some(vec![Some(9)]),
32293232
]))
32303233
.unwrap();
3234+
outer_builder
3235+
.try_push(Some(vec![Some(vec![Some(9)])]))
3236+
.unwrap();
32313237

32323238
let expected = outer_builder.as_box();
32333239

0 commit comments

Comments
 (0)