File tree Expand file tree Collapse file tree
datafusion-functions-parquet Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -115,6 +115,10 @@ impl ExecutionContext {
115115 "parquet_metadata" ,
116116 Arc :: new ( datafusion_functions_parquet:: ParquetMetadataFunc { } ) ,
117117 ) ;
118+ session_ctx. register_udtf (
119+ "parquet_page_index" ,
120+ Arc :: new ( datafusion_functions_parquet:: ParquetPageIndexFunc { } ) ,
121+ ) ;
118122
119123 let catalog = create_app_catalog ( config, app_name, app_version) ?;
120124 session_ctx. register_catalog ( & config. catalog . name , catalog) ;
Original file line number Diff line number Diff line change @@ -15,3 +15,8 @@ arrow = { version = "57" }
1515async-trait = " 0.1.41"
1616datafusion = { version = " 51" }
1717parquet = { default-features = false , version = " 57" }
18+
19+ [dev-dependencies ]
20+ parquet = { version = " 57" , features = [" arrow" ] }
21+ tempfile = " 3"
22+ tokio = { version = " 1" , features = [" macros" , " rt" ] }
Original file line number Diff line number Diff line change @@ -37,6 +37,9 @@ use parquet::file::statistics::Statistics;
3737use std:: fs:: File ;
3838use std:: sync:: Arc ;
3939
40+ mod page_index;
41+ pub use page_index:: ParquetPageIndexFunc ;
42+
4043// Copied from https://github.com/apache/datafusion/blob/main/datafusion-cli/src/functions.rs
4144/// PARQUET_META table function
4245#[ derive( Debug ) ]
@@ -219,7 +222,7 @@ impl TableFunctionImpl for ParquetMetadataFunc {
219222 column_id_arr. push ( col_idx as i64 ) ;
220223 file_offset_arr. push ( column. file_offset ( ) ) ;
221224 num_values_arr. push ( column. num_values ( ) ) ;
222- path_in_schema_arr. push ( column. column_path ( ) . to_string ( ) ) ;
225+ path_in_schema_arr. push ( column. column_path ( ) . string ( ) ) ;
223226 type_arr. push ( column. column_type ( ) . to_string ( ) ) ;
224227 logical_type_arr. push (
225228 column
You can’t perform that action at this time.
0 commit comments