github-actions[bot] commented on code in PR #67487: URL: https://github.com/apache/doris/pull/67487#discussion_r3923623150
########## regression-test/suites/arrow_flight_sql_p0/test_point_query_over_arrow_flight.groovy: ########## @@ -0,0 +1,131 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import org.apache.doris.regression.util.JdbcUtils + +// Regression for https://github.com/apache/doris/issues/67368 +// +// A UNIQUE KEY point query that matches the short circuit is executed by PointQueryExecutor instead of +// a Coordinator, and neither end of that path can serve an Arrow Flight result: +// +// * Coordinator and NereidsCoordinator are the only places that register a FlightSqlEndpointsLocation, +// so GetFlightInfo found no endpoint and failed with +// "fetch arrow flight schema failed, no FlightSqlEndpointsLocations", dropping the row. +// * The BE could not be pointed at either. tablet_fetch_data serializes with VMysqlResultWriter into +// PTabletKeyLookupResponse.row_batch and runs no fragment, so the ArrowFlightResultBlockBuffer that +// fetch_arrow_flight_schema looks up by finst id never exists. +// +// The fix keeps Arrow Flight SQL connections on the normal execution path, decided at plan time in +// LogicalResultSinkToShortCircuitPointQuery. The table below is the one from the issue. +suite("test_point_query_over_arrow_flight") { + def mysqlConn = context.getConn() + def flightConn = context.getArrowFlightSqlConnection() + + def runOnMysql = { String stmt -> + def (result, meta) = JdbcUtils.executeToList(mysqlConn, stmt) + return result + } + def runOnFlight = { String stmt -> + def (result, meta) = JdbcUtils.executeToList(flightConn, stmt) + return result + } + // The suite level explain{} action always runs on the MySQL connection, but the whole point here is + // which protocol asked for the plan, so read the explain text off each connection explicitly. + def explainOn = { conn, String stmt -> + def (rows, meta) = JdbcUtils.executeToList(conn, "explain " + stmt) + return rows.collect { row -> row.get(0).toString() }.join("\n") + } + + def dbName = context.dbName + runOnMysql "USE `${dbName}`" + runOnFlight "USE `${dbName}`" + + def tblName = "test_point_query_over_arrow_flight_tbl" Review Comment: The root regression-test rules require ordinary single-table cases to hardcode the table name and to drop only before use so the post-run state remains available for debugging. Please inline `test_point_query_over_arrow_flight_tbl` in these statements and remove the trailing `DROP TABLE` at line 130, keeping only the pre-test cleanup. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
