rdblue commented on a change in pull request #2022:
URL: https://github.com/apache/iceberg/pull/2022#discussion_r561431956
##########
File path:
spark3-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestMergeIntoTable.java
##########
@@ -303,25 +305,107 @@ public void
testSingleUnconditionalDeleteDisbleCountCheck() throws NoSuchTableEx
}
@Test
- public void testSingleConditionalDeleteCountCheck() throws
NoSuchTableException {
- append(targetName, new Employee(1, "emp-id-one"), new Employee(6,
"emp-id-6"));
- append(sourceName, new Employee(1, "emp-id-1"), new Employee(1,
"emp-id-1"),
- new Employee(2, "emp-id-2"), new Employee(6, "emp-id-6"));
+ public void testIdentityPartition() {
+ writeModes.forEach(mode -> {
+ removeTables();
+ sql("CREATE TABLE %s (id INT, dep STRING) USING iceberg PARTITIONED BY
(identity(dep))", targetName);
+ initTable(targetName);
+ setWriteMode(targetName, mode);
+ createAndInitSourceTable(sourceName);
+ append(targetName, new Employee(1, "emp-id-one"), new Employee(6,
"emp-id-6"));
+ append(sourceName, new Employee(2, "emp-id-2"), new Employee(1,
"emp-id-1"), new Employee(6, "emp-id-6"));
+
+ String sqlText = "MERGE INTO " + targetName + " AS target \n" +
+ "USING " + sourceName + " AS source \n" +
+ "ON target.id = source.id \n" +
+ "WHEN MATCHED AND target.id = 1 THEN UPDATE SET * \n" +
+ "WHEN MATCHED AND target.id = 6 THEN DELETE \n" +
+ "WHEN NOT MATCHED AND source.id = 2 THEN INSERT * ";
+
+ sql(sqlText, "");
Review comment:
Minor: passing an extra empty string and passing table names embedded in
the SQL text.
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]