Skip to content

Commit dc1a30a

Browse files
committed
fix minor
1 parent 0cb00ce commit dc1a30a

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

paimon-core/src/main/java/org/apache/paimon/table/source/FullTextSearchBuilderImpl.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
import org.apache.paimon.table.InnerTable;
2323
import org.apache.paimon.types.DataField;
2424

25+
import static org.apache.paimon.utils.Preconditions.checkArgument;
26+
import static org.apache.paimon.utils.Preconditions.checkNotNull;
27+
2528
/** Implementation for {@link FullTextSearchBuilder}. */
2629
public class FullTextSearchBuilderImpl implements FullTextSearchBuilder {
2730

@@ -57,11 +60,15 @@ public FullTextSearchBuilder withQueryText(String queryText) {
5760

5861
@Override
5962
public FullTextScan newFullTextScan() {
63+
checkNotNull(textColumn, "Text column must be set via withTextColumn()");
6064
return new FullTextScanImpl(table, textColumn);
6165
}
6266

6367
@Override
6468
public FullTextRead newFullTextRead() {
69+
checkArgument(limit > 0, "Limit must be positive, set via withLimit()");
70+
checkNotNull(textColumn, "Text column must be set via withTextColumn()");
71+
checkNotNull(queryText, "Query text must be set via withQueryText()");
6572
return new FullTextReadImpl(table, limit, textColumn, queryText);
6673
}
6774
}

paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/PaimonBaseScan.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ abstract class PaimonBaseScan(table: InnerTable)
5555
}
5656

5757
private def evalGlobalIndexSearch(): GlobalIndexResult = {
58+
if (pushedVectorSearch.isDefined && pushedFullTextSearch.isDefined) {
59+
throw new UnsupportedOperationException(
60+
"Cannot push down both vector search and full-text search simultaneously.")
61+
}
5862
if (pushedVectorSearch.isDefined) {
5963
return evalVectorSearch()
6064
}

0 commit comments

Comments
 (0)