-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GH 37720:[Java][FlightSQL] Implement stateless prepared statement #1
Conversation
…ents Part fixed caching of statementContext
Thanks for opening a pull request! If this is not a minor PR. Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project. Then could you also rename the pull request title in the following format?
or
In the case of PARQUET issues on JIRA the title also supports:
See also: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need proper test cases
SyncPutListener putListener = putParameters(descriptor, options); | ||
|
||
try { | ||
final PutResult read = putListener.read(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to do this even in the case where no parameters were returned?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On re-reading this, I'm not sure I understand your comment.
If no parameters are returned but parameters were set in parameterBindingRoot then it would be an error condition. The only way I can see we know if any parameters are returned from putParameters is if we read putListener. Did I miss something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking we shouldn't do parameter binding (line 1059) if we already got the parameter schema and it was empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I can check for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
java/flight/flight-sql/src/main/java/org/apache/arrow/flight/sql/FlightSqlClient.java
Show resolved
Hide resolved
java/flight/flight-sql/src/test/java/org/apache/arrow/flight/sql/example/FlightSqlExample.java
Outdated
Show resolved
Hide resolved
|
||
try { | ||
while (flightStream.next()) { | ||
final VectorSchemaRoot root = flightStream.getRoot(); | ||
final JdbcParameterBinder binder = JdbcParameterBinder.builder(preparedStatement, root).bindAll().build(); | ||
binder = JdbcParameterBinder.builder(preparedStatement, root).bindAll().build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are we dealing with old clients that don't yet support stateless prepared statements?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the server already supports stateful prepared statements, the parameters would continue to be cached on the server using the original handle. So old clients would continue to work. If the server stopped supporting stateful prepared statements, it would mean the client would need to be updated.
No description provided.