Skip to content

Commit

Permalink
Update some uses
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Jul 2, 2022
1 parent e0ebb72 commit 00b0c39
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
8 changes: 2 additions & 6 deletions datafusion/core/src/physical_plan/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,8 @@ mod tests {
let partitions = 4;
let input = test::scan_partitioned_csv(partitions)?;

let predicate: Arc<dyn PhysicalExpr> = binary(
col("c2", &schema)?,
Operator::Gt,
lit(ScalarValue::from(1u32)),
&schema,
)?;
let predicate: Arc<dyn PhysicalExpr> =
binary(col("c2", &schema)?, Operator::Gt, lit(1u32), &schema)?;

let filter: Arc<dyn ExecutionPlan> =
Arc::new(FilterExec::try_new(predicate, input.clone())?);
Expand Down
18 changes: 9 additions & 9 deletions datafusion/physical-expr/src/expressions/case.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,10 @@ mod tests {
let schema = batch.schema();

// CASE a WHEN 'foo' THEN 123 WHEN 'bar' THEN 456 END
let when1 = lit(ScalarValue::Utf8(Some("foo".to_string())));
let then1 = lit(ScalarValue::Int32(Some(123)));
let when2 = lit(ScalarValue::Utf8(Some("bar".to_string())));
let then2 = lit(ScalarValue::Int32(Some(456)));
let when1 = lit("foo");
let then1 = lit(123i32);
let when2 = lit("bar");
let then2 = lit(456i32);

let expr = case(
Some(col("a", &schema)?),
Expand All @@ -402,11 +402,11 @@ mod tests {
let schema = batch.schema();

// CASE a WHEN 'foo' THEN 123 WHEN 'bar' THEN 456 ELSE 999 END
let when1 = lit(ScalarValue::Utf8(Some("foo".to_string())));
let then1 = lit(ScalarValue::Int32(Some(123)));
let when2 = lit(ScalarValue::Utf8(Some("bar".to_string())));
let then2 = lit(ScalarValue::Int32(Some(456)));
let else_value = lit(ScalarValue::Int32(Some(999)));
let when1 = lit("foo");
let then1 = lit(123i32);
let when2 = lit("bar");
let then2 = lit(456i32);
let else_value = lit(999i32);

let expr = case(
Some(col("a", &schema)?),
Expand Down

0 comments on commit 00b0c39

Please sign in to comment.