Comments (2)
Some more follow-up information:
Comprison to Trino
I also tested trino's Iceberg implementation and found that their data sizes for variable-width iceberg columns are also generally wrong.
trino:tpch> SHOW STATS FOR (SELECT comment from orders);
column_name | data_size | distinct_values_count | nulls_fraction | row_count | low_value | high_value
-------------+-----------+-----------------------+----------------+-----------+-----------+------------
comment | 554688.0 | 14756.0 | 0.0 | NULL | NULL | NULL
NULL | NULL | NULL | NULL | 15000.0 | NULL | NULL
(2 rows)
----
trino:tpch> select "$internal$sum_data_size_for_stats"(comment) from orders;
_col0
--------
727364
(1 row)
Understanding the Iceberg code
After digging into the iceberg library, I found that (at least for parquet format) that the column stats are generated by this line
The call they use here is the parquet file footer's getTotalSize
method. This represents the bytes on disk. However, parquet footers also have a getTotalUncompressedSize
method. I tested to see how this value compares when used to generate the column statistics and found that it is much closer to the true value.
presto:tpch> SHOW STATS FOR (select comment from orders);
column_name | data_size | distinct_values_count | nulls_fraction | row_count | low_value | high_value
-------------+-----------+-----------------------+----------------+-----------+-----------+------------
comment | 745598.0 | NULL | 0.0 | NULL | NULL | NULL
NULL | NULL | NULL | NULL | 15000.0 | NULL | NULL
(2 rows)
Query 20240316_002952_00016_muzsz, FINISHED, 1 node
Splits: 1 total, 1 done (100.00%)
[Latency: client-side: 76ms, server-side: 61ms] [0 rows, 0B] [0 rows/s, 0B/s]
presto:tpch> select sum_data_size_for_stats(comment) from orders;
_col0
--------
727364
(1 row)
IMO I think that we should be able to contribute this change to the Iceberg community but it might be hard to get them to accept such a change
- The spec states that the data size field in the manifest should be the on-disk size. I don't think this is a very useful metric for the optimizer unless we can consistently convert this to a "true" size value.
- Other file formats don't have support for reading the uncompressed size - e.g. in Iceberg's ORC implementation, they call
getBytesOnDisk
and there isn't a corresponding method for uncompressed or "in memory" size.
from presto.
cc: @aaneja @ClarenceThreepwood
from presto.
Related Issues (20)
- TaskManagerTest.aggregationSpill flaked with a velox runtime error HOT 5
- Decimal multiplication fails with DECIMAL scale must be in range [0, precision] HOT 10
- [Prestissimo] Very slow HashProbe for an expanding JOIN HOT 1
- Join Query results in large bytecode exceeding the limits imposed by JVM Error in logs
- Autoformat automatically and only automatically HOT 1
- Greatest/Least Function Check NaN on REAL data types? HOT 5
- TestBitmap.testRoundTrip flakes HOT 1
- Label and Notify job failed
- [Native] - Intermittent failure in a query containing empty windows frames
- Flaky Test: TestQueryTaskLimit.testQueuingWhenTaskLimitExceeds
- Flaky Tests in TestQuickStatsProvider
- CI Failing with docker-compose: command not found HOT 3
- Flaky Test Suite: spark-integration HOT 1
- Heuristic cte materialization strategy materializes semantically unwanted ctes
- Flakes caused by Exception when reading log file at org.apache.hudi.common.table.log.AbstractHoodieLogRecordReader
- TestMongoDistributedQueries.testSamplingJoinChain flakes HOT 2
- TestIcebergParquetMetadataCaching.testParquetMetadataCaching looks flaky HOT 2
- TestDirectoryListCacheInvalidation.testDirectoryListCacheInvalidation flakes HOT 6
- [native] Fail to build Prestissimo due to fbthrift linking error HOT 1
- [native] - count() function with filter is returning incorrect results with property MERGE_AGGREGATIONS_WITH_AND_WITHOUT_FILTER enabled
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from presto.