Skip to content

Commit 9ade073

Browse files
committed
Refactor inheritance relationship
support incremental append scan support incremental append scan
1 parent 0bf175d commit 9ade073

File tree

4 files changed

+443
-38
lines changed

4 files changed

+443
-38
lines changed

dev/provision.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,3 +389,45 @@
389389
VALUES (4)
390390
"""
391391
)
392+
393+
spark.sql(
394+
f"""
395+
CREATE OR REPLACE TABLE {catalog_name}.default.test_table_read_from_snapshots (
396+
dt date,
397+
number integer,
398+
letter string
399+
)
400+
USING iceberg
401+
TBLPROPERTIES (
402+
'format-version'='2'
403+
);
404+
"""
405+
)
406+
407+
spark.sql(
408+
f"""
409+
INSERT INTO {catalog_name}.default.test_table_read_from_snapshots
410+
VALUES (CAST('2022-03-01' AS date), 1, 'a')
411+
"""
412+
)
413+
414+
spark.sql(
415+
f"""
416+
INSERT INTO {catalog_name}.default.test_table_read_from_snapshots
417+
VALUES (CAST('2022-03-01' AS date), 2, 'b')
418+
"""
419+
)
420+
421+
spark.sql(
422+
f"""
423+
INSERT INTO {catalog_name}.default.test_table_read_from_snapshots
424+
VALUES (CAST('2022-03-02' AS date), 3, 'c')
425+
"""
426+
)
427+
428+
spark.sql(
429+
f"""
430+
INSERT INTO {catalog_name}.default.test_table_read_from_snapshots
431+
VALUES (CAST('2022-03-02' AS date), 4, 'd')
432+
"""
433+
)

pyiceberg/manifest.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,17 @@ class ManifestFile(Record):
551551
def __init__(self, *data: Any, **named_data: Any) -> None:
552552
super().__init__(*data, **{"struct": MANIFEST_LIST_FILE_STRUCTS[DEFAULT_READ_VERSION], **named_data})
553553

554+
def __eq__(self, other: Any) -> bool:
555+
"""Return the equality of two instances of the ManifestFile class."""
556+
if not isinstance(other, ManifestFile):
557+
return False
558+
else:
559+
return self.manifest_path == other.manifest_path
560+
561+
def __hash__(self) -> int:
562+
"""Return the hash of manifest_path."""
563+
return hash(self.manifest_path)
564+
554565
def has_added_files(self) -> bool:
555566
return self.added_files_count is None or self.added_files_count > 0
556567

0 commit comments

Comments
 (0)