You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2020/08/25 17:07:47 UTC

[GitHub] [iceberg] aokolnychyi opened a new pull request #1379: Spark: Estimate statistics using snapshot summary only for data tables

aokolnychyi opened a new pull request #1379:
URL: https://github.com/apache/iceberg/pull/1379


   This PR disables stats estimation for metadata tables using snapshot summary.


----------------------------------------------------------------
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.

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


[GitHub] [iceberg] rdblue commented on a change in pull request #1379: Spark: Estimate statistics using snapshot summary only for partitioned tables

Posted by GitBox <gi...@apache.org>.
rdblue commented on a change in pull request #1379:
URL: https://github.com/apache/iceberg/pull/1379#discussion_r476612692



##########
File path: spark2/src/main/java/org/apache/iceberg/spark/source/Reader.java
##########
@@ -283,7 +284,8 @@ public Statistics estimateStatistics() {
       return new Stats(0L, 0L);
     }
 
-    if (filterExpressions == null || filterExpressions == Expressions.alwaysTrue()) {

Review comment:
       And it was always `null` then?




----------------------------------------------------------------
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.

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


[GitHub] [iceberg] aokolnychyi commented on a change in pull request #1379: Spark: Estimate statistics using snapshot summary only for data tables

Posted by GitBox <gi...@apache.org>.
aokolnychyi commented on a change in pull request #1379:
URL: https://github.com/apache/iceberg/pull/1379#discussion_r476604000



##########
File path: spark2/src/main/java/org/apache/iceberg/spark/source/Reader.java
##########
@@ -283,7 +284,8 @@ public Statistics estimateStatistics() {
       return new Stats(0L, 0L);
     }
 
-    if (filterExpressions == null || filterExpressions == Expressions.alwaysTrue()) {

Review comment:
       We had a wrong predicate before: we compared a list to an expression.




----------------------------------------------------------------
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.

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


[GitHub] [iceberg] aokolnychyi commented on pull request #1379: Spark: Estimate statistics using snapshot summary only for partitioned tables

Posted by GitBox <gi...@apache.org>.
aokolnychyi commented on pull request #1379:
URL: https://github.com/apache/iceberg/pull/1379#issuecomment-680214878


   Thanks for the review, @rdblue and @RussellSpitzer!


----------------------------------------------------------------
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.

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


[GitHub] [iceberg] aokolnychyi merged pull request #1379: Spark: Estimate statistics using snapshot summary only for partitioned tables

Posted by GitBox <gi...@apache.org>.
aokolnychyi merged pull request #1379:
URL: https://github.com/apache/iceberg/pull/1379


   


----------------------------------------------------------------
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.

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


[GitHub] [iceberg] aokolnychyi commented on pull request #1379: Spark: Estimate statistics using snapshot summary only for partitioned tables

Posted by GitBox <gi...@apache.org>.
aokolnychyi commented on pull request #1379:
URL: https://github.com/apache/iceberg/pull/1379#issuecomment-680158316


   cc @sudssf @RussellSpitzer @rdblue 


----------------------------------------------------------------
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.

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


[GitHub] [iceberg] sudssf commented on a change in pull request #1379: Spark: Estimate statistics using snapshot summary only for partitioned tables

Posted by GitBox <gi...@apache.org>.
sudssf commented on a change in pull request #1379:
URL: https://github.com/apache/iceberg/pull/1379#discussion_r476761272



##########
File path: spark2/src/main/java/org/apache/iceberg/spark/source/Reader.java
##########
@@ -283,7 +284,8 @@ public Statistics estimateStatistics() {
       return new Stats(0L, 0L);
     }
 
-    if (filterExpressions == null || filterExpressions == Expressions.alwaysTrue()) {

Review comment:
       thanks for catching this @aokolnychyi 




----------------------------------------------------------------
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.

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


[GitHub] [iceberg] rdblue commented on a change in pull request #1379: Spark: Estimate statistics using snapshot summary only for partitioned tables

Posted by GitBox <gi...@apache.org>.
rdblue commented on a change in pull request #1379:
URL: https://github.com/apache/iceberg/pull/1379#discussion_r476612913



##########
File path: spark2/src/main/java/org/apache/iceberg/spark/source/Reader.java
##########
@@ -283,7 +283,8 @@ public Statistics estimateStatistics() {
       return new Stats(0L, 0L);
     }
 
-    if (filterExpressions == null || filterExpressions == Expressions.alwaysTrue()) {
+    // estimate stats using snapshot summary only for partitioned tables (metadata tables are unpartitioned)
+    if (table.spec().fields().size() > 0 && filterExpression() == Expressions.alwaysTrue()) {

Review comment:
       I recently added `isUnpartitioned` since we do this check fairly often.




----------------------------------------------------------------
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.

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


[GitHub] [iceberg] aokolnychyi commented on a change in pull request #1379: Spark: Estimate statistics using snapshot summary only for partitioned tables

Posted by GitBox <gi...@apache.org>.
aokolnychyi commented on a change in pull request #1379:
URL: https://github.com/apache/iceberg/pull/1379#discussion_r476621954



##########
File path: spark2/src/main/java/org/apache/iceberg/spark/source/Reader.java
##########
@@ -283,7 +284,8 @@ public Statistics estimateStatistics() {
       return new Stats(0L, 0L);
     }
 
-    if (filterExpressions == null || filterExpressions == Expressions.alwaysTrue()) {

Review comment:
       Yeah, it was null




----------------------------------------------------------------
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.

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


[GitHub] [iceberg] aokolnychyi commented on a change in pull request #1379: Spark: Estimate statistics using snapshot summary only for partitioned tables

Posted by GitBox <gi...@apache.org>.
aokolnychyi commented on a change in pull request #1379:
URL: https://github.com/apache/iceberg/pull/1379#discussion_r476623038



##########
File path: spark2/src/main/java/org/apache/iceberg/spark/source/Reader.java
##########
@@ -283,7 +283,8 @@ public Statistics estimateStatistics() {
       return new Stats(0L, 0L);
     }
 
-    if (filterExpressions == null || filterExpressions == Expressions.alwaysTrue()) {
+    // estimate stats using snapshot summary only for partitioned tables (metadata tables are unpartitioned)
+    if (table.spec().fields().size() > 0 && filterExpression() == Expressions.alwaysTrue()) {

Review comment:
       I try to avoid negation in conditions to keep them easy to read. It looks OK here, updated.




----------------------------------------------------------------
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.

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