-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Upgrade DataFusion to arrow/parquet 57.0.0 #17888
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
base: main
Are you sure you want to change the base?
Changes from all commits
b22026e
468fd03
17e7932
0a0f53d
1e8ddfa
f9606d8
3a90c6e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -497,7 +497,7 @@ mod tests { | |
| +-------------------------------------------------------------+--------------+--------------------+-----------------------+-----------------+-----------+-------------+------------+----------------+-------+-----------+-----------+------------------+----------------------+-----------------+-----------------+-------------+------------------------------+-------------------+------------------------+------------------+-----------------------+-------------------------+ | ||
| | filename | row_group_id | row_group_num_rows | row_group_num_columns | row_group_bytes | column_id | file_offset | num_values | path_in_schema | type | stats_min | stats_max | stats_null_count | stats_distinct_count | stats_min_value | stats_max_value | compression | encodings | index_page_offset | dictionary_page_offset | data_page_offset | total_compressed_size | total_uncompressed_size | | ||
| +-------------------------------------------------------------+--------------+--------------------+-----------------------+-----------------+-----------+-------------+------------+----------------+-------+-----------+-----------+------------------+----------------------+-----------------+-----------------+-------------+------------------------------+-------------------+------------------------+------------------+-----------------------+-------------------------+ | ||
| | ../datafusion/core/tests/data/fixed_size_list_array.parquet | 0 | 2 | 1 | 123 | 0 | 125 | 4 | "f0.list.item" | INT64 | 1 | 4 | 0 | | 1 | 4 | SNAPPY | [RLE_DICTIONARY, PLAIN, RLE] | | 4 | 46 | 121 | 123 | | ||
| | ../datafusion/core/tests/data/fixed_size_list_array.parquet | 0 | 2 | 1 | 123 | 0 | 125 | 4 | "f0.list.item" | INT64 | 1 | 4 | 0 | | 1 | 4 | SNAPPY | [PLAIN, RLE, RLE_DICTIONARY] | | 4 | 46 | 121 | 123 | | ||
| +-------------------------------------------------------------+--------------+--------------------+-----------------------+-----------------+-----------+-------------+------------+----------------+-------+-----------+-----------+------------------+----------------------+-----------------+-----------------+-------------+------------------------------+-------------------+------------------------+------------------+-----------------------+-------------------------+ | ||
| "#); | ||
|
|
||
|
|
@@ -510,7 +510,7 @@ mod tests { | |
| +-------------------------------------------------------------+--------------+--------------------+-----------------------+-----------------+-----------+-------------+------------+----------------+-------+-----------+-----------+------------------+----------------------+-----------------+-----------------+-------------+------------------------------+-------------------+------------------------+------------------+-----------------------+-------------------------+ | ||
| | filename | row_group_id | row_group_num_rows | row_group_num_columns | row_group_bytes | column_id | file_offset | num_values | path_in_schema | type | stats_min | stats_max | stats_null_count | stats_distinct_count | stats_min_value | stats_max_value | compression | encodings | index_page_offset | dictionary_page_offset | data_page_offset | total_compressed_size | total_uncompressed_size | | ||
| +-------------------------------------------------------------+--------------+--------------------+-----------------------+-----------------+-----------+-------------+------------+----------------+-------+-----------+-----------+------------------+----------------------+-----------------+-----------------+-------------+------------------------------+-------------------+------------------------+------------------+-----------------------+-------------------------+ | ||
| | ../datafusion/core/tests/data/fixed_size_list_array.parquet | 0 | 2 | 1 | 123 | 0 | 125 | 4 | "f0.list.item" | INT64 | 1 | 4 | 0 | | 1 | 4 | SNAPPY | [RLE_DICTIONARY, PLAIN, RLE] | | 4 | 46 | 121 | 123 | | ||
| | ../datafusion/core/tests/data/fixed_size_list_array.parquet | 0 | 2 | 1 | 123 | 0 | 125 | 4 | "f0.list.item" | INT64 | 1 | 4 | 0 | | 1 | 4 | SNAPPY | [PLAIN, RLE, RLE_DICTIONARY] | | 4 | 46 | 121 | 123 | | ||
| +-------------------------------------------------------------+--------------+--------------------+-----------------------+-----------------+-----------+-------------+------------+----------------+-------+-----------+-----------+------------------+----------------------+-----------------+-----------------+-------------+------------------------------+-------------------+------------------------+------------------+-----------------------+-------------------------+ | ||
| "#); | ||
|
|
||
|
|
@@ -532,7 +532,7 @@ mod tests { | |
| +-----------------------------------------------------------------+--------------+--------------------+-----------------------+-----------------+-----------+-------------+------------+----------------+------------+-----------+-----------+------------------+----------------------+-----------------+-----------------+--------------------+--------------------------+-------------------+------------------------+------------------+-----------------------+-------------------------+ | ||
| | filename | row_group_id | row_group_num_rows | row_group_num_columns | row_group_bytes | column_id | file_offset | num_values | path_in_schema | type | stats_min | stats_max | stats_null_count | stats_distinct_count | stats_min_value | stats_max_value | compression | encodings | index_page_offset | dictionary_page_offset | data_page_offset | total_compressed_size | total_uncompressed_size | | ||
| +-----------------------------------------------------------------+--------------+--------------------+-----------------------+-----------------+-----------+-------------+------------+----------------+------------+-----------+-----------+------------------+----------------------+-----------------+-----------------+--------------------+--------------------------+-------------------+------------------------+------------------+-----------------------+-------------------------+ | ||
| | ../parquet-testing/data/data_index_bloom_encoding_stats.parquet | 0 | 14 | 1 | 163 | 0 | 4 | 14 | "String" | BYTE_ARRAY | Hello | today | 0 | | Hello | today | GZIP(GzipLevel(6)) | [BIT_PACKED, RLE, PLAIN] | | | 4 | 152 | 163 | | ||
| | ../parquet-testing/data/data_index_bloom_encoding_stats.parquet | 0 | 14 | 1 | 163 | 0 | 4 | 14 | "String" | BYTE_ARRAY | Hello | today | 0 | | Hello | today | GZIP(GzipLevel(6)) | [PLAIN, RLE, BIT_PACKED] | | | 4 | 152 | 163 | | ||
| +-----------------------------------------------------------------+--------------+--------------------+-----------------------+-----------------+-----------+-------------+------------+----------------+------------+-----------+-----------+------------------+----------------------+-----------------+-----------------+--------------------+--------------------------+-------------------+------------------------+------------------+-----------------------+-------------------------+ | ||
| "#); | ||
|
|
||
|
|
@@ -592,9 +592,9 @@ mod tests { | |
| +-----------------------------------+-----------------+---------------------+------+------------------+ | ||
| | filename | file_size_bytes | metadata_size_bytes | hits | extra | | ||
| +-----------------------------------+-----------------+---------------------+------+------------------+ | ||
| | alltypes_plain.parquet | 1851 | 10181 | 2 | page_index=false | | ||
| | alltypes_tiny_pages.parquet | 454233 | 881418 | 2 | page_index=true | | ||
| | lz4_raw_compressed_larger.parquet | 380836 | 2939 | 2 | page_index=false | | ||
| | alltypes_plain.parquet | 1851 | 6957 | 2 | page_index=false | | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The thrift-remodel has made the in-memory footprint of (huge thanks to @etseidl ) |
||
| | alltypes_tiny_pages.parquet | 454233 | 267014 | 2 | page_index=true | | ||
| | lz4_raw_compressed_larger.parquet | 380836 | 996 | 2 | page_index=false | | ||
| +-----------------------------------+-----------------+---------------------+------+------------------+ | ||
| "); | ||
|
|
||
|
|
@@ -623,9 +623,9 @@ mod tests { | |
| +-----------------------------------+-----------------+---------------------+------+------------------+ | ||
| | filename | file_size_bytes | metadata_size_bytes | hits | extra | | ||
| +-----------------------------------+-----------------+---------------------+------+------------------+ | ||
| | alltypes_plain.parquet | 1851 | 10181 | 5 | page_index=false | | ||
| | alltypes_tiny_pages.parquet | 454233 | 881418 | 2 | page_index=true | | ||
| | lz4_raw_compressed_larger.parquet | 380836 | 2939 | 3 | page_index=false | | ||
| | alltypes_plain.parquet | 1851 | 6957 | 5 | page_index=false | | ||
| | alltypes_tiny_pages.parquet | 454233 | 267014 | 2 | page_index=true | | ||
| | lz4_raw_compressed_larger.parquet | 380836 | 996 | 3 | page_index=false | | ||
| +-----------------------------------+-----------------+---------------------+------+------------------+ | ||
| "); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,7 @@ | |
|
|
||
| use std::collections::HashMap; | ||
| use std::sync::Arc; | ||
| use tonic::transport::Endpoint; | ||
|
|
||
| use datafusion::arrow::datatypes::Schema; | ||
|
|
||
|
|
@@ -34,7 +35,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { | |
| let testdata = datafusion::test_util::parquet_test_data(); | ||
|
|
||
| // Create Flight client | ||
| let mut client = FlightServiceClient::connect("http://localhost:50051").await?; | ||
| let endpoint = Endpoint::new("http://localhost:50051")?; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is required due to the tonic upgrade |
||
| let channel = endpoint.connect().await?; | ||
| let mut client = FlightServiceClient::new(channel); | ||
|
|
||
| // Call get_schema to get the schema of a Parquet file | ||
| let request = tonic::Request::new(FlightDescriptor { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,12 +16,13 @@ | |
| // under the License. | ||
|
|
||
| use datafusion::common::DataFusionError; | ||
| use datafusion::config::TableParquetOptions; | ||
| use datafusion::config::{ConfigFileEncryptionProperties, TableParquetOptions}; | ||
| use datafusion::dataframe::{DataFrame, DataFrameWriteOptions}; | ||
| use datafusion::logical_expr::{col, lit}; | ||
| use datafusion::parquet::encryption::decrypt::FileDecryptionProperties; | ||
| use datafusion::parquet::encryption::encrypt::FileEncryptionProperties; | ||
| use datafusion::prelude::{ParquetReadOptions, SessionContext}; | ||
| use std::sync::Arc; | ||
| use tempfile::TempDir; | ||
|
|
||
| #[tokio::main] | ||
|
|
@@ -55,7 +56,7 @@ async fn main() -> datafusion::common::Result<()> { | |
|
|
||
| // Write encrypted parquet | ||
| let mut options = TableParquetOptions::default(); | ||
| options.crypto.file_encryption = Some((&encrypt).into()); | ||
| options.crypto.file_encryption = Some(ConfigFileEncryptionProperties::from(&encrypt)); | ||
| parquet_df | ||
| .write_parquet( | ||
| tempfile_str.as_str(), | ||
|
|
@@ -100,7 +101,8 @@ async fn query_dataframe(df: &DataFrame) -> Result<(), DataFusionError> { | |
| // Setup encryption and decryption properties | ||
| fn setup_encryption( | ||
| parquet_df: &DataFrame, | ||
| ) -> Result<(FileEncryptionProperties, FileDecryptionProperties), DataFusionError> { | ||
| ) -> Result<(Arc<FileEncryptionProperties>, Arc<FileDecryptionProperties>), DataFusionError> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The arrow upstream APIs now use Arc instead of raw objects, see apache/arrow-rs#8470 |
||
| { | ||
| let schema = parquet_df.schema(); | ||
| let footer_key = b"0123456789012345".to_vec(); // 128bit/16 | ||
| let column_key = b"1234567890123450".to_vec(); // 128bit/16 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is due to apache/arrow-rs#8587 which change the order the encodings are displayed