[
https://issues.apache.org/jira/browse/CALCITE-6984?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17947154#comment-17947154
]
Mihai Budiu commented on CALCITE-6984:
--------------------------------------
As an example, the LOG function uses such an operand type checker, and the
following typechecks: LOG(x'')
Here is a (partial) list of functions affected: LOG (in all dialects),
PARSE_URL, REGEXP_LIKE, EXTRACT, EXISTSNODE, PARSE_TIMESTAMP, STR_TO_MAP, LPAD,
RPAD, REGEXP_EXTRACT, REGEXP_INSTR, SUBSTR, CONTAINS_SUBSTR.
I could not eliminate all uses of this incorrect function, so I haven't yet
deprecated it. In particular, JSON_VALUE seems to rely on the arguments not
being type-checked (even the number of arguments is unclear).
> FamilyOperandTypeChecker with a Predicate describing optional arguments does
> not reject mistyped expressions
> ------------------------------------------------------------------------------------------------------------
>
> Key: CALCITE-6984
> URL: https://issues.apache.org/jira/browse/CALCITE-6984
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.39.0
> Reporter: Mihai Budiu
> Priority: Minor
>
> [CALCITE-6976] is a symptom of a deeper problem: the family operand type
> checker using a predicate for specifying optional arguments will accept
> mistyped expressions if their number of arguments does not match the maximum
> number of arguments.
> This affects at least 20 functions from SqlLibraryOperators.
> A partial solution is to use the .or type checker when possible.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)