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 342
342
(array(), map(), array(struct(1)))
343
343
"""
344
344
)
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 @@ -549,6 +549,17 @@ class ManifestFile(Record):
549
549
def __init__ (self , * data : Any , ** named_data : Any ) -> None :
550
550
super ().__init__ (* data , ** {"struct" : MANIFEST_LIST_FILE_STRUCTS [DEFAULT_READ_VERSION ], ** named_data })
551
551
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
+
552
563
def has_added_files (self ) -> bool :
553
564
return self .added_files_count is None or self .added_files_count > 0
554
565
You can’t perform that action at this time.
0 commit comments