Skip to content

Commit f02dbdc

Browse files
committed
[FLINK-37925][core] Document VARIANT timestamp precision in the Variant interface
Note that getDateTime and getInstant return values with microsecond precision, which the LocalDateTime and Instant return types do not convey on their own. Fix the getInstant javadoc to reference Type.TIMESTAMP_LTZ, the type it actually accepts, instead of Type.TIMESTAMP.
1 parent b71c8a8 commit f02dbdc

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

flink-core/src/main/java/org/apache/flink/types/variant/Variant.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,18 +127,19 @@ public interface Variant {
127127

128128
/**
129129
* Get the scalar value of variant as LocalDateTime, if the variant type is {@link
130-
* Type#TIMESTAMP}.
130+
* Type#TIMESTAMP}. The returned value has microsecond precision.
131131
*
132132
* @throws VariantTypeException If this variant is not a scalar value or is not {@link
133133
* Type#TIMESTAMP}.
134134
*/
135135
LocalDateTime getDateTime() throws VariantTypeException;
136136

137137
/**
138-
* Get the scalar value of variant as Instant, if the variant type is {@link Type#TIMESTAMP}.
138+
* Get the scalar value of variant as Instant, if the variant type is {@link
139+
* Type#TIMESTAMP_LTZ}. The returned value has microsecond precision.
139140
*
140141
* @throws VariantTypeException If this variant is not a scalar value or is not {@link
141-
* Type#TIMESTAMP}.
142+
* Type#TIMESTAMP_LTZ}.
142143
*/
143144
Instant getInstant() throws VariantTypeException;
144145

0 commit comments

Comments
 (0)