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/01/16 10:24:49 UTC

[GitHub] [incubator-iceberg] aokolnychyi opened a new pull request #738: Collect row stats while writing manifests

aokolnychyi opened a new pull request #738: Collect row stats while writing manifests
URL: https://github.com/apache/incubator-iceberg/pull/738
 
 
   This PR extends the information stored in the manifest list with row stats to avoid touching manifests in #675.

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


With regards,
Apache Git Services

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


[GitHub] [incubator-iceberg] rdblue merged pull request #738: Collect row stats while writing manifests

Posted by GitBox <gi...@apache.org>.
rdblue merged pull request #738: Collect row stats while writing manifests
URL: https://github.com/apache/incubator-iceberg/pull/738
 
 
   

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


With regards,
Apache Git Services

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


[GitHub] [incubator-iceberg] aokolnychyi commented on a change in pull request #738: Collect row stats while writing manifests

Posted by GitBox <gi...@apache.org>.
aokolnychyi commented on a change in pull request #738: Collect row stats while writing manifests
URL: https://github.com/apache/incubator-iceberg/pull/738#discussion_r369201089
 
 

 ##########
 File path: api/src/main/java/org/apache/iceberg/ManifestFile.java
 ##########
 @@ -42,7 +42,10 @@
           required(509, "contains_null", Types.BooleanType.get()),
           optional(510, "lower_bound", Types.BinaryType.get()), // null if no non-null values
           optional(511, "upper_bound", Types.BinaryType.get())
-      ))));
+      ))),
+      optional(512, "added_rows_count", Types.LongType.get()),
+      optional(513, "existing_rows_count", Types.LongType.get()),
+      optional(514, "deleted_rows_count", Types.LongType.get()));
 
 Review comment:
   Hm, reordering actually led to failures while writing manifest lists.

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


With regards,
Apache Git Services

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


[GitHub] [incubator-iceberg] aokolnychyi commented on a change in pull request #738: Collect row stats while writing manifests

Posted by GitBox <gi...@apache.org>.
aokolnychyi commented on a change in pull request #738: Collect row stats while writing manifests
URL: https://github.com/apache/incubator-iceberg/pull/738#discussion_r370506663
 
 

 ##########
 File path: api/src/main/java/org/apache/iceberg/ManifestFile.java
 ##########
 @@ -42,7 +42,10 @@
           required(509, "contains_null", Types.BooleanType.get()),
           optional(510, "lower_bound", Types.BinaryType.get()), // null if no non-null values
           optional(511, "upper_bound", Types.BinaryType.get())
-      ))));
+      ))),
+      optional(512, "added_rows_count", Types.LongType.get()),
+      optional(513, "existing_rows_count", Types.LongType.get()),
+      optional(514, "deleted_rows_count", Types.LongType.get()));
 
 Review comment:
   @rdblue, yes, `GenericAvroWriter` doesn't. I think `SparkAvroWriter` does respect field ids.

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


With regards,
Apache Git Services

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


[GitHub] [incubator-iceberg] chenjunjiedada commented on a change in pull request #738: Collect row stats while writing manifests

Posted by GitBox <gi...@apache.org>.
chenjunjiedada commented on a change in pull request #738: Collect row stats while writing manifests
URL: https://github.com/apache/incubator-iceberg/pull/738#discussion_r367865824
 
 

 ##########
 File path: core/src/test/java/org/apache/iceberg/TestManifestWriter.java
 ##########
 @@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg;
+
+import java.io.IOException;
+import java.util.UUID;
+import org.apache.iceberg.ManifestEntry.Status;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class TestManifestWriter extends TableTestBase {
 
 Review comment:
   +1 to extract out base classes for just manifest and snapshots.

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


With regards,
Apache Git Services

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


[GitHub] [incubator-iceberg] rdblue commented on issue #738: Collect row stats while writing manifests

Posted by GitBox <gi...@apache.org>.
rdblue commented on issue #738: Collect row stats while writing manifests
URL: https://github.com/apache/incubator-iceberg/pull/738#issuecomment-575713745
 
 
   Looks good to me.

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


With regards,
Apache Git Services

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


[GitHub] [incubator-iceberg] aokolnychyi commented on a change in pull request #738: Collect row stats while writing manifests

Posted by GitBox <gi...@apache.org>.
aokolnychyi commented on a change in pull request #738: Collect row stats while writing manifests
URL: https://github.com/apache/incubator-iceberg/pull/738#discussion_r368062884
 
 

 ##########
 File path: api/src/main/java/org/apache/iceberg/ManifestFile.java
 ##########
 @@ -42,7 +42,10 @@
           required(509, "contains_null", Types.BooleanType.get()),
           optional(510, "lower_bound", Types.BinaryType.get()), // null if no non-null values
           optional(511, "upper_bound", Types.BinaryType.get())
-      ))));
+      ))),
+      optional(512, "added_rows_count", Types.LongType.get()),
+      optional(513, "existing_rows_count", Types.LongType.get()),
+      optional(514, "deleted_rows_count", Types.LongType.get()));
 
 Review comment:
   @rdblue, not sure I got. Do you mean whether we can avoid storing these and add them up?

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


With regards,
Apache Git Services

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


[GitHub] [incubator-iceberg] aokolnychyi commented on a change in pull request #738: Collect row stats while writing manifests

Posted by GitBox <gi...@apache.org>.
aokolnychyi commented on a change in pull request #738: Collect row stats while writing manifests
URL: https://github.com/apache/incubator-iceberg/pull/738#discussion_r368065778
 
 

 ##########
 File path: api/src/main/java/org/apache/iceberg/ManifestFile.java
 ##########
 @@ -42,7 +42,10 @@
           required(509, "contains_null", Types.BooleanType.get()),
           optional(510, "lower_bound", Types.BinaryType.get()), // null if no non-null values
           optional(511, "upper_bound", Types.BinaryType.get())
-      ))));
+      ))),
+      optional(512, "added_rows_count", Types.LongType.get()),
+      optional(513, "existing_rows_count", Types.LongType.get()),
+      optional(514, "deleted_rows_count", Types.LongType.get()));
 
 Review comment:
   Yes, let me update this.

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


With regards,
Apache Git Services

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


[GitHub] [incubator-iceberg] aokolnychyi commented on a change in pull request #738: Collect row stats while writing manifests

Posted by GitBox <gi...@apache.org>.
aokolnychyi commented on a change in pull request #738: Collect row stats while writing manifests
URL: https://github.com/apache/incubator-iceberg/pull/738#discussion_r369222261
 
 

 ##########
 File path: api/src/main/java/org/apache/iceberg/ManifestFile.java
 ##########
 @@ -42,7 +42,10 @@
           required(509, "contains_null", Types.BooleanType.get()),
           optional(510, "lower_bound", Types.BinaryType.get()), // null if no non-null values
           optional(511, "upper_bound", Types.BinaryType.get())
-      ))));
+      ))),
+      optional(512, "added_rows_count", Types.LongType.get()),
+      optional(513, "existing_rows_count", Types.LongType.get()),
+      optional(514, "deleted_rows_count", Types.LongType.get()));
 
 Review comment:
   @rdblue, do we want to build something as `ProjectionDatumReader` for the write side?

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


With regards,
Apache Git Services

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


[GitHub] [incubator-iceberg] rdblue commented on a change in pull request #738: Collect row stats while writing manifests

Posted by GitBox <gi...@apache.org>.
rdblue commented on a change in pull request #738: Collect row stats while writing manifests
URL: https://github.com/apache/incubator-iceberg/pull/738#discussion_r368042226
 
 

 ##########
 File path: api/src/main/java/org/apache/iceberg/ManifestFile.java
 ##########
 @@ -42,7 +42,10 @@
           required(509, "contains_null", Types.BooleanType.get()),
           optional(510, "lower_bound", Types.BinaryType.get()), // null if no non-null values
           optional(511, "upper_bound", Types.BinaryType.get())
-      ))));
+      ))),
+      optional(512, "added_rows_count", Types.LongType.get()),
+      optional(513, "existing_rows_count", Types.LongType.get()),
+      optional(514, "deleted_rows_count", Types.LongType.get()));
 
 Review comment:
   Can we add these up by the data files counts?

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


With regards,
Apache Git Services

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


[GitHub] [incubator-iceberg] rdblue commented on a change in pull request #738: Collect row stats while writing manifests

Posted by GitBox <gi...@apache.org>.
rdblue commented on a change in pull request #738: Collect row stats while writing manifests
URL: https://github.com/apache/incubator-iceberg/pull/738#discussion_r370265137
 
 

 ##########
 File path: api/src/main/java/org/apache/iceberg/ManifestFile.java
 ##########
 @@ -42,7 +42,10 @@
           required(509, "contains_null", Types.BooleanType.get()),
           optional(510, "lower_bound", Types.BinaryType.get()), // null if no non-null values
           optional(511, "upper_bound", Types.BinaryType.get())
-      ))));
+      ))),
+      optional(512, "added_rows_count", Types.LongType.get()),
+      optional(513, "existing_rows_count", Types.LongType.get()),
+      optional(514, "deleted_rows_count", Types.LongType.get()));
 
 Review comment:
   Writers don't use field IDs?

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


With regards,
Apache Git Services

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


[GitHub] [incubator-iceberg] aokolnychyi commented on a change in pull request #738: Collect row stats while writing manifests

Posted by GitBox <gi...@apache.org>.
aokolnychyi commented on a change in pull request #738: Collect row stats while writing manifests
URL: https://github.com/apache/incubator-iceberg/pull/738#discussion_r369992103
 
 

 ##########
 File path: api/src/main/java/org/apache/iceberg/ManifestFile.java
 ##########
 @@ -42,7 +42,10 @@
           required(509, "contains_null", Types.BooleanType.get()),
           optional(510, "lower_bound", Types.BinaryType.get()), // null if no non-null values
           optional(511, "upper_bound", Types.BinaryType.get())
-      ))));
+      ))),
+      optional(512, "added_rows_count", Types.LongType.get()),
+      optional(513, "existing_rows_count", Types.LongType.get()),
+      optional(514, "deleted_rows_count", Types.LongType.get()));
 
 Review comment:
   @rdblue, I reverted this change. I propose to merge this PR as is and create a follow-up issue to implement writers that take into account field ids. 

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


With regards,
Apache Git Services

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


[GitHub] [incubator-iceberg] rdblue commented on a change in pull request #738: Collect row stats while writing manifests

Posted by GitBox <gi...@apache.org>.
rdblue commented on a change in pull request #738: Collect row stats while writing manifests
URL: https://github.com/apache/incubator-iceberg/pull/738#discussion_r368043053
 
 

 ##########
 File path: core/src/test/java/org/apache/iceberg/TestManifestWriter.java
 ##########
 @@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg;
+
+import java.io.IOException;
+import java.util.UUID;
+import org.apache.iceberg.ManifestEntry.Status;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class TestManifestWriter extends TableTestBase {
 
 Review comment:
   Either way is fine with me. I usually prefer to keep things simple.

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


With regards,
Apache Git Services

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


[GitHub] [incubator-iceberg] rdblue commented on a change in pull request #738: Collect row stats while writing manifests

Posted by GitBox <gi...@apache.org>.
rdblue commented on a change in pull request #738: Collect row stats while writing manifests
URL: https://github.com/apache/incubator-iceberg/pull/738#discussion_r368065049
 
 

 ##########
 File path: api/src/main/java/org/apache/iceberg/ManifestFile.java
 ##########
 @@ -42,7 +42,10 @@
           required(509, "contains_null", Types.BooleanType.get()),
           optional(510, "lower_bound", Types.BinaryType.get()), // null if no non-null values
           optional(511, "upper_bound", Types.BinaryType.get())
-      ))));
+      ))),
+      optional(512, "added_rows_count", Types.LongType.get()),
+      optional(513, "existing_rows_count", Types.LongType.get()),
+      optional(514, "deleted_rows_count", Types.LongType.get()));
 
 Review comment:
   No, I meant that we don't need to add these at the end of the schema. We can add them up by the file count columns, like you do with all of the accessor methods.

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


With regards,
Apache Git Services

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


[GitHub] [incubator-iceberg] rdblue commented on issue #738: Collect row stats while writing manifests

Posted by GitBox <gi...@apache.org>.
rdblue commented on issue #738: Collect row stats while writing manifests
URL: https://github.com/apache/incubator-iceberg/pull/738#issuecomment-577794161
 
 
   Thanks @aokolnychyi! I'll merge this.

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


With regards,
Apache Git Services

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


[GitHub] [incubator-iceberg] aokolnychyi commented on a change in pull request #738: Collect row stats while writing manifests

Posted by GitBox <gi...@apache.org>.
aokolnychyi commented on a change in pull request #738: Collect row stats while writing manifests
URL: https://github.com/apache/incubator-iceberg/pull/738#discussion_r367343739
 
 

 ##########
 File path: core/src/test/java/org/apache/iceberg/TestManifestWriter.java
 ##########
 @@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg;
+
+import java.io.IOException;
+import java.util.UUID;
+import org.apache.iceberg.ManifestEntry.Status;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class TestManifestWriter extends TableTestBase {
 
 Review comment:
   Technically, this doesn't have to extend `TableTestBase` but we need `writeManifest`. I think we can refactor a bit and introduce a separate parent class with the logic for writing/checking manifests/snapshots.

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


With regards,
Apache Git Services

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


[GitHub] [incubator-iceberg] aokolnychyi commented on a change in pull request #738: Collect row stats while writing manifests

Posted by GitBox <gi...@apache.org>.
aokolnychyi commented on a change in pull request #738: Collect row stats while writing manifests
URL: https://github.com/apache/incubator-iceberg/pull/738#discussion_r367343739
 
 

 ##########
 File path: core/src/test/java/org/apache/iceberg/TestManifestWriter.java
 ##########
 @@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg;
+
+import java.io.IOException;
+import java.util.UUID;
+import org.apache.iceberg.ManifestEntry.Status;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class TestManifestWriter extends TableTestBase {
 
 Review comment:
   Technically, this doesn't have to extend `TableTestBase` but we need `writeManifest`. I think we can refactor `TableTestBase` a bit and introduce a separate parent class with the logic for writing/checking manifests/snapshots.

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


With regards,
Apache Git Services

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


[GitHub] [incubator-iceberg] aokolnychyi commented on a change in pull request #738: Collect row stats while writing manifests

Posted by GitBox <gi...@apache.org>.
aokolnychyi commented on a change in pull request #738: Collect row stats while writing manifests
URL: https://github.com/apache/incubator-iceberg/pull/738#discussion_r367343739
 
 

 ##########
 File path: core/src/test/java/org/apache/iceberg/TestManifestWriter.java
 ##########
 @@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg;
+
+import java.io.IOException;
+import java.util.UUID;
+import org.apache.iceberg.ManifestEntry.Status;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class TestManifestWriter extends TableTestBase {
 
 Review comment:
   Technically, this doesn't have to extend `TableTestBase` but we need `writeManifest`. I think we can refactor a bit and introduce a separate parent test class with the logic for writing/checking manifests/snapshots.

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


With regards,
Apache Git Services

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


[GitHub] [incubator-iceberg] aokolnychyi commented on a change in pull request #738: Collect row stats while writing manifests

Posted by GitBox <gi...@apache.org>.
aokolnychyi commented on a change in pull request #738: Collect row stats while writing manifests
URL: https://github.com/apache/incubator-iceberg/pull/738#discussion_r368860773
 
 

 ##########
 File path: api/src/main/java/org/apache/iceberg/ManifestFile.java
 ##########
 @@ -42,7 +42,10 @@
           required(509, "contains_null", Types.BooleanType.get()),
           optional(510, "lower_bound", Types.BinaryType.get()), // null if no non-null values
           optional(511, "upper_bound", Types.BinaryType.get())
-      ))));
+      ))),
+      optional(512, "added_rows_count", Types.LongType.get()),
+      optional(513, "existing_rows_count", Types.LongType.get()),
+      optional(514, "deleted_rows_count", Types.LongType.get()));
 
 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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-iceberg] aokolnychyi commented on a change in pull request #738: Collect row stats while writing manifests

Posted by GitBox <gi...@apache.org>.
aokolnychyi commented on a change in pull request #738: Collect row stats while writing manifests
URL: https://github.com/apache/incubator-iceberg/pull/738#discussion_r369201089
 
 

 ##########
 File path: api/src/main/java/org/apache/iceberg/ManifestFile.java
 ##########
 @@ -42,7 +42,10 @@
           required(509, "contains_null", Types.BooleanType.get()),
           optional(510, "lower_bound", Types.BinaryType.get()), // null if no non-null values
           optional(511, "upper_bound", Types.BinaryType.get())
-      ))));
+      ))),
+      optional(512, "added_rows_count", Types.LongType.get()),
+      optional(513, "existing_rows_count", Types.LongType.get()),
+      optional(514, "deleted_rows_count", Types.LongType.get()));
 
 Review comment:
   Hm, reordering actually led to failures while writing manifest lists as `GenericAvroWriter` doesn't take into account field ids.

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


With regards,
Apache Git Services

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


[GitHub] [incubator-iceberg] aokolnychyi commented on a change in pull request #738: Collect row stats while writing manifests

Posted by GitBox <gi...@apache.org>.
aokolnychyi commented on a change in pull request #738: Collect row stats while writing manifests
URL: https://github.com/apache/incubator-iceberg/pull/738#discussion_r368860565
 
 

 ##########
 File path: core/src/test/java/org/apache/iceberg/TestManifestWriter.java
 ##########
 @@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg;
+
+import java.io.IOException;
+import java.util.UUID;
+import org.apache.iceberg.ManifestEntry.Status;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class TestManifestWriter extends TableTestBase {
 
 Review comment:
   I wanted to refactor but it looks the changes won't be worth the effort after a closer look. For example, we will need to pass a partition spec and `FileIO` to write manifests that we can simply take from `table` in `TableTestBase`. Let's keep it as is for now.

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


With regards,
Apache Git Services

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


[GitHub] [incubator-iceberg] aokolnychyi commented on a change in pull request #738: Collect row stats while writing manifests

Posted by GitBox <gi...@apache.org>.
aokolnychyi commented on a change in pull request #738: Collect row stats while writing manifests
URL: https://github.com/apache/incubator-iceberg/pull/738#discussion_r369992103
 
 

 ##########
 File path: api/src/main/java/org/apache/iceberg/ManifestFile.java
 ##########
 @@ -42,7 +42,10 @@
           required(509, "contains_null", Types.BooleanType.get()),
           optional(510, "lower_bound", Types.BinaryType.get()), // null if no non-null values
           optional(511, "upper_bound", Types.BinaryType.get())
-      ))));
+      ))),
+      optional(512, "added_rows_count", Types.LongType.get()),
+      optional(513, "existing_rows_count", Types.LongType.get()),
+      optional(514, "deleted_rows_count", Types.LongType.get()));
 
 Review comment:
   @rdblue, I reverted this change. I propose to merge it as is and create a follow-up issue to implement writers that take into account field ids. 

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


With regards,
Apache Git Services

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