Skip to content

Commit

Permalink
add a unit test that cover cast bug. (#5443)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackwener committed Mar 2, 2023
1 parent 17b2f11 commit a4b47d8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions datafusion/physical-expr/src/expressions/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -689,4 +689,20 @@ mod tests {
}
Ok(())
}

#[test]
#[ignore] // TODO: https://github.com/apache/arrow-datafusion/issues/5396
fn test_cast_decimal() -> Result<()> {
let schema = Schema::new(vec![Field::new("a", DataType::Int64, false)]);
let a = Int64Array::from(vec![100]);
let batch = RecordBatch::try_new(Arc::new(schema.clone()), vec![Arc::new(a)])?;
let expression = cast_with_options(
col("a", &schema)?,
&schema,
DataType::Decimal128(38, 38),
DEFAULT_DATAFUSION_CAST_OPTIONS,
)?;
expression.evaluate(&batch)?;
Ok(())
}
}

0 comments on commit a4b47d8

Please sign in to comment.