Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for StringView and BinaryView statistics in StatisticsConverter #6181

Merged
4 changes: 2 additions & 2 deletions parquet/tests/arrow_reader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ fn create_data_batch(scenario: Scenario) -> Vec<RecordBatch> {
// shorter and longer than that length
vec![
make_utf8_view_batch(vec![Some("a"), Some("b"), Some("c"), Some("d"), None]),
make_utf8_view_batch(vec![Some("a"), Some("e_longerthan12")]),
make_utf8_view_batch(vec![Some("a"), Some("e_longerthan12"), None, None, None]),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

make_utf8_view_batch(vec![
Some("e_longerthan12"),
Some("f_longerthan12"),
Expand All @@ -1003,7 +1003,7 @@ fn create_data_batch(scenario: Scenario) -> Vec<RecordBatch> {
Scenario::BinaryView => {
vec![
make_binary_view_batch(vec![Some(b"a"), Some(b"b"), Some(b"c"), Some(b"d"), None]),
make_binary_view_batch(vec![Some(b"a"), Some(b"e_longerthan12")]),
make_binary_view_batch(vec![Some(b"a"), Some(b"e_longerthan12"), None, None, None]),
make_binary_view_batch(vec![
Some(b"e_longerthan12"),
Some(b"f_longerthan12"),
Expand Down
27 changes: 4 additions & 23 deletions parquet/tests/arrow_reader/statistics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2060,23 +2060,6 @@ async fn test_utf8() {
}

// UTF8View
// BUG:
// when length > 12, "h_longerthan12" is chosen as minimum instead of expected "e_longerthan12", and
// if set expected_min="h_longerthan12" to bypass, get mismatch maximum as follows:
// assertion `left == right` failed: utf8_view: Mismatch with expected data page maximum
// left: StringViewArray
// [
// "d",
// "g_longerthan12",
// "i_longerthan12",
// ]
// right: StringViewArray
// [
// "d",
// "e_longerthan12",
// "i_longerthan12",
// ]
#[ignore]
#[tokio::test]
async fn test_utf8_view() {
let reader = TestReader {
Expand All @@ -2095,17 +2078,15 @@ async fn test_utf8_view() {
"e_longerthan12",
"i_longerthan12",
])),
expected_null_counts: UInt64Array::from(vec![1, 0, 0]),
expected_row_counts: Some(UInt64Array::from(vec![5, 2, 5])),
expected_null_counts: UInt64Array::from(vec![1, 3, 0]),
expected_row_counts: Some(UInt64Array::from(vec![5, 5, 5])),
column_name: "utf8_view",
check: Check::Both,
}
.run()
}

// BinaryView
// BUG: same as utf8_view
#[ignore]
#[tokio::test]
async fn test_binary_view() {
let reader = TestReader {
Expand All @@ -2124,8 +2105,8 @@ async fn test_binary_view() {
reader: &reader,
expected_min: Arc::new(BinaryViewArray::from(expected_min)),
expected_max: Arc::new(BinaryViewArray::from(expected_max)),
expected_null_counts: UInt64Array::from(vec![1, 0, 0]),
expected_row_counts: Some(UInt64Array::from(vec![5, 2, 5])),
expected_null_counts: UInt64Array::from(vec![1, 3, 0]),
expected_row_counts: Some(UInt64Array::from(vec![5, 5, 5])),
column_name: "binary_view",
check: Check::Both,
}
Expand Down
Loading