zhangstar333 commented on code in PR #67289:
URL: https://github.com/apache/doris/pull/67289#discussion_r3964364332
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PushDownFilterThroughVectorSearchTopN.java:
##########
@@ -23,33 +23,35 @@
import org.apache.doris.nereids.trees.plans.logical.LogicalFilter;
import org.apache.doris.nereids.trees.plans.logical.LogicalTVFRelation;
import org.apache.doris.nereids.trees.plans.logical.LogicalTopN;
+import org.apache.doris.tablefunction.FullTextSearchTableValuedFunction;
import org.apache.doris.tablefunction.VectorSearchTableValuedFunction;
/**
- * Move an outer vector_search WHERE predicate below its Doris merge TopN.
+ * Move an outer Lance external-search WHERE predicate below its Doris merge
TopN.
*
- * <p>The TopN immediately above a vector_search TVF is added by {@code
BindExpression} to merge
+ * <p>The TopN immediately above a search TVF is added by {@code
BindExpression} to merge
* the candidates returned by all Lance fragment scans. The SQL WHERE
predicate must therefore be
* evaluated below this TopN so it can become a residual conjunct on the Doris
Lance scan node:
*
* <pre>
* Filter TopN
* TopN -> Filter
- * vector_search vector_search
+ * search TVF search TVF
* </pre>
*
- * <p>This remains a postfilter relative to Lance nearest(): every fragment
first returns its ANN
- * candidates, and Doris filters those candidates before the local/global
TopN. It is deliberately
- * not converted into the Lance prefilter carried by the TVF's {@code filter}
property.
+ * <p>This remains a postfilter relative to the Lance search: every split
first returns candidates,
+ * and Doris filters those candidates before the local/global TopN. It is
deliberately not
+ * converted into the Lance prefilter carried by the TVF's {@code filter}
property.
*/
public class PushDownFilterThroughVectorSearchTopN extends
OneRewriteRuleFactory {
@Override
public Rule build() {
return logicalFilter(logicalTopN(logicalTVFRelation()))
.then(filter -> {
LogicalTopN<LogicalTVFRelation> topN = filter.child();
- if (!VectorSearchTableValuedFunction.NAME.equals(
- topN.child().getFunction().getName())) {
+ String functionName = topN.child().getFunction().getName();
+ if
(!VectorSearchTableValuedFunction.NAME.equals(functionName)
+ &&
!FullTextSearchTableValuedFunction.NAME.equals(functionName)) {
Review Comment:
yes, doris now push where filter at scan, not after global sort node
--
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]