@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasSqlQuery()) { hash = (37 * hash) + SQL_QUERY_FIELD_NUMBER; hash = (53 * hash) + getSqlQuery().hashCode(); } if (hasHandle()) { hash = (37 * hash) + HANDLE_FIELD_NUMBER; hash = (53 * hash) + hashLong(getHandle()); } if (hasPrepareId()) { hash = (37 * hash) + PREPARE_ID_FIELD_NUMBER; hash = (53 * hash) + getPrepareId().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; }
private static String getSql(final RunQuery q) { if(q.getType() == QueryType.PREPARED_STATEMENT){ try{ final ServerPreparedStatementState preparedStatement = ServerPreparedStatementState.PARSER.parseFrom(q.getPreparedStatementHandle().getServerInfo()); return preparedStatement.getSqlQuery(); }catch(Exception ex){ throw UserException.connectionError(ex).message("Prepared statement provided is corrupt.").build(logger); } } else { return q.getPlan(); } }
Preconditions.checkArgument(plan.getQuery().equals(preparedStatement.getSqlQuery()), "Prepared statement's sql query doesn't match what sent when prepared statement was created."); if(plan.getUsername() != null){ return getSqlCommand(preparedStatement.getSqlQuery(), false);
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.dremio.exec.proto.ExecProtos.ServerPreparedStatementState)) { return super.equals(obj); } com.dremio.exec.proto.ExecProtos.ServerPreparedStatementState other = (com.dremio.exec.proto.ExecProtos.ServerPreparedStatementState) obj; boolean result = true; result = result && (hasSqlQuery() == other.hasSqlQuery()); if (hasSqlQuery()) { result = result && getSqlQuery() .equals(other.getSqlQuery()); } result = result && (hasHandle() == other.hasHandle()); if (hasHandle()) { result = result && (getHandle() == other.getHandle()); } result = result && (hasPrepareId() == other.hasPrepareId()); if (hasPrepareId()) { result = result && getPrepareId() .equals(other.getPrepareId()); } result = result && getUnknownFields().equals(other.getUnknownFields()); return result; }
public void writeTo(io.protostuff.Output output, com.dremio.exec.proto.ExecProtos.ServerPreparedStatementState message) throws java.io.IOException { if(message.hasSqlQuery()) output.writeString(1, message.getSqlQuery(), false); if(message.hasHandle()) output.writeInt64(2, message.getHandle(), false); if(message.hasPrepareId()) output.writeObject(3, message.getPrepareId(), com.dremio.exec.proto.SchemaUserBitShared.QueryId.WRITE, false); } public boolean isInitialized(com.dremio.exec.proto.ExecProtos.ServerPreparedStatementState message)
/** * <code>optional string sql_query = 1;</code> */ public Builder clearSqlQuery() { bitField0_ = (bitField0_ & ~0x00000001); sqlQuery_ = getDefaultInstance().getSqlQuery(); onChanged(); return this; } /**