trino-python-client icon indicating copy to clipboard operation
trino-python-client copied to clipboard

Disable prepared statements by default

Open damian3031 opened this issue 1 year ago • 1 comments

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?

  • [X] Yes I am willing to submit a PR!

damian3031 avatar Dec 22 '22 11:12 damian3031

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.

damian3031 avatar Jan 19 '23 13:01 damian3031

@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.

aalbu avatar Apr 10 '24 11:04 aalbu

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

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

hashhar avatar Apr 15 '24 08:04 hashhar