trinodb / trino-python-client

Python client for Trino
Apache License 2.0
309 stars 151 forks source link

Disable prepared statements by default #306

Closed damian3031 closed 2 months ago

damian3031 commented 1 year ago

Describe the feature

Disable prepared statements by default. Exact approach and details about implementation could be discussed in the comments.

Describe alternatives you've considered

No response

Are you willing to submit PR?

damian3031 commented 1 year ago

In this draft PR #310 3 possible approaches of handling this issue were presented. All of them were thoroughly discussed. As a result, we decided that the best approach is nr 3 - transporting prepared statement parameters in the JSON body instead of the headers. It will fix biggiest issue here - hitting header limit size by query. Query will be still parsed by SQL parser on Trino side, as opposed to approach nr 2.

Due to the low priority and high complexity of this issue, it is currently on hold.

aalbu commented 2 months ago

@hashhar, can we close this issue? Based on comments in the referenced PR, it seems like the the main problem it's attempting to address is the header size limitations for prepared statements. At this point, we have a way to avoid passing prepared statement parameters in the header, but specifying legacy_prepared_statements=False.

hashhar commented 2 months ago

Yes, I think this is no longer as relevant because of EXECUTE IMMEDIATE.

We can revisit if there's still interest in this.