pzhdfy commented on code in PR #68988:
URL: https://github.com/apache/doris/pull/68988#discussion_r4321196066


##########
be/src/format_v2/table/paimon_rust_table_reader.cpp:
##########
@@ -804,6 +1308,13 @@ std::vector<std::string> 
PaimonRustTableReader::_build_read_columns() const {
         if (column.is_partition_key) {
             continue;
         }
+        // The PK-vector search distance is reader-produced and auto-appended 
by
+        // paimon-rust under its own field name; it is never a projectable 
table
+        // column, so exclude it from the projection in every mode (in 
non-vector
+        // mode it is simply absent).
+        if (column.name == kPaimonSearchDistanceColumn) {

Review Comment:
    Confirmed — _build_read_columns is shared by every mode and skipped the 
name unconditionally, so SELECT id, __paimon_search_score_to_dis on a 
compatible ordinary rust scan would drop the real column and NULL-fill it. Now 
skipped only in vector mode (_is_vector_mode), where it really is the 
reader-produced synthetic slot; and the rewrite declines when the table itself 
has a column of that name so the synthetic slot never collides with a real one. 
BE UT (OrdinaryScanKeepsSyntheticDistanceNamedColumn) and a rewrite UT cover 
both halves.



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