From 0394f988470de609d04f7b0f34f33c52c81548d0 Mon Sep 17 00:00:00 2001 From: Bruno Volpato Date: Fri, 21 Feb 2025 21:58:23 -0500 Subject: [PATCH] fix: rely on interface for literal handling --- .../io/substrait/isthmus/expression/LiteralConverter.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/isthmus/src/main/java/io/substrait/isthmus/expression/LiteralConverter.java b/isthmus/src/main/java/io/substrait/isthmus/expression/LiteralConverter.java index 56daa8c8..ace2f9f7 100644 --- a/isthmus/src/main/java/io/substrait/isthmus/expression/LiteralConverter.java +++ b/isthmus/src/main/java/io/substrait/isthmus/expression/LiteralConverter.java @@ -104,9 +104,8 @@ public Expression.Literal convert(RexLiteral literal) { } throw new UnsupportedOperationException("Unable to handle char type: " + val); } - case FLOAT, DOUBLE -> fp64(n, (Double) literal.getValue()); - case REAL -> fp32(n, ((Double) literal.getValue()).floatValue()); - + case FLOAT, DOUBLE -> fp64(n, ((Number) literal.getValue()).doubleValue()); + case REAL -> fp32(n, ((Number) literal.getValue()).floatValue()); case DECIMAL -> { BigDecimal bd = bd(literal); yield decimal(n, bd, literal.getType().getPrecision(), literal.getType().getScale());