Skip to content

Commit 1039cda

Browse files
author
Tom McCormick
committed
improve
1 parent 19ad4ab commit 1039cda

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

dev/provision.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,3 +409,28 @@
409409
)
410410
spark.sql(f"ALTER TABLE {catalog_name}.default.test_empty_scan_ordered_str WRITE ORDERED BY id")
411411
spark.sql(f"INSERT INTO {catalog_name}.default.test_empty_scan_ordered_str VALUES 'a', 'c'")
412+
413+
spark.sql(
414+
f"""
415+
CREATE TABLE {catalog_name}.default.test_read_orc (
416+
dt date,
417+
ts timestamp,
418+
number integer,
419+
letter string
420+
)
421+
USING iceberg
422+
TBLPROPERTIES (
423+
'format-version'='2',
424+
'write.format.default'='orc'
425+
);
426+
"""
427+
)
428+
429+
spark.sql(f"""INSERT INTO {catalog_name}.default.test_read_orc
430+
VALUES
431+
(CAST('2022-03-01' AS date), CAST('2022-03-01 01:22:00' AS timestamp), 1, 'a'),
432+
(CAST('2022-03-02' AS date), CAST('2022-03-02 02:22:00' AS timestamp), 2, 'b'),
433+
(CAST('2022-03-03' AS date), CAST('2022-03-02 02:22:00' AS timestamp), 3, 'c')
434+
""")
435+
436+
spark.sql(f"DELETE FROM {catalog_name}.default.test_read_orc WHERE number = 3")

pyiceberg/io/pyarrow.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,8 +1437,7 @@ def _task_to_record_batches(
14371437
if task.file.file_format == FileFormat.PARQUET:
14381438
arrow_format = ds.ParquetFileFormat(pre_buffer=True, buffer_size=(ONE_MEGABYTE * 8))
14391439
elif task.file.file_format == FileFormat.ORC:
1440-
arrow_format = ds.OrcFileFormat()
1441-
# arrow_format = ds.OrcFileFormat(pre_buffer=True, buffer_size=(ONE_MEGABYTE * 8))
1440+
arrow_format = ds.OrcFileFormat() # currently ORC doesn't support any fragment scan options
14421441
else:
14431442
raise ValueError("Unsupported file format")
14441443
with io.new_input(task.file.file_path).open() as fin:

0 commit comments

Comments
 (0)