smaheshwar-pltr commented on code in PR #3512:
URL: https://github.com/apache/iceberg-python/pull/3512#discussion_r3484946130


##########
dev/provision.py:
##########
@@ -395,3 +395,48 @@
     )
     spark.sql(f"ALTER TABLE {catalog_name}.default.test_empty_scan_ordered_str 
WRITE ORDERED BY id")
     spark.sql(f"INSERT INTO {catalog_name}.default.test_empty_scan_ordered_str 
VALUES 'a', 'c'")
+
+    # Append scan fixture. Snapshots written:
+    #   0: append (1, 'a')
+    #   1: append (2, 'b')
+    #   2: append (3, 'c'), (4, 'b')
+    #   3: compact -- rewrites the two letter='b' files into one 
(operation=replace)
+    #   4: delete number=2
+    #   5: append (5, 'd', 100) -- on evolved schema
+    #   6: replace table -- lineage break
+    spark.sql(
+        f"""
+            CREATE OR REPLACE TABLE 
{catalog_name}.default.test_incremental_read (
+                number integer,
+                letter string
+            )
+            USING iceberg
+            PARTITIONED BY (letter)
+            TBLPROPERTIES ('format-version'='2')
+            """
+    )
+    spark.sql(f"INSERT INTO {catalog_name}.default.test_incremental_read 
VALUES (1, 'a')")
+    spark.sql(f"INSERT INTO {catalog_name}.default.test_incremental_read 
VALUES (2, 'b')")
+    spark.sql(f"INSERT INTO {catalog_name}.default.test_incremental_read 
VALUES (3, 'c'), (4, 'b')")
+    # Compact: letter='b' has two files (from the previous two appends); 
rewrite them into one.
+    # This commits a non-append (replace) snapshot whose rewritten file the 
append scan must not pick up.

Review Comment:
   Addressing 
https://github.com/apache/iceberg-python/pull/3512#pullrequestreview-4548484537



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to