diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/ConnectProcessor.java b/fe/fe-core/src/main/java/org/apache/doris/qe/ConnectProcessor.java index 91c5155813589ba..16813e5cf738ad3 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/ConnectProcessor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/ConnectProcessor.java @@ -59,20 +59,11 @@ import com.google.common.base.Preconditions; import com.google.common.base.Strings; -import com.google.protobuf.Any; -import com.google.protobuf.ByteString; import io.opentelemetry.api.trace.Span; import io.opentelemetry.api.trace.SpanKind; import io.opentelemetry.context.Context; import io.opentelemetry.context.Scope; import io.opentelemetry.context.propagation.TextMapGetter; -import org.apache.arrow.flight.CallStatus; -import org.apache.arrow.flight.FlightEndpoint; -import org.apache.arrow.flight.FlightInfo; -import org.apache.arrow.flight.Location; -import org.apache.arrow.flight.Ticket; -import org.apache.arrow.flight.sql.impl.FlightSql.TicketStatementQuery; -import org.apache.arrow.vector.types.pojo.Schema; import org.apache.commons.codec.digest.DigestUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -81,7 +72,6 @@ import java.io.StringReader; import java.nio.ByteBuffer; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -284,8 +274,11 @@ protected void handleQuery(MysqlCommand mysqlCommand, String originStmt) { } Preconditions.checkState(ctx.getFlightSqlChannel().resultNum() <= 1); if (ctx.getFlightSqlChannel().resultNum() == 1 && i != stmts.size() - 1) { - LOG.warn("There can only be one stmt that returns the result and it is at the end. stmts.size(): " + stmts.size()); - ctx.getState().setError(ErrorCode.ERR_ARROW_FLIGHT_SQL_MUST_ONLY_RESULT_STMT, "stmts.size(): " + stmts.size()); + LOG.warn( + "There can only be one stmt that returns the result and it is at the end. stmts.size(): " + + stmts.size()); + ctx.getState().setError(ErrorCode.ERR_ARROW_FLIGHT_SQL_MUST_ONLY_RESULT_STMT, + "stmts.size(): " + stmts.size()); ctx.getState().setErrType(QueryState.ErrType.OTHER_ERR); break; } diff --git a/fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/DorisFlightSqlProducer.java b/fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/DorisFlightSqlProducer.java index ee778308c640a29..54d686e5ff28757 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/DorisFlightSqlProducer.java +++ b/fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/DorisFlightSqlProducer.java @@ -31,7 +31,6 @@ import com.google.common.base.Preconditions; import com.google.protobuf.Any; import com.google.protobuf.ByteString; -import static com.google.protobuf.ByteString.copyFrom; import com.google.protobuf.Message; import static java.util.UUID.randomUUID; import org.apache.arrow.adapter.jdbc.JdbcToArrowUtils; @@ -143,8 +142,10 @@ public FlightInfo getFlightInfoStatement(final CommandStatementQuery request, fi flightSQLConnectProcessor.handleQuery(query); if (connectContext.getState().getStateType() == MysqlStateType.ERR) { - throw CallStatus.INTERNAL.withDescription("get flight info statement failed, error code: " + connectContext.getState().getErrorCode() + ", error msg: " - + connectContext.getState().getErrorMessage()).toRuntimeException(); + throw CallStatus.INTERNAL.withDescription( + "get flight info statement failed, error code: " + connectContext.getState().getErrorCode() + + ", error msg: " + + connectContext.getState().getErrorMessage()).toRuntimeException(); } if (connectContext.getFlightSqlChannel().resultNum() == 0) { String queryId = randomUUID().toString();