Skip to content

Commit def7990

Browse files
committed
Update PplTypeCoercionRule to allow CAST(IP as STRING)
Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
1 parent eb1602a commit def7990

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

core/src/main/java/org/opensearch/sql/calcite/validate/PplTypeCoercionRule.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,17 @@ public class PplTypeCoercionRule {
2424
* <ul>
2525
* <li>IP -> IP
2626
* <li>CHARACTER -> IP
27+
* <li>IP -> CHARACTER
2728
* </ul>
2829
*/
2930
private static final Map<SqlTypeName, ImmutableSet<@NonNull SqlTypeName>> additionalMapping =
3031
Map.of(
3132
SqlTypeName.OTHER,
32-
ImmutableSet.of(SqlTypeName.OTHER, SqlTypeName.VARCHAR, SqlTypeName.CHAR));
33+
ImmutableSet.of(SqlTypeName.OTHER, SqlTypeName.VARCHAR, SqlTypeName.CHAR),
34+
SqlTypeName.VARCHAR,
35+
ImmutableSet.of(SqlTypeName.OTHER),
36+
SqlTypeName.CHAR,
37+
ImmutableSet.of(SqlTypeName.OTHER));
3338

3439
private static final SqlTypeCoercionRule INSTANCE =
3540
SqlTypeCoercionRule.instance(

0 commit comments

Comments
 (0)