shenyu0127 commented on code in PR #10650:
URL: https://github.com/apache/pinot/pull/10650#discussion_r1186566162
##########
pinot-common/src/main/java/org/apache/pinot/common/request/context/LiteralContext.java:
##########
@@ -90,32 +90,55 @@ static Pair<FieldSpec.DataType, Object>
inferLiteralDataTypeAndValue(String lite
public LiteralContext(Literal literal) {
Preconditions.checkState(literal.getFieldValue() != null,
"Field value cannot be null for field:" + literal.getSetField());
- switch (literal.getSetField()){
+ switch (literal.getSetField()) {
case BOOL_VALUE:
_type = FieldSpec.DataType.BOOLEAN;
_value = literal.getFieldValue();
+ _bigDecimalValue = PinotDataType.BOOLEAN.toBigDecimal(_value);
break;
case DOUBLE_VALUE:
- _type = FieldSpec.DataType.DOUBLE;
- _value = literal.getFieldValue();
+ Number floatingNumber =
NumberUtils.createNumber(literal.getFieldValue().toString());
Review Comment:
Here you can do something simpler:
https://stackoverflow.com/questions/26099818/how-quickly-check-whether-double-fits-in-float-java
##########
pinot-core/src/main/java/org/apache/pinot/core/operator/transform/function/LiteralTransformFunction.java:
##########
@@ -86,6 +86,10 @@ public double getDoubleLiteral() {
return _doubleLiteral;
}
+ public float getFloatLiteral() {
Review Comment:
If this PR is to fix backward incompatibility issue, why bother adding this
method?
--
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]