Skip to content

Commit 3517327

Browse files
committed
Refactor inheritance relationship
support incremental append scan support incremental append scan
1 parent eb87f1d commit 3517327

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
@@ -342,3 +342,45 @@
342342
(array(), map(), array(struct(1)))
343343
"""
344344
)
345+
346+
spark.sql(
347+
f"""
348+
CREATE OR REPLACE TABLE {catalog_name}.default.test_table_read_from_snapshots (
349+
dt date,
350+
number integer,
351+
letter string
352+
)
353+
USING iceberg
354+
TBLPROPERTIES (
355+
'format-version'='2'
356+
);
357+
"""
358+
)
359+
360+
spark.sql(
361+
f"""
362+
INSERT INTO {catalog_name}.default.test_table_read_from_snapshots
363+
VALUES (CAST('2022-03-01' AS date), 1, 'a')
364+
"""
365+
)
366+
367+
spark.sql(
368+
f"""
369+
INSERT INTO {catalog_name}.default.test_table_read_from_snapshots
370+
VALUES (CAST('2022-03-01' AS date), 2, 'b')
371+
"""
372+
)
373+
374+
spark.sql(
375+
f"""
376+
INSERT INTO {catalog_name}.default.test_table_read_from_snapshots
377+
VALUES (CAST('2022-03-02' AS date), 3, 'c')
378+
"""
379+
)
380+
381+
spark.sql(
382+
f"""
383+
INSERT INTO {catalog_name}.default.test_table_read_from_snapshots
384+
VALUES (CAST('2022-03-02' AS date), 4, 'd')
385+
"""
386+
)

pyiceberg/manifest.py

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

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

0 commit comments

Comments
 (0)