Skip to content

feat: support decimal for math functions: log #17140

@theirix

Description

@theirix

Is your feature request related to a problem or challenge?

Math functions in datafusion-functions do not support Decimal128, Decimal256 directly, casting the input to floats. Since #14612 is near, it's reasonable to add first-class support for decimals.

Describe the solution you'd like

In a linked PR, I decided to start from the explicitly defined log function in math/log.rs. It's not trivial because of the optional argument with base and combinations.

Later, it'd be worth introducing a similar support to the make_math_unary_udf! macro – a subject of future work.

Describe alternatives you've considered

Not handling Decimals explicitly decreases precision and disallows using math on large decimals.

Additional context

No response

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions