/** * <code>optional .exec.user.PreparedStatement prepared_statement = 2;</code> */ public Builder mergePreparedStatement(com.dremio.exec.proto.UserProtos.PreparedStatement value) { if (preparedStatementBuilder_ == null) { if (((bitField0_ & 0x00000002) == 0x00000002) && preparedStatement_ != com.dremio.exec.proto.UserProtos.PreparedStatement.getDefaultInstance()) { preparedStatement_ = com.dremio.exec.proto.UserProtos.PreparedStatement.newBuilder(preparedStatement_).mergeFrom(value).buildPartial(); } else { preparedStatement_ = value; } onChanged(); } else { preparedStatementBuilder_.mergeFrom(value); } bitField0_ |= 0x00000002; return this; } /**
public void mergeFrom(io.protostuff.Input input, com.dremio.exec.proto.UserProtos.CreatePreparedStatementResp.Builder builder) throws java.io.IOException { for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this)) { switch(number) { case 0: return; case 1: builder.setStatus(com.dremio.exec.proto.UserProtos.RequestStatus.valueOf(input.readEnum())); break; case 2: builder.setPreparedStatement(input.mergeObject(com.dremio.exec.proto.UserProtos.PreparedStatement.newBuilder(), com.dremio.exec.proto.SchemaUserProtos.PreparedStatement.MERGE)); break; case 3: builder.setError(input.mergeObject(com.dremio.exec.proto.UserBitShared.DremioPBError.newBuilder(), com.dremio.exec.proto.SchemaUserBitShared.DremioPBError.MERGE)); break; case 13: builder.setQueryId(input.mergeObject(com.dremio.exec.proto.UserBitShared.QueryId.newBuilder(), com.dremio.exec.proto.SchemaUserBitShared.QueryId.MERGE)); break; default: input.handleUnknownField(number, this); } } } public boolean isInitialized(com.dremio.exec.proto.UserProtos.CreatePreparedStatementResp.Builder builder)
@Test public void invalidPrepareHandle() throws Exception { final ServerPreparedStatementState state = ServerPreparedStatementState.newBuilder() .setHandle(-23) // Handles start from 0 in the sever. This is relying on server implementation detail. May need to find a better way to test it. .setSqlQuery("SELECT sales_city, count(*) as cnt FROM cp.\"region.json\" " + "GROUP BY sales_city ORDER BY sales_city DESC LIMIT 2") .setPrepareId(QueryId.newBuilder().build()) .build(); PreparedStatement preparedStatement = PreparedStatement.newBuilder() .setServerHandle(PreparedStatementHandle.newBuilder().setServerInfo(state.toByteString()).build()) .build(); testBuilder() .unOrdered() .preparedStatement(preparedStatement.getServerHandle()) .baselineColumns("sales_city", "cnt") .baselineValues("Yakima", 1L) .baselineValues("Woodland Hills", 1L) .go(); }
public Builder toBuilder() { return newBuilder(this); }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(com.dremio.exec.proto.UserProtos.PreparedStatement prototype) {
public static CreatePreparedStatementResp build(BatchSchema schema, ServerPreparedStatementState handle, QueryId queryId, String catalogName) { final CreatePreparedStatementResp.Builder respBuilder = CreatePreparedStatementResp.newBuilder(); final PreparedStatement.Builder prepStmtBuilder = PreparedStatement.newBuilder(); prepStmtBuilder.setServerHandle(PreparedStatementHandle.newBuilder().setServerInfo(handle.toByteString())); for (Field field : schema) { prepStmtBuilder.addColumns(serializeColumn(field, catalogName)); } respBuilder.setStatus(RequestStatus.OK); respBuilder.setPreparedStatement(prepStmtBuilder.build()); respBuilder.setQueryId(queryId); return respBuilder.build(); }
public static Builder newBuilder(com.dremio.exec.proto.UserProtos.PreparedStatement prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); }
public com.dremio.exec.proto.UserProtos.PreparedStatement.Builder newMessage() { return com.dremio.exec.proto.UserProtos.PreparedStatement.newBuilder(); } public java.lang.String getFieldName(int number)