MCPcopy Create free account
hub / github.com/apache/datafusion / test_parquet_metadata_works_with_strings

Function test_parquet_metadata_works_with_strings

datafusion-cli/src/main.rs:543–561  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

541
542 #[tokio::test]
543 async fn test_parquet_metadata_works_with_strings() -> Result<(), DataFusionError> {
544 let ctx = SessionContext::new();
545 ctx.register_udtf("parquet_metadata", Arc::new(ParquetMetadataFunc {}));
546
547 // input with string columns
548 let sql = "SELECT * FROM parquet_metadata('../parquet-testing/data/data_index_bloom_encoding_stats.parquet')";
549 let df = ctx.sql(sql).await?;
550 let rbs = df.collect().await?;
551
552 assert_snapshot!(batches_to_string(&rbs),@r#"
553 +-----------------------------------------------------------------+--------------+--------------------+-----------------------+-----------------+-----------+-------------+------------+----------------+------------+-----------+-----------+------------------+----------------------+-----------------+-----------------+--------------------+--------------------------+-------------------+------------------------+------------------+-----------------------+-------------------------+
554 | 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 |
555 +-----------------------------------------------------------------+--------------+--------------------+-----------------------+-----------------+-----------+-------------+------------+----------------+------------+-----------+-----------+------------------+----------------------+-----------------+-----------------+--------------------+--------------------------+-------------------+------------------------+------------------+-----------------------+-------------------------+
556 | ../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 |
557 +-----------------------------------------------------------------+--------------+--------------------+-----------------------+-----------------+-----------+-------------+------------+----------------+------------+-----------+-----------+------------------+----------------------+-----------------+-----------------+--------------------+--------------------------+-------------------+------------------------+------------------+-----------------------+-------------------------+
558 "#);
559
560 Ok(())
561 }
562
563 #[tokio::test]
564 async fn test_metadata_cache() -> Result<(), DataFusionError> {

Callers

nothing calls this directly

Calls 4

newFunction · 0.85
sqlMethod · 0.80
collectMethod · 0.80
register_udtfMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…