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 2021/01/28 23:23:09 UTC

[GitHub] [iceberg] aokolnychyi opened a new pull request #2179: Spark: Add a test for MERGE modifying a null struct

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


   This PR adds a test for modifying a null struct in MERGE.


----------------------------------------------------------------
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] dilipbiswal commented on pull request #2179: Spark: Add a test for MERGE modifying a null struct

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


   LGTM . thanks for adding this test @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 pull request #2179: Spark: Add a test for MERGE modifying a null struct

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


   Thanks, @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] aokolnychyi commented on a change in pull request #2179: Spark: Add a test for MERGE modifying a null struct

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



##########
File path: spark/src/test/java/org/apache/iceberg/spark/SparkTestBase.java
##########
@@ -97,11 +97,24 @@ protected long waitUntilAfter(long timestampMillis) {
       return ImmutableList.of();
     }
 
-    return rows.stream()
-        .map(row -> IntStream.range(0, row.size())
-            .mapToObj(pos -> row.isNullAt(pos) ? null : row.get(pos))
-            .toArray(Object[]::new)
-        ).collect(Collectors.toList());
+    return rows.stream().map(this::toJava).collect(Collectors.toList());
+  }
+
+  private Object[] toJava(Row row) {

Review comment:
       I had to rewrite it to support nested structs.




----------------------------------------------------------------
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 #2179: Spark: Add a test for MERGE modifying a null struct

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



##########
File path: spark3-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestMerge.java
##########
@@ -49,9 +49,23 @@ public void removeTables() {
   }
 
   // TODO: tests for reordering when operations succeed (both insert and update actions)
-  // TODO: tests for modifying fields in a null struct
   // TODO: tests for subqueries in conditions
 
+  @Test
+  public void testMergeModifiesNullStruct() {

Review comment:
       The behavior matches what I tested for UPDATE in Postgres.




----------------------------------------------------------------
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 merged pull request #2179: Spark: Add a test for MERGE modifying a null struct

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


   


----------------------------------------------------------------
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 #2179: Spark: Add a test for MERGE modifying a null struct

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


   cc @dilipbiswal @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