This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "statement": "SELECT * FROM MYTABLE", | |
| "resultSetMetaData": { | |
| "format": "arrowv1" | |
| }, | |
| "timeout": 60, | |
| "database": "MYDATABASE", | |
| "schema": "MYSCHEMA", | |
| "warehouse": "MYWAREHOUSE", | |
| "role": "MYROLE" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from pyiceberg.catalog import load_catalog | |
| from pyiceberg.schema import Schema, NestedField | |
| from pyiceberg.types import ( | |
| StringType, | |
| LongType, | |
| TimestampType | |
| ) | |
| # Create the catalog connection |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pyarrow as pa | |
| from pyarrow import Table as ArrowTable | |
| def convert_dataframe_timestamps(data: ArrowTable) -> ArrowTable: | |
| """Convert timestamp columns to Iceberg-compatible timestamp format. | |
| This function processes a PyArrow table and converts timestamp columns to be compatible | |
| with Apache Iceberg specifications by: | |
| 1. Converting nanosecond precision timestamps to microsecond precision | |
| 2. Standardizing timezone-aware timestamps to UTC |