morningman opened a new issue, #67368:
URL: https://github.com/apache/doris/issues/67368

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   ### Version
   
   Apache Doris 4.1.3-rc02, commit `31263df4dc1d4d3a27517d264802cd4d6b92c874`
   
   Client: Python + ADBC Flight SQL driver (`adbc_driver_flightsql`), FE 
`arrow_flight_sql_port` = 41070.
   The MySQL/JDBC protocol is used as the control path for comparison.
   
   ### What's Wrong?
   
   A `UNIQUE KEY` point query that qualifies for the point-query short-circuit 
path returns no Flight endpoint when executed over Python ADBC Flight SQL. The 
client fails with:
   
   ```
   fetch arrow flight schema failed, no FlightSqlEndpointsLocations
   ```
   
   The identical query with `SET_VAR(enable_short_circuit_query=false)` returns 
the full row over the same ADBC connection.
   
   ### What You Expected?
   
   With the point-query short circuit enabled, Flight SQL should return an 
endpoint and the query result, just like the normal execution path does.
   
   ### How to Reproduce?
   
   1. Create the `UNIQUE KEY` table below and insert one row.
   2. Run the default point query over Python ADBC; it fails with the 
no-endpoint error.
   3. Run the same point query with the short circuit disabled on the same ADBC 
connection; the row is returned.
   
   ```sql
   DROP TABLE IF EXISTS table_3821461;
   CREATE TABLE table_3821461 (
     col1 SMALLINT NOT NULL,
     col2 INT NOT NULL,
     loc3 CHAR(10) NOT NULL,
     value CHAR(10) NOT NULL,
     INDEX col3 (loc3) USING INVERTED,
     INDEX col2_idx (col2) USING INVERTED
   ) ENGINE=OLAP
   UNIQUE KEY(col1,col2,loc3)
   DISTRIBUTED BY HASH(col1,col2,loc3) BUCKETS 1
   PROPERTIES (
     "replication_allocation"="tag.location.default: 1",
     "disable_auto_compaction"="true",
     "bloom_filter_columns"="col1",
     "store_row_column"="true",
     "enable_mow_light_delete"="false"
   );
   INSERT INTO table_3821461 VALUES (10,20,'aabc','value');
   
   -- Fails through Arrow Flight SQL.
   SELECT * FROM table_3821461
   WHERE col1=10 AND col2=20 AND loc3='aabc';
   
   -- Succeeds through Arrow Flight SQL.
   SELECT /*+ SET_VAR(enable_short_circuit_query=false) */ *
   FROM table_3821461
   WHERE col1=10 AND col2=20 AND loc3='aabc';
   ```
   
   Client side:
   
   ```python
   import adbc_driver_flightsql.dbapi as flight_sql
   
   conn = flight_sql.connect(uri="grpc://127.0.0.1:41070",
                             db_kwargs={"username": "root", "password": ""})
   cur = conn.cursor()
   cur.execute("SELECT * FROM table_3821461 WHERE col1=10 AND col2=20 AND 
loc3='aabc'")
   cur.fetch_arrow_table()
   ```
   
   ### Anything Else?
   
   The short-circuit point query does not go through the normal 
coordinator/result-sink path, so no Flight endpoint location is ever registered 
for the query; the Flight SQL path appears not to be wired into that execution 
mode at all.
   
   **Workaround:** set `enable_short_circuit_query=false` for the query. This 
is only a diagnostic/temporary workaround; it should not be applied silently by 
clients, since it changes the execution plan.
   
   The table above is taken from the public `point_query_p0/test_point_query` 
regression suite, and the A/B comparison was confirmed on the same table and 
the same connection.
   
   Tracking issue: #65615
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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]

Reply via email to