raminqaf commented on code in PR #27886:
URL: https://github.com/apache/flink/pull/27886#discussion_r3136348636
##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/inference/StaticArgument.java:
##########
@@ -196,6 +211,91 @@ public boolean is(StaticArgumentTrait trait) {
return traits.contains(trait);
}
+ /**
+ * Context-aware trait check. Evaluates conditional trait rules against
the given context to
+ * determine the effective traits.
+ */
+ public boolean is(StaticArgumentTrait trait, TraitContext ctx) {
+ return resolveTraits(ctx).contains(trait);
+ }
+
+ /**
+ * Returns a new {@link StaticArgument} with an additional conditional
trait rule. The trait is
+ * added to the effective trait set when the condition evaluates to {@code
true} at planning
+ * time. Only non-root traits (subtraits of TABLE, SCALAR, or MODEL) are
allowed.
+ *
+ * <p>Multiple conditions for the same trait use OR semantics: the trait
is activated if any of
+ * its conditions is met.
+ *
+ * <p>Example:
+ *
+ * <pre>{@code
+ * StaticArgument.table("input", Row.class, false, EnumSet.of(TABLE,
SUPPORT_UPDATES))
+ * .withConditionalTrait(SET_SEMANTIC_TABLE, hasPartitionBy());
+ * }</pre>
+ */
+ public StaticArgument withConditionalTrait(
+ final StaticArgumentTrait trait, final TraitCondition condition) {
+ if (trait == StaticArgumentTrait.SCALAR
Review Comment:
@gustavodemorais Could it be that you forgot to apply the changes here?
--
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]