-
Notifications
You must be signed in to change notification settings - Fork 547
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
Get ResultSet meta data before execution #1434
base: main
Are you sure you want to change the base?
Conversation
public void testGetMetaData() throws SQLException { | ||
try (Connection conn = newConnection(new Properties()); | ||
PreparedStatement ps = conn.prepareStatement("select ? a, ? b")) { | ||
ResultSetMetaData md = ps.getMetaData(); |
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.
What happens if we pass DDL (e.g. CREATE TABLE) to conn.prepareStatement
? It would be nice to add a test in my opinion.
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.
Thanks for taking your time to review the PR!
What happens if we pass DDL (e.g. CREATE TABLE) to conn.prepareStatement?
null
will be returned at this point. Below is the check in SqlBasedPreparedStatement.java
. However, in ClickHouse, create table on cluster will actually return ResultSet, but I guess we don't need that as it's not helping for push-down implementation.
if (parsedStmt.isRecognized() && !parsedStmt.isQuery()) {
return null;
}
It would be nice to add a test in my opinion.
Yes, the implementation is incomplete and I'll add more tests for sure.
Hi, any plans to complete this PR? |
JFYI #1700 |
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 2 weeks if no further activity occurs. Please feel free to give a status update or ping for review. Thank you for your contributions! |
Summary
Get ResultSet meta data before execution
Checklist
Delete items not relevant to your PR: