codename-hub / php-parquet

PHP implementation for reading and writing Apache Parquet files/streams
Other
58 stars 8 forks source link

Schema DataFiled type 'timestamp' #17

Closed weasel2k closed 1 year ago

weasel2k commented 1 year ago

Is there anything I can do for creating parquet file that will be used in time related queries. It seems Timestamp is not available?

Not a major issue but also bigint?

Katalystical commented 1 year ago

What about using DateTimeDataField? You can also fall back to using Longs/Ints if you're aiming for pure Unix Timestamp-ish ones. Internally, its stored as milli/microseconds, depending on what you define. BigInt/arbitrary precision/length depends a little bit, its the Decimal type you're probably looking for.

weasel2k commented 1 year ago

Thank you for response, appreciated

$schema = new Schema([ DataField::createFromType('makerid', 'string'), DataField::createFromType('coresymbol', 'string'), DataField::createFromType('timerecorded', 'DateTime'), ]);

resulted in PHP type/class 'DateTime' is not supported, please specify one of 'object, string, boolean, string, , , , , , integer, , integer, double, double, string, array, , , ' or use an alternative constructor/static creation method

Is the supported data types listed in documentation?

Katalystical commented 1 year ago

As I mentioned, use DateTimeDataField.