raminqaf commented on code in PR #29311:
URL: https://github.com/apache/flink/pull/29311#discussion_r4152720222


##########
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/functions/VariantCastUtils.java:
##########
@@ -540,6 +551,111 @@ private static Number numeric(Variant variant, String 
targetType) {
         }
     }
 
+    public static Variant fromBoolean(boolean value) {
+        return BUILDER.of(value);
+    }
+
+    /**
+     * Stores an integer in the integer kind of its SQL type, so a {@code 
BIGINT} stays a {@code
+     * BIGINT} whatever its value. The generated code passes the primitive of 
the source type, which
+     * selects the overload.
+     */
+    public static Variant fromIntegral(byte value) {
+        return BUILDER.of(value);
+    }
+
+    public static Variant fromIntegral(short value) {
+        return BUILDER.of(value);
+    }
+
+    public static Variant fromIntegral(int value) {
+        return BUILDER.of(value);
+    }
+
+    public static Variant fromIntegral(long value) {
+        return BUILDER.of(value);
+    }
+
+    public static Variant fromFloat(float value) {
+        return BUILDER.of(value);
+    }
+
+    public static Variant fromDouble(double value) {
+        return BUILDER.of(value);
+    }
+
+    public static Variant fromDecimal(DecimalData value) {
+        return BUILDER.of(value.toBigDecimal());
+    }
+
+    public static Variant fromString(StringData value) {

Review Comment:
   Will be tracked here: https://issues.apache.org/jira/browse/FLINK-40871



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

Reply via email to