trinodb / trinodb/trino-python-client

Add ability to return MAP type columns with ARRAY, MAP or ROW keys

Open
#442 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
439
Forks
206
PR merge metrics
No merged PRs in 30d

Description

Describe the feature

Today the Python client fails with an error when returning MAP columns with ARRAY, MAP or ROW keys.

See the tests added in https://github.com/trinodb/trino-python-client/pull/441 for the behavior.

Describe alternatives you've considered

Using legacy_primitive_types=True is able to return the data but in a non-standard format and requires user to reverse-engineer how Trino serialized the column.

Note that the JDBC driver doesn't work with such columns either at the moment.

Are you willing to submit PR?
  • Yes I am willing to submit a PR!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the behavior tests added in trinodb/trino-python-client pull request 441, then trace the Python client's handling of MAP, ARRAY, and ROW column values. Reproduce the failure with MAP columns using complex keys and compare it with legacy_primitive_types=True. Done means these columns return standard Python values without requiring callers to reverse-engineer Trino's serialization.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
databases
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.