You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/06/09 02:17:11 UTC

[GitHub] [iotdb] Plutooooooo commented on a diff in pull request #6192: [IOTDB-3360] Fix precision loss bug due to float converted to double

Plutooooooo commented on code in PR #6192:
URL: https://github.com/apache/iotdb/pull/6192#discussion_r893010428


##########
server/src/main/java/org/apache/iotdb/db/mpp/plan/parser/ASTVisitor.java:
##########
@@ -2067,6 +2070,14 @@ private Expression parseConstantOperand(ConstantContext constantContext) {
     }
   }
 
+  private Expression parseRealLiteral(String value) {
+    if (config.getFloatingStringInferType().equals(TSDataType.DOUBLE)) {
+      return new ConstantOperand(TSDataType.DOUBLE, value);
+    }
+    // 3.33 is float by default
+    return new ConstantOperand(TSDataType.FLOAT, value);

Review Comment:
   Fixed.



##########
server/src/main/java/org/apache/iotdb/db/mpp/plan/parser/ASTVisitor.java:
##########
@@ -138,6 +139,8 @@
 /** Parse AST to Statement. */
 public class ASTVisitor extends IoTDBSqlParserBaseVisitor<Statement> {
 
+  private static final IoTDBConfig config = IoTDBDescriptor.getInstance().getConfig();

Review Comment:
   Fixed.



-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org