Skip to content

Commit 91d246c

Browse files
committed
Change
1 parent 5e65b3d commit 91d246c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

server/src/main/java/org/elasticsearch/ingest/ESONSource.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import org.elasticsearch.xcontent.XContentString;
2121

2222
import java.io.IOException;
23+
import java.nio.charset.StandardCharsets;
2324
import java.util.AbstractCollection;
2425
import java.util.AbstractList;
2526
import java.util.AbstractMap;
@@ -143,8 +144,12 @@ yield switch (numberType) {
143144
bytes.writeDouble(parser.doubleValue());
144145
yield new FixedValue((int) position, ValueType.DOUBLE);
145146
}
146-
// TODO: BIG_INTEGER, BIG_DECIMAL
147-
default -> throw new IllegalArgumentException("Unexpected number type: " + numberType);
147+
case BIG_INTEGER, BIG_DECIMAL -> {
148+
String numberString = parser.text();
149+
byte[] numberBytes = numberString.getBytes(StandardCharsets.UTF_8);
150+
bytes.write(numberBytes);
151+
yield new VariableValue((int) position, numberBytes.length, ValueType.STRING);
152+
}
148153
};
149154
}
150155
case VALUE_BOOLEAN -> {

0 commit comments

Comments
 (0)