Skip to content

Conversation

@dudub12
Copy link

@dudub12 dudub12 commented Aug 2, 2023

Will my attempt to integrate with LangChain and Trino using this library, I countered the following exception:

sqlalchemy.exc.CompileError: (in table 'MY_TABLE', column 'SOME_COLUMN'): Compiler <trino.sqlalchemy.compiler.TrinoTypeCompiler object at 0x110fb7d30> can't render element of type MAP

AttributeError: 'TrinoTypeCompiler' object has no attribute 'visit_MAP'

After some research, I found out that TrinoTypeCompiler doesn't support MAP data type.
I have edited the compiler so it will support visit_MAP function and it worked on my local machine.

Fixes #397

@cla-bot
Copy link

cla-bot bot commented Aug 2, 2023

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

@hashhar
Copy link
Member

hashhar commented Aug 3, 2023

Please add a test where you create a table with MAP type and try to do some operation via SQLAlchemy which fails without your change.

@hashhar
Copy link
Member

hashhar commented Sep 15, 2023

@dudub12 Can you please add a test? This is ready to be merged otherwise.

@hashhar
Copy link
Member

hashhar commented Feb 3, 2024

Superseded by #448

Thanks for showing the way @dudub12

@hashhar hashhar closed this Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Add support for MAP type to SQLAlchemy dialect

3 participants