You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/11/18 03:55:10 UTC

[GitHub] [flink] docete commented on a change in pull request #10212: [FLINK-14806][table-planner-blink] Add setTimestamp/getTimestamp inte…

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_r347193267
 
 

 ##########
 File path: flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/BinaryArray.java
 ##########
 @@ -191,6 +191,23 @@ public Decimal getDecimal(int pos, int precision, int scale) {
 		return Decimal.readDecimalFieldFromSegments(segments, offset, offsetAndSize, precision, scale);
 	}
 
+	@Override
+	public SqlTimestamp getTimestamp(int pos, int precision) {
+		assertIndexIsValid(pos);
+
+		if (SqlTimestamp.isCompact(precision)) {
+			return SqlTimestamp.fromEpochMillis(
+				SegmentsUtil.getLong(segments, getElementOffset(pos, 8)));
+		}
+
+		int fieldOffset = getElementOffset(pos, 8);
+		final long offsetAndNanoOfMilli = SegmentsUtil.getLong(segments, fieldOffset);
+		final int nanoOfMillisecond = (int) offsetAndNanoOfMilli;
 
 Review comment:
   Sure

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services