Skip to content
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

Closed
wants to merge 7 commits into from

Conversation

stevelorddremio
Copy link
Owner

No description provided.

Copy link

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?

GH-${GITHUB_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}

or

MINOR: [${COMPONENT}] ${SUMMARY}

In the case of PARQUET issues on JIRA the title also supports:

PARQUET-${JIRA_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}

See also:

@stevelorddremio stevelorddremio changed the title GH 37720 GH 37720:[Java][FlightSQL] Implement stateless prepared statement - DRAFT Mar 18, 2024
Copy link

@jduo jduo left a 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();
Copy link

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?

Copy link
Owner Author

@stevelorddremio stevelorddremio Mar 19, 2024

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?

Copy link

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.

Copy link
Owner Author

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.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


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();
Copy link

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?

Copy link
Owner Author

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.

@stevelorddremio stevelorddremio marked this pull request as draft March 19, 2024 21:53
@stevelorddremio stevelorddremio changed the title GH 37720:[Java][FlightSQL] Implement stateless prepared statement - DRAFT GH 37720:[Java][FlightSQL] Implement stateless prepared statement Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants