File tree Expand file tree Collapse file tree 4 files changed +443
-38
lines changed Expand file tree Collapse file tree 4 files changed +443
-38
lines changed Original file line number Diff line number Diff line change 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+ )
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments