Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisvandenbossche committed Dec 7, 2023
1 parent 4205837 commit 9a6ebf2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions cpp/src/arrow/dataset/file_parquet_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,19 @@ TEST_P(TestParquetFileFormatScan, PredicatePushdownRowGroupFragments) {
less(field_ref(FieldRef("struct", "i32")), literal(6)));
CountRowGroupsInFragment(fragment, {1},
equal(field_ref(FieldRef("struct", "str")), literal("2")));

// unsupported combination of field type and kernel gives an error
auto filter = less(field_ref("list"), literal(6));
auto parquet_fragment = checked_pointer_cast<ParquetFileFragment>(fragment);
Status filter_status = parquet_fragment->SplitByRowGroup(filter).status();
EXPECT_RAISES_WITH_MESSAGE_THAT(
NotImplemented,
testing::HasSubstr("Function 'less' has no kernel matching"),
filter_status);

// filter on unsupported type (list) will return all RowGroups
CountRowGroupsInFragment(fragment, all_row_groups, less(field_ref("list"), literal(6)));

}

TEST_P(TestParquetFileFormatScan, ExplicitRowGroupSelection) {
Expand Down
2 changes: 1 addition & 1 deletion python/pyarrow/_dataset_parquet.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ cdef class ParquetFileFragment(FileFragment):

if filter is not None:
schema = schema or self.physical_schema
c_filter = _bind(filter, schema)
c_filter = filter.unwrap() #_bind(filter, schema)
with nogil:
c_fragment = move(GetResultValue(
self.parquet_file_fragment.SubsetWithFilter(
Expand Down

0 comments on commit 9a6ebf2

Please sign in to comment.