You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "ebyhr (via GitHub)" <gi...@apache.org> on 2025/10/20 02:21:38 UTC

[I] Extend partition statistics support to unpartitioned tables [iceberg]

ebyhr opened a new issue, #14375:
URL: https://github.com/apache/iceberg/issues/14375

   ### Proposed Change
   
   Currently, the partition statistics file is only supported for partitioned tables.
   
   https://github.com/apache/iceberg/blob/b987e60bbd581d6e9e583107d5a85022261ff0d8/core/src/main/java/org/apache/iceberg/PartitionStatsHandler.java#L207
   
   While this design makes sense since it’s conceptually a “partition” statistics file, the information it contains is also valuable for unpartitioned tables.
   
   For example, the Trino Iceberg connector currently needs to read manifest files ([TableStatisticsReader](https://github.com/trinodb/trino/blob/master/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/TableStatisticsReader.java)) to build internal table statistics. If Iceberg provided a statistics file for unpartitioned tables as well, Trino (and other query engines) could leverage it directly, improving planning performance by avoiding expensive manifest reads.
   
   ### Proposal document
   
   _No response_
   
   ### Specifications
   
   - [x] Table
   - [ ] View
   - [ ] REST
   - [ ] Puffin
   - [ ] Encryption
   - [ ] Other


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] Extend partition statistics support to unpartitioned tables [iceberg]

Posted by "sopel39 (via GitHub)" <gi...@apache.org>.
sopel39 commented on issue #14375:
URL: https://github.com/apache/iceberg/issues/14375#issuecomment-3421099178

   What Iceberg spec says about it?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] Extend partition statistics support to unpartitioned tables [iceberg]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #14375: Extend partition statistics support to unpartitioned tables
URL: https://github.com/apache/iceberg/issues/14375


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] Extend partition statistics support to unpartitioned tables [iceberg]

Posted by "moomindani (via GitHub)" <gi...@apache.org>.
moomindani commented on issue #14375:
URL: https://github.com/apache/iceberg/issues/14375#issuecomment-4190692661

   I agree with @raunaqmorarka's perspective — an unpartitioned table can be naturally modeled as a partitioned table with a single partition. Reusing the existing partition statistics infrastructure keeps the design consistent and avoids introducing a separate mechanism for table-level statistics.
   
   Looking at the current implementation, the restriction to partitioned tables is enforced by a few precondition checks in `PartitionStatsHandler` and `PartitionStatistics`, while the spec itself does not explicitly prohibit unpartitioned tables. The `EMPTY_PARTITION_FIELD` constant already exists to represent an empty partition struct, which could serve as the single partition entry for unpartitioned tables.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] Extend partition statistics support to unpartitioned tables [iceberg]

Posted by "ebyhr (via GitHub)" <gi...@apache.org>.
ebyhr commented on issue #14375:
URL: https://github.com/apache/iceberg/issues/14375#issuecomment-4190840847

   https://github.com/apache/iceberg/pull/15896 removes the condition for supporting unpartitioned tables in partition stats.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] Extend partition statistics support to unpartitioned tables [iceberg]

Posted by "raunaqmorarka (via GitHub)" <gi...@apache.org>.
raunaqmorarka commented on issue #14375:
URL: https://github.com/apache/iceberg/issues/14375#issuecomment-3430824480

   > It looks to me this would be better handled in a separate place. Trino needs a stats file rather than a partition stats file.
   
   This is not a Trino only problem, its a problem for any engine that wants to read table statistics for cost based optimizations in the planner. We already have a statistics file for per column NDV stats at the table level. However, we are forced to read manifest files to get all the other statistics (row count, column size, min, max, nulls count). Reading manifests is an expensive operation for large tables, or tables with lots of small manifests.
   Now that we already have a concept of partition statistics in iceberg which helps us to avoid reading manifests to build table statistics, it is natural to extend that concept to unpartitioned tables as well. An unpartitioned table can be thought of as a partitioned table with a single partition.
   Trino can of course create its own stats file for unpartitioned tables. However, that is an unsatisfactory solution as it becomes an engine specific thing. It also looks like poor design to have one solution for getting statistics for a partitioned table and an entirely different solution for unpartitioned tables.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] Extend partition statistics support to unpartitioned tables [iceberg]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #14375:
URL: https://github.com/apache/iceberg/issues/14375#issuecomment-6257064150

   This issue has been closed because it has not received any activity in the last 14 days since being marked as 'stale'


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] Extend partition statistics support to unpartitioned tables [iceberg]

Posted by "ebyhr (via GitHub)" <gi...@apache.org>.
ebyhr commented on issue #14375:
URL: https://github.com/apache/iceberg/issues/14375#issuecomment-3420302616

   cc: @ajantha-bhat @findepi @raunaqmorarka @sopel39 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] Extend partition statistics support to unpartitioned tables [iceberg]

Posted by "manuzhang (via GitHub)" <gi...@apache.org>.
manuzhang commented on issue #14375:
URL: https://github.com/apache/iceberg/issues/14375#issuecomment-3424351867

   > If Iceberg provided a statistics file for unpartitioned tables as well, Trino (and other query engines) could leverage it directly, improving planning performance by avoiding expensive manifest reads.
   
   It looks to me this would be better handled in a separate place. Trino needs a stats file rather than a partition stats file.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] Extend partition statistics support to unpartitioned tables [iceberg]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #14375:
URL: https://github.com/apache/iceberg/issues/14375#issuecomment-5975248889

   This issue has been automatically marked as stale because it has been open for 180 days with no activity. It will be closed in next 14 days if no further activity occurs. To permanently prevent this issue from being considered stale, add the label 'not-stale', but commenting on the issue is preferred when possible.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org