docete 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_r347737397
 
 

 ##########
 File path: 
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/AbstractBinaryWriter.java
 ##########
 @@ -181,6 +181,29 @@ public void writeDecimal(int pos, Decimal value, int 
precision) {
                }
        }
 
+       @Override
+       public void writeTimestamp(int pos, SqlTimestamp value, int precision) {
+               if (SqlTimestamp.isCompact(precision)) {
+                       assert 0 == value.getNanoOfMillisecond();
+                       writeLong(pos, value.getMillisecond());
+               } else {
+                       // store the nanoOfMillisecond in fixed-length part as 
offset and nanoOfMillisecond
+                       ensureCapacity(8);
+
+                       if (value == null) {
 
 Review comment:
   For the fixed-length objects, the writer calls setNullAt() to update 
fixed-length part(which set null bits and initialize fixed-length part with 0); 
For the variable-length objects, the writer calls setNullAt to update 
fixed-length part and need to assign & initialize variable-length part.

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