You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "MicroGery (via GitHub)" <gi...@apache.org> on 2025/12/17 01:56:20 UTC
[I] Is there any way to quickly query count(*) and the min/max of a specified column? [iceberg]
MicroGery opened a new issue, #14864:
URL: https://github.com/apache/iceberg/issues/14864
### Query engine
Spark
### Question
Without considering truncation, I can read the upper and lower bounds of a column from the Manifest File. But what if this partition has positional delete or equality delete files? How should I handle this to obtain the correct min/max values and the total count(*) for the table?
--
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] Is there any way to quickly query count(*) and the min/max of a specified column? [iceberg]
Posted by "MicroGery (via GitHub)" <gi...@apache.org>.
MicroGery commented on issue #14864:
URL: https://github.com/apache/iceberg/issues/14864#issuecomment-3669276672
@RussellSpitzer Thank you for your reply. For the min/max values of a certain column, it is definitely not possible to obtain the target value through metadata when there are any delete files. What if we simply perform a count(*) operation on a table?
--
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] Is there any way to quickly query count(*) and the min/max of a specified column? [iceberg]
Posted by "RussellSpitzer (via GitHub)" <gi...@apache.org>.
RussellSpitzer commented on issue #14864:
URL: https://github.com/apache/iceberg/issues/14864#issuecomment-3671067532
The way count(*) will operate is the same. If there are delete files spark will fall back to actually counting rows. The reason we have to do this (in all current versions at least) is that a Data Row Count - Delete Row count can't actually be preformed. Equality deletes don't know how many deletes they apply and position deletes files are allowed to overlap which means we can't actually determine the number of real unique deletes from metadata alone.
--
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] Is there any way to quickly query count(*) and the min/max of a specified column? [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #14864: Is there any way to quickly query count(*) and the min/max of a specified column?
URL: https://github.com/apache/iceberg/issues/14864
--
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] Is there any way to quickly query count(*) and the min/max of a specified column? [iceberg]
Posted by "MicroGery (via GitHub)" <gi...@apache.org>.
MicroGery commented on issue #14864:
URL: https://github.com/apache/iceberg/issues/14864#issuecomment-3677476736
@RussellSpitzer Thanks, I've got it. Btw, Is there a plan to make such optimization changes?
--
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] Is there any way to quickly query count(*) and the min/max of a specified column? [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #14864:
URL: https://github.com/apache/iceberg/issues/14864#issuecomment-5008805875
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] Is there any way to quickly query count(*) and the min/max of a specified column? [iceberg]
Posted by "RussellSpitzer (via GitHub)" <gi...@apache.org>.
RussellSpitzer commented on issue #14864:
URL: https://github.com/apache/iceberg/issues/14864#issuecomment-3666558824
There really isn't a way to calculate aggregates with only metadata if there are delete files of any kind (at least at the moment).
You can see the relevant code in our spark plugin impl https://github.com/apache/iceberg/blob/36bb82675ff68ac0ed059d4db62550d30aa35760/spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/source/SparkScanBuilder.java#L240-L245 where we just bail out.
This code doesn't actually use the "files" at all since all the information is stored within the Iceberg Manifest files. If we cannot determine the answer because of delete files, Spark will see that the aggregates are not pushed and calculate the aggregates on the engine side from the actual rows in the data files.
--
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] Is there any way to quickly query count(*) and the min/max of a specified column? [iceberg]
Posted by "osscm (via GitHub)" <gi...@apache.org>.
osscm commented on issue #14864:
URL: https://github.com/apache/iceberg/issues/14864#issuecomment-3706701975
@MicroGery are you referring to implement this feature at engine like - engine like Spark or Trino.
not sure if you are referring to something like this - we have a related [feature](https://github.com/trinodb/trino/pull/15832) implemented for Trino, and using it internally.
--
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] Is there any way to quickly query count(*) and the min/max of a specified column? [iceberg]
Posted by "RussellSpitzer (via GitHub)" <gi...@apache.org>.
RussellSpitzer commented on issue #14864:
URL: https://github.com/apache/iceberg/issues/14864#issuecomment-3697159189
What optimization changes?
--
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