gianm commented on code in PR #13037:
URL: https://github.com/apache/druid/pull/13037#discussion_r965402243
##########
sql/src/main/java/org/apache/druid/sql/calcite/expression/DruidExpression.java:
##########
@@ -104,9 +104,24 @@ private static String escape(final String s)
return escaped.toString();
}
- public static String numberLiteral(final Number n)
+ public static String longLiteral(final long n)
{
- return n == null ? nullLiteral() : n.toString();
+ return String.valueOf(n);
+ }
+
+ public static String doubleLiteral(final double n)
+ {
+ final String s = String.valueOf(n);
+
+ // Ensure number is parsed as a double: add ".0" if necessary.
+ for (int i = 0; i < s.length(); i++) {
+ final char c = s.charAt(i);
+ if (!Character.isDigit(c)) {
Review Comment:
This comment is absolutely correct and led me down a crazy rabbit hole 🐰
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]