use of org.apache.ignite.internal.sql.engine.ResultSetMetadata in project ignite-3 by apache.
the class JdbcQueryEventHandlerImpl method queryMetadataAsync.
/**
* {@inheritDoc}
*/
@Override
public CompletableFuture<JdbcMetaColumnsResult> queryMetadataAsync(JdbcQueryMetadataRequest req) {
SqlCursor<List<?>> cur = openCursors.get(req.cursorId());
if (cur == null) {
return CompletableFuture.completedFuture(new JdbcMetaColumnsResult(Response.STATUS_FAILED, "Failed to find query cursor with ID: " + req.cursorId()));
}
ResultSetMetadata metadata = cur.metadata();
if (metadata == null) {
return CompletableFuture.completedFuture(new JdbcMetaColumnsResult(Response.STATUS_FAILED, "Failed to get query metadata for cursor with ID : " + req.cursorId()));
}
List<JdbcColumnMeta> meta = metadata.fields().stream().map(this::createColumnMetadata).collect(Collectors.toList());
return CompletableFuture.completedFuture(new JdbcMetaColumnsResult(meta));
}
Aggregations