File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1103,6 +1103,21 @@ def test_incremental_append_scan_selected_fields(catalog: Catalog) -> None:
11031103 assert sorted (result_table ["number" ].to_pylist ()) == [2 , 3 , 4 ]
11041104
11051105
1106+ @pytest .mark .integration
1107+ @pytest .mark .parametrize ("catalog" , [pytest .lazy_fixture ("session_catalog_hive" ), pytest .lazy_fixture ("session_catalog" )])
1108+ def test_incremental_append_scan_limit (catalog : Catalog ) -> None :
1109+ test_table = catalog .load_table ("default.test_incremental_read" )
1110+
1111+ scan = (
1112+ test_table .incremental_append_scan (limit = 2 )
1113+ .from_snapshot_exclusive (test_table .snapshots ()[0 ].snapshot_id )
1114+ .to_snapshot_inclusive (test_table .snapshots ()[2 ].snapshot_id )
1115+ )
1116+
1117+ # Although three rows were added in the range, the limit of 2 should be applied
1118+ assert len (scan .to_arrow ()) == 2
1119+
1120+
11061121@pytest .mark .integration
11071122@pytest .mark .parametrize ("catalog" , [pytest .lazy_fixture ("session_catalog_hive" )])
11081123def test_incremental_append_scan_to_snapshot_defaults_to_current (catalog : Catalog ) -> None :
You can’t perform that action at this time.
0 commit comments