You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "chenjunjiedada (via GitHub)" <gi...@apache.org> on 2023/02/06 07:33:12 UTC

[GitHub] [iceberg] chenjunjiedada opened a new pull request, #6753: Flink: use projection when delete records in upsert mode

chenjunjiedada opened a new pull request, #6753:
URL: https://github.com/apache/iceberg/pull/6753

   The equality delete writer is built with projected schema in upsert mode, but now it passes row data to it without projection and thus causes problems in case of the equality column is not the first column.
   
   This change adds projection when deleting records in upsert mode.


-- 
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] stevenzwu merged pull request #6753: Flink: use projection when delete records in upsert mode

Posted by "stevenzwu (via GitHub)" <gi...@apache.org>.
stevenzwu merged PR #6753:
URL: https://github.com/apache/iceberg/pull/6753


-- 
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] chenjunjiedada commented on pull request #6753: Flink: use projection when delete records in upsert mode

Posted by "chenjunjiedada (via GitHub)" <gi...@apache.org>.
chenjunjiedada commented on PR #6753:
URL: https://github.com/apache/iceberg/pull/6753#issuecomment-1420333684

   @stevenzwu @hililiwei You guys may want to take a look.


-- 
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] stevenzwu commented on pull request #6753: Flink: use projection when delete records in upsert mode

Posted by "stevenzwu (via GitHub)" <gi...@apache.org>.
stevenzwu commented on PR #6753:
URL: https://github.com/apache/iceberg/pull/6753#issuecomment-1447466992

   @chenjunjiedada thx for the contribution. can you create the backport PR too?


-- 
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] stevenzwu commented on a diff in pull request #6753: Flink: use projection when delete records in upsert mode

Posted by "stevenzwu (via GitHub)" <gi...@apache.org>.
stevenzwu commented on code in PR #6753:
URL: https://github.com/apache/iceberg/pull/6753#discussion_r1119160571


##########
flink/v1.16/flink/src/main/java/org/apache/iceberg/flink/sink/BaseDeltaTaskWriter.java:
##########
@@ -94,7 +94,11 @@ public void write(RowData row) throws IOException {
         writer.delete(row);
         break;
       case DELETE:
-        writer.delete(row);
+        if (upsert) {
+          writer.deleteKey(keyProjection.wrap(row));
+        } else {

Review Comment:
   nit: for consistency with other case clauses. maybe no `else`?
   ```
   if (upsert) {
   ...
   }
   ...
   break;
   ````



-- 
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] chenjunjiedada commented on a diff in pull request #6753: Flink: use projection when delete records in upsert mode

Posted by "chenjunjiedada (via GitHub)" <gi...@apache.org>.
chenjunjiedada commented on code in PR #6753:
URL: https://github.com/apache/iceberg/pull/6753#discussion_r1119489627


##########
flink/v1.16/flink/src/main/java/org/apache/iceberg/flink/sink/BaseDeltaTaskWriter.java:
##########
@@ -94,7 +94,11 @@ public void write(RowData row) throws IOException {
         writer.delete(row);
         break;
       case DELETE:
-        writer.delete(row);
+        if (upsert) {
+          writer.deleteKey(keyProjection.wrap(row));
+        } else {

Review Comment:
   @stevenzwu I don't think we should be consistent with other cases, the update case has to delete the key and write the row so it doesn't have an else clause, but here we only need to delete once.



-- 
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] stevenzwu commented on a diff in pull request #6753: Flink: use projection when delete records in upsert mode

Posted by "stevenzwu (via GitHub)" <gi...@apache.org>.
stevenzwu commented on code in PR #6753:
URL: https://github.com/apache/iceberg/pull/6753#discussion_r1119507165


##########
flink/v1.16/flink/src/main/java/org/apache/iceberg/flink/sink/BaseDeltaTaskWriter.java:
##########
@@ -94,7 +94,11 @@ public void write(RowData row) throws IOException {
         writer.delete(row);
         break;
       case DELETE:
-        writer.delete(row);
+        if (upsert) {
+          writer.deleteKey(keyProjection.wrap(row));
+        } else {

Review Comment:
   that's true. 



-- 
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] chenjunjiedada commented on pull request #6753: Flink: use projection when delete records in upsert mode

Posted by "chenjunjiedada (via GitHub)" <gi...@apache.org>.
chenjunjiedada commented on PR #6753:
URL: https://github.com/apache/iceberg/pull/6753#issuecomment-1447511175

   @stevenzwu I will do the backport today. Thanks for fixing the compiling failure!


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