return super.execute2(cursor, columnMetaDataList);
@Override protected DrillResultSetImpl execute() throws SQLException{ connection.getDriver().handler.onStatementExecute(statement, null); if (signature.cursorFactory != null) { // Avatica accessors have to be wrapped to match Drill behaviour regarding exception thrown super.execute(); List<Accessor> wrappedAccessorList = new ArrayList<>(accessorList.size()); for(Accessor accessor: accessorList) { wrappedAccessorList.add(new WrappedAccessor(accessor)); } this.accessorList = wrappedAccessorList; } else { DrillCursor drillCursor = new DrillCursor(connection, statement, signature); //Getting handle to elapsed timer for timeout purposes this.elapsedTimer = drillCursor.getElapsedTimer(); //Setting this to ensure future calls to change timeouts for an active Statement doesn't affect ResultSet this.queryTimeoutInMilliseconds = drillCursor.getTimeoutInMilliseconds(); super.execute2(drillCursor, this.signature.columns); // Read first (schema-only) batch to initialize result-set metadata from // (initial) schema before Statement.execute...(...) returns result set: drillCursor.loadInitialSchema(); } return this; } }
@Override protected DrillResultSetImpl execute() throws SQLException{ connection.getDriver().handler.onStatementExecute(statement, null); if (signature.cursorFactory != null) { // Avatica accessors have to be wrapped to match Drill behaviour regarding exception thrown super.execute(); List<Accessor> wrappedAccessorList = new ArrayList<>(accessorList.size()); for(Accessor accessor: accessorList) { wrappedAccessorList.add(new WrappedAccessor(accessor)); } this.accessorList = wrappedAccessorList; } else { DrillCursor drillCursor = new DrillCursor(connection, statement, signature); //Getting handle to elapsed timer for timeout purposes this.elapsedTimer = drillCursor.getElapsedTimer(); //Setting this to ensure future calls to change timeouts for an active Statement doesn't affect ResultSet this.queryTimeoutInMilliseconds = drillCursor.getTimeoutInMilliseconds(); super.execute2(drillCursor, this.signature.columns); // Read first (schema-only) batch to initialize result-set metadata from // (initial) schema before Statement.execute...(...) returns result set: drillCursor.loadInitialSchema(); } return this; } }
@Override protected DremioResultSetImpl execute() throws SQLException{ connection.getDriver().handler.onStatementExecute(statement, null); if (signature.cursorFactory != null) { // Avatica accessors have to be wrapped to match Dremio behaviour regarding exception thrown super.execute(); } else { DremioCursor cursor = new DremioCursor(connection, statement, signature); super.execute2(cursor, this.signature.columns); // Read first (schema-only) batch to initialize result-set metadata from // (initial) schema before Statement.execute...(...) returns result set: cursor.loadInitialSchema(); } return this; }
@Override public ResultSet create(AvaticaType elementType, Iterable<Object> elements) throws SQLException { // The ColumnMetaData for offset "1" in the ResultSet for an Array. ScalarType arrayOffsetType = ColumnMetaData.scalar(Types.INTEGER, "INTEGER", Rep.PRIMITIVE_INT); // Two columns (types) in the ResultSet we will create List<ColumnMetaData> types = Arrays.asList(ColumnMetaData.dummy(arrayOffsetType, false), ColumnMetaData.dummy(elementType, true)); List<List<Object>> rows = createResultSetRowsForArrayData(elements); // `(List<Object>) rows` is a compile error. @SuppressWarnings({ "unchecked", "rawtypes" }) List<Object> untypedRows = (List<Object>) ((List) rows); try (ListIteratorCursor cursor = new ListIteratorCursor(rows.iterator())) { final String sql = "MOCKED"; QueryState state = new QueryState(sql); Meta.Signature signature = new Meta.Signature(types, sql, Collections.<AvaticaParameter>emptyList(), Collections.<String, Object>emptyMap(), Meta.CursorFactory.LIST, Meta.StatementType.SELECT); AvaticaResultSetMetaData resultSetMetaData = new AvaticaResultSetMetaData(null, sql, signature); Meta.Frame frame = new Meta.Frame(0, true, untypedRows); AvaticaResultSet resultSet = new AvaticaResultSet(null, state, signature, resultSetMetaData, timeZone, frame); resultSet.execute2(cursor, types); return resultSet; } }
@Override public ResultSet create(AvaticaType elementType, Iterable<Object> elements) throws SQLException { // The ColumnMetaData for offset "1" in the ResultSet for an Array. ScalarType arrayOffsetType = ColumnMetaData.scalar(Types.INTEGER, "INTEGER", Rep.PRIMITIVE_INT); // Two columns (types) in the ResultSet we will create List<ColumnMetaData> types = Arrays.asList(ColumnMetaData.dummy(arrayOffsetType, false), ColumnMetaData.dummy(elementType, true)); List<List<Object>> rows = createResultSetRowsForArrayData(elements); // `(List<Object>) rows` is a compile error. @SuppressWarnings({ "unchecked", "rawtypes" }) List<Object> untypedRows = (List<Object>) ((List) rows); try (ListIteratorCursor cursor = new ListIteratorCursor(rows.iterator())) { final String sql = "MOCKED"; QueryState state = new QueryState(sql); Meta.Signature signature = new Meta.Signature(types, sql, Collections.<AvaticaParameter>emptyList(), Collections.<String, Object>emptyMap(), Meta.CursorFactory.LIST, Meta.StatementType.SELECT); AvaticaResultSetMetaData resultSetMetaData = new AvaticaResultSetMetaData(null, sql, signature); Meta.Frame frame = new Meta.Frame(0, true, untypedRows); AvaticaResultSet resultSet = new AvaticaResultSet(null, state, signature, resultSetMetaData, timeZone, frame); resultSet.execute2(cursor, types); return resultSet; } }