Skip to content

Commit 235e1b3

Browse files
committed
Update sargFromJson method in ExtendedRelJson
- this fix testRand, where desrialization of sarg does not restore its type - todo: update the toRex in ExtendedRelJson to the align with the latest version Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
1 parent b343cf8 commit 235e1b3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

opensearch/src/main/java/org/opensearch/sql/opensearch/storage/serde/ExtendedRelJson.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ RexNode toRex(RelInput relInput, @PolyNull Object o) {
500500
}
501501
final RelDataType type = toType(typeFactory, get(map, "type"));
502502
if (literal instanceof Map && ((Map<?, ?>) literal).containsKey("rangeSet")) {
503-
Sarg sarg = sargFromJson((Map) literal);
503+
Sarg sarg = sargFromJson((Map) literal, type);
504504
return rexBuilder.makeSearchArgumentLiteral(sarg, type);
505505
}
506506
if (type.getSqlTypeName() == SqlTypeName.SYMBOL) {
@@ -515,7 +515,7 @@ RexNode toRex(RelInput relInput, @PolyNull Object o) {
515515
return rexBuilder.makeNullLiteral(type);
516516
}
517517
final RelDataType type = toType(typeFactory, get(map, "type"));
518-
Sarg sarg = sargFromJson((Map) sargObject);
518+
Sarg sarg = sargFromJson((Map) sargObject, type);
519519
return rexBuilder.makeSearchArgumentLiteral(sarg, type);
520520
}
521521
if (map.containsKey("dynamicParam")) {

0 commit comments

Comments
 (0)