JingsongLi commented on a change in pull request #10212: 
[FLINK-14806][table-planner-blink] Add setTimestamp/getTimestamp inte…
URL: https://github.com/apache/flink/pull/10212#discussion_r347764260
 
 

 ##########
 File path: 
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/vector/VectorizedColumnBatch.java
 ##########
 @@ -132,4 +133,17 @@ public Decimal getDecimal(int rowId, int colId, int 
precision, int scale) {
                        return Decimal.fromUnscaledBytes(precision, scale, 
bytes);
                }
        }
+
+       public SqlTimestamp getTimestamp(int rowId, int colId, int precision) {
+               if (isNullAt(rowId, colId)) {
+                       return null;
+               }
+
+               if (columns[colId] instanceof TimestampColumnVector) {
+                       return ((TimestampColumnVector) 
(columns[colId])).getTimestamp(rowId, precision);
+               } else {
+                       // by default, we assume the underlying 
LongColumnVector holds millisecond since Epoch.
+                       return SqlTimestamp.fromEpochMillis(((LongColumnVector) 
columns[colId]).getLong(rowId));
 
 Review comment:
   -1 for this implementation.
   This implementation is not compatible with anyone. And now there is an 
interface(`TimestampColumnVector`), why should there be a specific 
implementation?

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to