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 2022/02/01 13:31:53 UTC

[GitHub] [iceberg] izchen opened a new pull request #4020: Spark 3.0: Reports bytesWritten and recordsWritten to metrics

izchen opened a new pull request #4020:
URL: https://github.com/apache/iceberg/pull/4020


   something like:
   
   ![output_metrics1](https://user-images.githubusercontent.com/67534059/151977100-673ace32-32f3-407d-90bc-5e8b798ee8b8.jpg)
   
   ![output_metrics2](https://user-images.githubusercontent.com/67534059/151977223-e76b9b09-5989-45ed-b2e4-6272ac14cf26.jpg)
   


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


[GitHub] [iceberg] rdblue commented on pull request #4020: Spark 3.0: Reports bytesWritten and recordsWritten to metrics

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


   Mostly looks good to me. Just a couple of minor things to fix. Thanks, @izchen!


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


[GitHub] [iceberg] izchen commented on pull request #4020: Spark 3.0: Reports bytesWritten and recordsWritten to metrics

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


   @rdblue @kbendick Could you help review? 😄


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


[GitHub] [iceberg] rdblue merged pull request #4020: Spark 3.0: Reports bytesWritten and recordsWritten to metrics

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


   


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


[GitHub] [iceberg] rdblue commented on a change in pull request #4020: Spark 3.0: Reports bytesWritten and recordsWritten to metrics

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



##########
File path: spark/v3.0/spark/src/main/java/org/apache/iceberg/spark/source/SparkWrite.java
##########
@@ -492,9 +495,26 @@ public void doCommit(long epochId, WriterCommitMessage[] messages) {
 
   public static class TaskCommit implements WriterCommitMessage {
     private final DataFile[] taskFiles;
+    private long bytesWritten = 0L;
+    private long recordsWritten = 0L;
 
     TaskCommit(DataFile[] taskFiles) {
       this.taskFiles = taskFiles;
+      for (DataFile dataFile : taskFiles) {
+        this.bytesWritten += dataFile.fileSizeInBytes();
+        this.recordsWritten += dataFile.recordCount();
+      }
+    }
+
+    // Reports bytesWritten and recordsWritten to the Spark output metrics.
+    // Can only be called in executor.
+    void reportsToOutputMetrics() {

Review comment:
       I think `reportOutputMetrics` is a slightly better name.




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


[GitHub] [iceberg] rdblue commented on pull request #4020: Spark 3.0: Reports bytesWritten and recordsWritten to metrics

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


   Thanks, @izchen! I'll merge this when tests have passed. Do you want to also port this to Spark 3.1 and 3.2?


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


[GitHub] [iceberg] rdblue commented on a change in pull request #4020: Spark 3.0: Reports bytesWritten and recordsWritten to metrics

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



##########
File path: spark/v3.0/spark/src/main/java/org/apache/iceberg/spark/source/SparkWrite.java
##########
@@ -492,9 +495,26 @@ public void doCommit(long epochId, WriterCommitMessage[] messages) {
 
   public static class TaskCommit implements WriterCommitMessage {
     private final DataFile[] taskFiles;
+    private long bytesWritten = 0L;
+    private long recordsWritten = 0L;
 
     TaskCommit(DataFile[] taskFiles) {
       this.taskFiles = taskFiles;
+      for (DataFile dataFile : taskFiles) {
+        this.bytesWritten += dataFile.fileSizeInBytes();
+        this.recordsWritten += dataFile.recordCount();
+      }

Review comment:
       Why store these as instance fields if this isn't going to expose them anywhere? I think these could be calculated in the report method.




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


[GitHub] [iceberg] izchen commented on a change in pull request #4020: Spark 3.0: Reports bytesWritten and recordsWritten to metrics

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



##########
File path: spark/v3.0/spark/src/main/java/org/apache/iceberg/spark/source/SparkWrite.java
##########
@@ -492,9 +495,26 @@ public void doCommit(long epochId, WriterCommitMessage[] messages) {
 
   public static class TaskCommit implements WriterCommitMessage {
     private final DataFile[] taskFiles;
+    private long bytesWritten = 0L;
+    private long recordsWritten = 0L;
 
     TaskCommit(DataFile[] taskFiles) {
       this.taskFiles = taskFiles;
+      for (DataFile dataFile : taskFiles) {
+        this.bytesWritten += dataFile.fileSizeInBytes();
+        this.recordsWritten += dataFile.recordCount();
+      }

Review comment:
       done

##########
File path: spark/v3.0/spark/src/main/java/org/apache/iceberg/spark/source/SparkWrite.java
##########
@@ -492,9 +495,26 @@ public void doCommit(long epochId, WriterCommitMessage[] messages) {
 
   public static class TaskCommit implements WriterCommitMessage {
     private final DataFile[] taskFiles;
+    private long bytesWritten = 0L;
+    private long recordsWritten = 0L;
 
     TaskCommit(DataFile[] taskFiles) {
       this.taskFiles = taskFiles;
+      for (DataFile dataFile : taskFiles) {
+        this.bytesWritten += dataFile.fileSizeInBytes();
+        this.recordsWritten += dataFile.recordCount();
+      }
+    }
+
+    // Reports bytesWritten and recordsWritten to the Spark output metrics.
+    // Can only be called in executor.
+    void reportsToOutputMetrics() {

Review comment:
       done




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


[GitHub] [iceberg] izchen commented on pull request #4020: Spark 3.0: Reports bytesWritten and recordsWritten to metrics

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


   Thanks for your review, @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.

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