If my table has timestamp fields with ns resolution and I save the table to
parquet format without specifying any timestamp args (default coerce and
legacy settings) then it automatically converts my timestamp to us
resolution.
As best I can tell Parquet supports ns resolution so I would prefer it just
keep that. Is there some argument I can pass to write_table to get my
desired resolution?
Here is an example program:
import pyarrow as pa
import pyarrow.parquet as pq
table = pa.table({'mytimestamp': []}, schema=pa.schema({'mytimestamp':
pa.timestamp('ns')}))
pq.write_table(table, '/tmp/foo.parquet')
table2 = pq.read_table('/tmp/foo.parquet')
print(table.schema.field('mytimestamp').type)
# timestamp[ns]
print(table2.schema.field('mytimestamp').type)
# timestamp[us]