Skip to content

Commit 75ec5cb

Browse files
committed
Merge pull request #203 from Enmk/parquet_chunked_array
Backport ClickHouse#40485 to 22.3: fix parquet chunked arrays
1 parent 01a8f76 commit 75ec5cb

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/Processors/Formats/Impl/ParquetBlockInputFormat.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,16 @@ Chunk ParquetBlockInputFormat::generate()
5151
return res;
5252

5353
std::shared_ptr<arrow::Table> table;
54-
arrow::Status read_status = file_reader->ReadRowGroup(row_group_current, column_indices, &table);
54+
55+
std::unique_ptr<::arrow::RecordBatchReader> rbr;
56+
std::vector<int> row_group_indices { row_group_current };
57+
arrow::Status get_batch_reader_status = file_reader->GetRecordBatchReader(row_group_indices, column_indices, &rbr);
58+
59+
if (!get_batch_reader_status.ok())
60+
throw ParsingException{"Error while reading Parquet data: " + get_batch_reader_status.ToString(), ErrorCodes::CANNOT_READ_ALL_DATA};
61+
62+
arrow::Status read_status = rbr->ReadAll(&table);
63+
5564
if (!read_status.ok())
5665
throw ParsingException{"Error while reading Parquet data: " + read_status.ToString(),
5766
ErrorCodes::CANNOT_READ_ALL_DATA};

0 commit comments

Comments
 (0)