Skip to content

Inferring the possible types from the TypeSignature #13271

@goldmedal

Description

@goldmedal

Is your feature request related to a problem or challenge?

#13255 introduced the information_schema.routines table. I'm working on another table, inoformation_schema.parameters. Both need to list all possible combinations of the argument types and return types from a function signature.

Describe the solution you'd like

I implemented the method TypeSignature::get_possible_types to initial this framework( #13255 (comment)). Currently, I only implement TypeSignature::Exact and TypeSignature::OneOf. I think we can invoke the functions in type_coercion/functions.rs to do it.

/// Returns a Vec of all possible valid argument types for the given signature.
fn get_valid_types(
signature: &TypeSignature,
current_types: &[DataType],
) -> Result<Vec<Vec<DataType>>> {

Given all types as the current type, and then get all possible argument combinations.

Describe alternatives you've considered

No response

Additional context

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions