Skip to content

Commit fe9a80b

Browse files
damian3031hashhar
authored andcommitted
Add Trino - Python types mapping
1 parent 61b8133 commit fe9a80b

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,30 @@ assert rows[0][0] == "-2001-08-22"
466466
assert cur.description[0][1] == "date"
467467
```
468468

469+
### Trino to Python type mappings
470+
471+
| Trino type | Python type |
472+
|------------|-------------------|
473+
| BOOLEAN | bool |
474+
| TINYINT | int |
475+
| SMALLINT | int |
476+
| INTEGER | int |
477+
| BIGINT | int |
478+
| REAL | float |
479+
| DOUBLE | float |
480+
| DECIMAL | decimal.Decimal |
481+
| VARCHAR | str |
482+
| CHAR | str |
483+
| VARBINARY | bytes |
484+
| DATE | datetime.date |
485+
| TIME | datetime.time |
486+
| TIMESTAMP | datetime.datetime |
487+
| ARRAY | list |
488+
| MAP | dict |
489+
| ROW | tuple |
490+
491+
Trino types other than those listed above are not mapped to Python types. To use those use [legacy primitive types](#legacy-primitive-types).
492+
469493
# Need help?
470494

471495
Feel free to create an issue as it makes your request visible to other users and contributors.

0 commit comments

Comments
 (0)