File tree Expand file tree Collapse file tree 2 files changed +3
-14
lines changed
crates/integration_tests/testdata/pyiceberg Expand file tree Collapse file tree 2 files changed +3
-14
lines changed Original file line number Diff line number Diff line change 15
15
16
16
FROM python:3.9-bullseye
17
17
18
- RUN pip install pyiceberg[pyarrow]==0.8
18
+ RUN pip install pyiceberg[pyarrow]==0.8.1
19
19
20
20
COPY provision.py .
21
21
Original file line number Diff line number Diff line change 17
17
18
18
import os
19
19
from pyiceberg .catalog import load_catalog
20
- import pyarrow .parquet as pq
21
20
import pyarrow as pa
22
21
from datetime import datetime , timedelta
23
22
57
56
# Convert to a PyArrow table
58
57
table = pa .Table .from_arrays (columns , schema = schema )
59
58
60
- # Write to a Parquet file
61
- pq .write_table (table , "types_test.parquet" )
62
-
63
- # Output the result
64
- print (f"Created a Parquet file with { rows } rows and schema { table .schema } ." )
65
-
66
-
67
- # Load the Parquet file
68
- parquet_file = pq .read_table ("./types_test.parquet" )
69
-
70
59
# Connect to the REST catalog
71
60
catalog = load_catalog (
72
61
"rest" ,
82
71
# Create a corresponding Iceberg table and append the file to it
83
72
iceberg_table = catalog .create_table_if_not_exists (
84
73
identifier = f"default.types_test" ,
85
- schema = parquet_file . schema ,
74
+ schema = schema ,
86
75
)
87
- iceberg_table .append (df = parquet_file )
76
+ iceberg_table .append (table )
You can’t perform that action at this time.
0 commit comments