Skip to content

Commit 37bdbef

Browse files
committed
chore: address review comment
1 parent 9e3a683 commit 37bdbef

File tree

1 file changed

+5
-20
lines changed

1 file changed

+5
-20
lines changed

datafusion/core/tests/parquet/content_defined_chunking.rs

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
//! parquet writer by inspecting file metadata (compressed sizes, page
2222
//! boundaries) on the written files.
2323
24-
use arrow::array::{Int32Array, StringArray};
25-
use arrow::datatypes::{DataType, Field, Schema};
24+
use arrow::array::{AsArray, Int32Array, StringArray};
25+
use arrow::datatypes::{DataType, Field, Int32Type, Int64Type, Schema};
2626
use arrow::record_batch::RecordBatch;
2727
use datafusion::prelude::{ParquetReadOptions, SessionContext};
2828
use datafusion_common::config::{CdcOptions, TableParquetOptions};
@@ -121,24 +121,9 @@ async fn cdc_data_round_trip() {
121121
.unwrap();
122122

123123
let row = &result[0];
124-
let count = row
125-
.column(0)
126-
.as_any()
127-
.downcast_ref::<arrow::array::Int64Array>()
128-
.unwrap()
129-
.value(0);
130-
let min_id = row
131-
.column(1)
132-
.as_any()
133-
.downcast_ref::<Int32Array>()
134-
.unwrap()
135-
.value(0);
136-
let max_id = row
137-
.column(2)
138-
.as_any()
139-
.downcast_ref::<Int32Array>()
140-
.unwrap()
141-
.value(0);
124+
let count = row.column(0).as_primitive::<Int64Type>().value(0);
125+
let min_id = row.column(1).as_primitive::<Int32Type>().value(0);
126+
let max_id = row.column(2).as_primitive::<Int32Type>().value(0);
142127

143128
assert_eq!(count, 5000);
144129
assert_eq!(min_id, 0);

0 commit comments

Comments
 (0)