Skip to content

Commit 3797e9e

Browse files
committed
Refactor inheritance relationship
support incremental append scan support incremental append scan
1 parent a110368 commit 3797e9e

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
@@ -549,6 +549,17 @@ class ManifestFile(Record):
549549
def __init__(self, *data: Any, **named_data: Any) -> None:
550550
super().__init__(*data, **{"struct": MANIFEST_LIST_FILE_STRUCTS[DEFAULT_READ_VERSION], **named_data})
551551

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

0 commit comments

Comments
 (0)