Skip to content

Druid SQL - natively support mathematical functions ROUND(), RADIANS(), EXP(), LN(), POWER(), RAND() #8661

@ntkawasaki

Description

@ntkawasaki

Description

Currently these widely known mathematical operations are not officially implemented by Druid SQL:

Remote driver error: RuntimeException: org.apache.calcite.tools.ValidationException: org.apache.calcite.runtime.CalciteContextException: From line 1, column 18 to line 1, column 23: 
No match found for function signature RAND() -> ValidationException: org.apache.calcite.runtime.CalciteContextException: From line 1, column 18 to line 1, column 23: 
No match found for function signature RAND() -> CalciteContextException: From line 1, column 18 to line 1, column 23: No match found for function signature RAND() -> SqlValidatorException: No match found for function signature RAND()

Similar error for all.

These functions used to work in Druid version 0.10 when the useFallback option existed, calcite had a way to call these. However it looks like this parameter has been deprecated since 0.15: c648775 and #7567

The docs here claim that these functions do exist: https://druid.apache.org/docs/latest/querying/sql#numeric-functions

However I believe these are out of date, or had been written at an earlier time/version when useFallback was being used and they were callable.

Motivation

These would be useful for Business Intelligence applications connecting to Druid SQL clusters, and are very well known operations for any numeric data.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions