dylanhz commented on code in PR #25291:
URL: https://github.com/apache/flink/pull/25291#discussion_r1746483780


##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/inference/strategies/SpecificInputTypeStrategies.java:
##########
@@ -125,6 +125,19 @@ public static InputTypeStrategy windowTimeIndicator() {
      */
     public static final ArgumentTypeStrategy INDEX = new 
IndexArgumentTypeStrategy();
 
+    /** An {@link ArgumentTypeStrategy} that expects a percentage value 
between [0.0, 1.0]. */
+    public static ArgumentTypeStrategy percentage(boolean expectedNullability) 
{
+        return new PercentageArgumentTypeStrategy(expectedNullability);
+    }
+
+    /**
+     * An {@link ArgumentTypeStrategy} that expects an array of percentages 
with each element
+     * between [0.0, 1.0].
+     */
+    public static ArgumentTypeStrategy percentageArray(boolean 
expectedNullability) {

Review Comment:
   I think `and` strategy describes a relationship like `a + b`, but here we 
need a inclusion relationship which has not been supported yet. 
   For example, if we want a strategy like `ARRAY<NUMERIC>`, then we have to 
create a new strategy class specially or in a very complex way, like 
`or(explicit(ARRAY(DOUBLE())), explicit(ARRAY(FLOAT()))...)`. This can be an 
improvement in the future.
   Back to our implementation, we have to perform literal value checking 
additionally, so I took the compromised and easy way which is creating a new 
strategy specially.



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