Skip to content

[FEATURE] Support function parameter coercion with Calcite #3761

@yuancu

Description

@yuancu

Is your feature request related to a problem?

Before introducing Calcite, when input parameter types of a function don't match with its expected types, it will try to coerce the parameter type with the expected types.

However, such mechanism isn't in place in current implementations with Calcite. This results in multiple problems. For example:

  • when input is a literal and the expected type is a date, it will not automatically coerce the literal to a date. Instead, it requires that the function supports string type as an input. (CalciteDateTimeFunctionIT.testUnixTimestampWithTimestampString)
  • when the input is long and the expected type is only integer (SqlTypeName.INTEGER), it can't resolve the function call to a known implementation.

What solution would you like?
Implement function type parameter coercion with Calcite.

What alternatives have you considered?
N/A

Do you have any additional context?

Metadata

Metadata

Assignees

Labels

PPLPiped processing languagecalcitecalcite migration releatedenhancementNew feature or requestfeature

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions