raminqaf commented on code in PR #28928:
URL: https://github.com/apache/flink/pull/28928#discussion_r3726356425
##########
flink-core/src/main/java/org/apache/flink/types/variant/Variant.java:
##########
@@ -20,15 +20,21 @@
import org.apache.flink.annotation.PublicEvolving;
+import java.io.Serializable;
import java.math.BigDecimal;
import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
-/** Variant represent a semi-structured data. */
+/**
+ * Variant represent a semi-structured data.
+ *
+ * <p>Instances are serializable so that they can be held as member variables
of user-defined
+ * functions or passed into their constructors.
+ */
@PublicEvolving
-public interface Variant {
+public interface Variant extends Serializable {
Review Comment:
`Value` extends `IOReadableWritable`, whose `read(DataInputView)`
deserializes into `this`. `ValueSerializer` also instantiates via a public
nullary constructor, which `BinaryVariant` cannot offer, since its constructor
validates the version byte and the size limit.
It would also add a second serialization path. `VARIANT` already has
`VariantTypeInfo` and `VariantSerializer`, and `TypeExtractor` would resolve to
`ValueTypeInfo` instead, because it checks `Value` first.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]