Jackie-Jiang commented on a change in pull request #6719:
URL: https://github.com/apache/incubator-pinot/pull/6719#discussion_r620746269
##########
File path:
pinot-common/src/main/java/org/apache/pinot/common/utils/PinotDataType.java
##########
@@ -315,6 +408,58 @@ public Double convert(Object value, PinotDataType
sourceType) {
}
},
+ TIMESTAMP {
+ @Override
+ public int toInt(Object value) {
+ throw new UnsupportedOperationException("Cannot convert value from
TIMESTAMP to INTEGER");
+ }
+
+ @Override
+ public long toLong(Object value) {
+ return ((Timestamp) value).getTime();
+ }
+
+ @Override
+ public float toFloat(Object value) {
+ throw new UnsupportedOperationException("Cannot convert value from
TIMESTAMP to FLOAT");
+ }
+
+ @Override
+ public double toDouble(Object value) {
+ return ((Timestamp) value).getTime();
+ }
+
+ @Override
+ public boolean toBoolean(Object value) {
+ throw new UnsupportedOperationException("Cannot convert value from
TIMESTAMP to BOOLEAN");
Review comment:
Revert this to unsupported because I feel it makes no sense to convert a
timestamp to boolean, most likely a human error of putting the wrong data type
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]