`presto-types-parser` is a small Python library designed to parse and convert input rows returned by the Presto REST API according to their specified Presto data types. It ensures that data structures like arrays, maps, and rows, as well as primitive types, are correctly interpreted into Python equivalents. The current version is 0.0.2, and it appears to have a very slow release cadence with only one public release.
pip install presto-types-parserVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to parse a list of Presto-style rows using a corresponding list of Presto type strings. The function converts the raw input into native Python types based on the schema.
Thoroughly validate the structure of `rows` (list of lists) and `types` (list of Presto type strings) against your Presto query's output schema before passing them to the parser.
For complex types, test with simpler inputs first. Break down nested structures to identify the exact point of failure. Ensure JSON strings within `JSON` types are valid.