-
Notifications
You must be signed in to change notification settings - Fork 135
IGNITE-16962: SQL API: Implement query metadata #832
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
Conversation
# Conflicts: # modules/api/src/main/java/org/apache/ignite/sql/ColumnMetadata.java
# Conflicts: # modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/api/AsyncResultSetImpl.java
...er/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItSqlAsynchronousApiTest.java
Outdated
Show resolved
Hide resolved
modules/api/src/main/java/org/apache/ignite/sql/ColumnMetadata.java
Outdated
Show resolved
Hide resolved
modules/api/src/main/java/org/apache/ignite/sql/ColumnMetadata.java
Outdated
Show resolved
Hide resolved
...client-handler/src/main/java/org/apache/ignite/client/handler/JdbcQueryEventHandlerImpl.java
Outdated
Show resolved
Hide resolved
modules/api/src/main/java/org/apache/ignite/sql/ColumnMetadata.java
Outdated
Show resolved
Hide resolved
modules/api/src/main/java/org/apache/ignite/sql/async/AsyncResultSet.java
Show resolved
Hide resolved
| @Override | ||
| public ResultSetMetadata metadata() { | ||
| return List::of; | ||
| return ResultSetMetadataImpl.NO_METADATA; |
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.
let's introduce a constant for DDL meta with a single column of type Bool and name "Applied"
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.
DDL has no resultset.
Does it make sense to return any meta?
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.
DDL has no resultset
it's true for public API.
Please take a look at org.apache.ignite.internal.sql.engine.exec.ExecutionServiceImpl#executeDdl. There a single column response is returned for the every DDL operation. Next, this cursor will be wrapped with AsyncSqlCursor which enrich the data with results metadata. So, I would expect that AsyncSqlCursor opened for a DDL command will provide a valid meta for the result (it's currently an empty meta which is wrong).
But later, when AsyncSqlCursor will be wrapped with AsyncResultSet, the meta for DDL operation should be omitted.
The reasons why I assume this is the right way is described in this comment
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.
Got it, thanks.
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.
let's introduce a constant for DDL meta.
Seems, we can do the same with DML, isn't it?
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.
Yes, indeed
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.
Well, as I could see, it's already derived from a query plan... So, it's up to you to change this to predefined meta or leave it as is
No description provided.