gortiz commented on code in PR #11749:
URL: https://github.com/apache/pinot/pull/11749#discussion_r1348479382
##########
pinot-common/src/main/java/org/apache/pinot/common/request/context/LiteralContext.java:
##########
@@ -43,154 +39,202 @@
*/
public class LiteralContext {
// TODO: Support all of the types for sql.
- private final FieldSpec.DataType _type;
+ private final DataType _type;
private final Object _value;
- private final BigDecimal _bigDecimalValue;
- private static BigDecimal getBigDecimalValue(FieldSpec.DataType type, Object
value) {
- switch (type) {
- case BIG_DECIMAL:
- return (BigDecimal) value;
- case BOOLEAN:
- return PinotDataType.BOOLEAN.toBigDecimal(value);
- case TIMESTAMP:
- return
PinotDataType.TIMESTAMP.toBigDecimal(Timestamp.valueOf(value.toString()));
- default:
- if (type.isNumeric()) {
- return new BigDecimal(value.toString());
- }
- return BigDecimal.ZERO;
- }
- }
+ // PinotDataType is used for the type conversion.
Review Comment:
nit: I would prefer javadoc comments. They are included in IDE
documentation, while single line comments are not
--
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]