Skip to content

Commit f7939c0

Browse files
committed
Fix serialization exception
1 parent 6cf55ee commit f7939c0

File tree

1 file changed

+3
-6
lines changed
  • x-pack/plugin/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/type

1 file changed

+3
-6
lines changed

x-pack/plugin/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/type/DataType.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import org.elasticsearch.index.IndexMode;
1616
import org.elasticsearch.index.mapper.SourceFieldMapper;
1717
import org.elasticsearch.index.mapper.TimeSeriesIdFieldMapper;
18+
import org.elasticsearch.xpack.esql.core.QlIllegalArgumentException;
1819
import org.elasticsearch.xpack.esql.core.util.PlanStreamInput;
1920
import org.elasticsearch.xpack.esql.core.util.PlanStreamOutput;
2021

@@ -759,13 +760,9 @@ public DataType counter() {
759760
public void writeTo(StreamOutput out) throws IOException {
760761
if (supportedVersion.supportedOn(out.getTransportVersion(), Build.current().isSnapshot()) == false) {
761762
/*
762-
* TODO when we implement version aware planning flip this to an IllegalStateException
763-
* so we throw a 500 error. It'll be our bug then. Right now it's a sign that the user
764-
* tried to do something like `KNN(dense_vector_field, [1, 2])` against an old node.
765-
* Like, during the rolling upgrade that enables KNN or to a remote cluster that has
766-
* not yet been upgraded.
763+
* Throw a 500 error - this is a bug, we failed to account for an old node during planning.
767764
*/
768-
throw new IllegalArgumentException(
765+
throw new QlIllegalArgumentException(
769766
"remote node at version [" + out.getTransportVersion() + "] doesn't understand data type [" + this + "]"
770767
);
771768
}

0 commit comments

Comments
 (0)