Java Code Examples for org.apache.calcite.avatica.Meta#MetaResultSet
The following examples show how to use
org.apache.calcite.avatica.Meta#MetaResultSet .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LocalService.java From calcite-avatica with Apache License 2.0 | 6 votes |
public ExecuteResponse apply(ExecuteRequest request) { try (final Context ignore = executeTimer.start()) { try { final Meta.ExecuteResult executeResult = meta.execute(request.statementHandle, request.parameterValues, AvaticaUtils.toSaturatedInt(request.maxRowCount)); final List<ResultSetResponse> results = new ArrayList<>(executeResult.resultSets.size()); for (Meta.MetaResultSet metaResultSet : executeResult.resultSets) { results.add(toResponse(metaResultSet)); } return new ExecuteResponse(results, false, serverLevelRpcMetadata); } catch (NoSuchStatementException e) { return new ExecuteResponse(null, true, serverLevelRpcMetadata); } } }
Example 2
Source File: LocalService.java From calcite-avatica with Apache License 2.0 | 5 votes |
public ResultSetResponse apply(SchemasRequest request) { final Meta.ConnectionHandle ch = new Meta.ConnectionHandle(request.connectionId); final Meta.MetaResultSet resultSet = meta.getSchemas(ch, request.catalog, Meta.Pat.of(request.schemaPattern)); return toResponse(resultSet); }
Example 3
Source File: LocalService.java From calcite-avatica with Apache License 2.0 | 5 votes |
public ResultSetResponse apply(TablesRequest request) { final Meta.ConnectionHandle ch = new Meta.ConnectionHandle(request.connectionId); final Meta.MetaResultSet resultSet = meta.getTables(ch, request.catalog, Meta.Pat.of(request.schemaPattern), Meta.Pat.of(request.tableNamePattern), request.typeList); return toResponse(resultSet); }
Example 4
Source File: LocalService.java From calcite-avatica with Apache License 2.0 | 5 votes |
public ResultSetResponse apply(ColumnsRequest request) { final Meta.ConnectionHandle ch = new Meta.ConnectionHandle(request.connectionId); final Meta.MetaResultSet resultSet = meta.getColumns(ch, request.catalog, Meta.Pat.of(request.schemaPattern), Meta.Pat.of(request.tableNamePattern), Meta.Pat.of(request.columnNamePattern)); return toResponse(resultSet); }
Example 5
Source File: LocalService.java From calcite-avatica with Apache License 2.0 | 5 votes |
public ExecuteResponse apply(PrepareAndExecuteRequest request) { try (final Context ignore = prepareAndExecuteTimer.start()) { final Meta.StatementHandle sh = new Meta.StatementHandle(request.connectionId, request.statementId, null); try { final Meta.ExecuteResult executeResult = meta.prepareAndExecute(sh, request.sql, request.maxRowCount, request.maxRowsInFirstFrame, new Meta.PrepareCallback() { @Override public Object getMonitor() { return LocalService.class; } @Override public void clear() { } @Override public void assign(Meta.Signature signature, Meta.Frame firstFrame, long updateCount) { } @Override public void execute() { } }); final List<ResultSetResponse> results = new ArrayList<>(); for (Meta.MetaResultSet metaResultSet : executeResult.resultSets) { results.add(toResponse(metaResultSet)); } return new ExecuteResponse(results, false, serverLevelRpcMetadata); } catch (NoSuchStatementException e) { // The Statement doesn't exist anymore, bubble up this information return new ExecuteResponse(null, true, serverLevelRpcMetadata); } } }
Example 6
Source File: LocalService.java From calcite-avatica with Apache License 2.0 | 4 votes |
public ResultSetResponse apply(CatalogsRequest request) { final Meta.ConnectionHandle ch = new Meta.ConnectionHandle(request.connectionId); final Meta.MetaResultSet resultSet = meta.getCatalogs(ch); return toResponse(resultSet); }
Example 7
Source File: LocalService.java From calcite-avatica with Apache License 2.0 | 4 votes |
public ResultSetResponse apply(TableTypesRequest request) { final Meta.ConnectionHandle ch = new Meta.ConnectionHandle(request.connectionId); final Meta.MetaResultSet resultSet = meta.getTableTypes(ch); return toResponse(resultSet); }
Example 8
Source File: LocalService.java From calcite-avatica with Apache License 2.0 | 4 votes |
public ResultSetResponse apply(TypeInfoRequest request) { final Meta.ConnectionHandle ch = new Meta.ConnectionHandle(request.connectionId); final Meta.MetaResultSet resultSet = meta.getTypeInfo(ch); return toResponse(resultSet); }