Skip to content

TypeSignature::Coercible for math functions #14763

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
jayzhan211 opened this issue Feb 19, 2025 · 6 comments · May be fixed by #14872
Open

TypeSignature::Coercible for math functions #14763

jayzhan211 opened this issue Feb 19, 2025 · 6 comments · May be fixed by #14872
Assignees
Labels
enhancement New feature or request

Comments

@jayzhan211
Copy link
Contributor

jayzhan211 commented Feb 19, 2025

Is your feature request related to a problem or challenge?

Log for example can be handled with TypeSignature::Coercible where the desired type is float and allow source types are integer.

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

#14440
#13301

@jayzhan211 jayzhan211 added the enhancement New feature or request label Feb 19, 2025
@alan910127
Copy link
Contributor

take

@findepi
Copy link
Member

findepi commented Feb 19, 2025

Log for example can be handled with TypeSignature::Coercible where the desired type is float and allow source types are integer.

We must not encode coercion rules in every single function.
Standard coercion rules must be property of the engine. Not a property of every single function separately.

@jayzhan211
Copy link
Contributor Author

We must not encode coercion rules in every single function.
Standard coercion rules must be property of the engine. Not a property of every single function separately.

In an extensible query engine, users should define coercion rules as part of the function definition, specifying how data types are converted. The engine itself cannot define coercion rules for every function.

@findepi
Copy link
Member

findepi commented Feb 19, 2025

In an extensible query engine, users should define coercion rules as part of the function definition, specifying how data types are converted

Why??

The engine itself cannot define coercion rules for every function.

The function itself cannot define coercion rules for the engine.

@jayzhan211
Copy link
Contributor Author

Why not? I don't see any problem with my statement

@alan910127
Copy link
Contributor

I noticed that TypeSignatureClass::Numeric is marked as TODO, and I think math functions could benefit from using the Numeric class. Additionally, since there is no Float class, would it make sense to start by implementing Numeric first?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants