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 389
389
VALUES (4)
390
390
"""
391
391
)
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
+ )
Original file line number Diff line number Diff line change @@ -551,6 +551,17 @@ class ManifestFile(Record):
551
551
def __init__ (self , * data : Any , ** named_data : Any ) -> None :
552
552
super ().__init__ (* data , ** {"struct" : MANIFEST_LIST_FILE_STRUCTS [DEFAULT_READ_VERSION ], ** named_data })
553
553
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
+
554
565
def has_added_files (self ) -> bool :
555
566
return self .added_files_count is None or self .added_files_count > 0
556
567
You can’t perform that action at this time.
0 commit comments