Skip to content

Commit

Permalink
Add schema check in test
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeiPatiakin committed Jun 3, 2024
1 parent 467dd48 commit 7a2dc3c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/basic_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use arrow::array::{
Array, BinaryArray, BooleanArray, Date32Array, Decimal128Array, Float32Array, Float64Array,
Int16Array, Int32Array, Int64Array, Int8Array, StringArray, TimestampMicrosecondArray,
};
use arrow::datatypes::DataType;
use clap::Parser;
use futures::{StreamExt, TryStreamExt};
use lakehouse_loader::pg_arrow_source::PgArrowSource;
Expand Down Expand Up @@ -207,6 +208,12 @@ async fn test_pg_arrow_source() {
assert!(!cdate_array.is_null(2));
assert_eq!(cdate_array.value(2), elapsed_days as i32 + 2);

// THEN the numeric field data type should be as expected
assert_eq!(
*rb1.schema().field(11).data_type(),
DataType::Decimal128(8, 3)
);

// THEN the first few numeric values should be as expected
let cnumeric_array = rb1
.column(11)
Expand Down

0 comments on commit 7a2dc3c

Please sign in to comment.