From 5b7d2525ea36d6dab1410248791681b2484ac87c Mon Sep 17 00:00:00 2001 From: Xiangpeng Hao Date: Tue, 24 Dec 2024 09:06:23 -0600 Subject: [PATCH] fine tune ui --- src/row_group_column.rs | 57 +++++++++++++++-------------------------- 1 file changed, 20 insertions(+), 37 deletions(-) diff --git a/src/row_group_column.rs b/src/row_group_column.rs index b729b0d..1caf9fa 100644 --- a/src/row_group_column.rs +++ b/src/row_group_column.rs @@ -115,8 +115,7 @@ pub fn RowGroupColumn(parquet_reader: super::ParquetReader) -> impl IntoView { let compressed_size = rg.compressed_size() as f64 / 1_048_576.0; let uncompressed_size = rg.total_byte_size() as f64 / 1_048_576.0; let num_rows = rg.num_rows() as u64; - let compression = rg.column(0).compression(); - (compressed_size, uncompressed_size, num_rows, compression) + (compressed_size, uncompressed_size, num_rows) }; let parquet_info_clone = parquet_reader.info().clone(); @@ -131,8 +130,6 @@ pub fn RowGroupColumn(parquet_reader: super::ParquetReader) -> impl IntoView { let uncompressed_size = col.uncompressed_size() as f64 / 1_048_576.0; let compression = col.compression(); let statistics = col.statistics().cloned(); - let has_bloom_filter = col.bloom_filter_offset().is_some(); - let encodings = col.encodings().clone(); let parquet_bytes = Arc::new(parquet_bytes.clone()); let page_reader = @@ -144,7 +141,7 @@ pub fn RowGroupColumn(parquet_reader: super::ParquetReader) -> impl IntoView { let page_type = page.page_type(); let page_size = page.buffer().len() as f64 / 1024.0; let num_values = page.num_values(); - page_info.push((page_type, page_size, num_values)); + page_info.push((page_type, page_size, num_values, page.encoding())); } } @@ -153,8 +150,6 @@ pub fn RowGroupColumn(parquet_reader: super::ParquetReader) -> impl IntoView { uncompressed_size, compression, statistics, - has_bloom_filter, - encodings, page_info, ) }; @@ -188,11 +183,11 @@ pub fn RowGroupColumn(parquet_reader: super::ParquetReader) -> impl IntoView { {move || { - let (compressed_size, uncompressed_size, num_rows, compression) = row_group_info(); + let (compressed_size, uncompressed_size, num_rows) = row_group_info(); view! {
-
"Size"
+
"Compressed"
{format!("{:.2} MB", compressed_size)}
@@ -204,7 +199,7 @@ pub fn RowGroupColumn(parquet_reader: super::ParquetReader) -> impl IntoView {
-
"Compression"
+
"Compression ratio"
{format!("{:.1}%", compressed_size / uncompressed_size * 100.0)}
@@ -213,10 +208,6 @@ pub fn RowGroupColumn(parquet_reader: super::ParquetReader) -> impl IntoView {
"Rows"
{format_rows(num_rows)}
-
-
"Compression Type"
-
{format!("{:?}", compression)}
-
} }} @@ -258,14 +249,12 @@ pub fn RowGroupColumn(parquet_reader: super::ParquetReader) -> impl IntoView { uncompressed_size, compression, statistics, - has_bloom_filter, - encodings, page_info, ) = column_info(); view! {
-
"Size"
+
"Compressed"
{format!("{:.2} MB", compressed_size)}
@@ -277,25 +266,15 @@ pub fn RowGroupColumn(parquet_reader: super::ParquetReader) -> impl IntoView {
-
"Compression"
+
"Compression ratio"
{format!("{:.1}%", compressed_size / uncompressed_size * 100.0)}
-
"Bloom Filter"
-
- {if has_bloom_filter { "✓" } else { "✗" }} -
-
-
"Compression Type"
{format!("{:?}", compression)}
-
-
"Encodings"
-
{format!("{:?}", encodings)}
-
"Statistics"
{stats_to_string(statistics)}
@@ -303,26 +282,30 @@ pub fn RowGroupColumn(parquet_reader: super::ParquetReader) -> impl IntoView {
- Page # - Type - Size - Rows + "#" + "Type" + "Size" + "Rows" + "Encoding"
{page_info .into_iter() .enumerate() - .map(|(i, (page_type, size, values))| { + .map(|(i, (page_type, size, values, encoding))| { view! {
- {format!("{}.", i)} + {format!("{}", i)} {format!("{:?}", page_type)} - - {format!("{:.1} KB", size)} + + {format!("{} KB", size.round() as i64)} - + {format_rows(values as u64)} + + {format!("{:?}", encoding)} +
} })