I noticed that column type for timestamp in the parquet file generated by pandas.to_parquet can be different depending on the version of pandas, e.g.
In [1]: pd.__version__
Out[1]: '1.0.5'
In [2]: pd.DataFrame([pd.Timestamp('2020-01-01')], columns=['a']).to_parquet('/tmp/test.parquet')
In [3]: !parquet-tools schema /tmp/test.parquet
message schema {
optional int64 a (TIMESTAMP_MILLIS);
}
In [4]: !parquet-tools head /tmp/test.parquet
a = 1577836800000
In [1]: pd.__version__
Out[1]: '1.1.2'
In [2]: pd.DataFrame([pd.Timestamp('2020-01-01')], columns=['a']).to_parquet('/tmp/test.parquet')
In [3]: !parquet-tools schema /tmp/test.parquet
message schema {
optional int64 a (TIMESTAMP_MICROS);
}
In [4]: !parquet-tools head /tmp/test.parquet
a = 1577836800000000
As seen above, pandas-1.0.5 converts the type of timestamp to be TIMESTAMP_MILLIS while pandas-1.1.2 converts it to be TIMESTAMP_MICROS.
I'm using pandas-1.1.2, but I need the type to be TIMESTAMP_MILLIS for downstream consumption of the parquet file (queried by Presto), how can do that, please?
I'm using the pyarrow engine.