Skip to content

[RFC] allow now like function do not use function properties to fix current timestamp. #3535

Closed as not planned
@xinyual

Description

@xinyual

Overview
Current, we use function properties as the parameter to fix current timestamp in now like functions (now(), current_time(), current_timestamp()). This allow us to show the same current time in one query execution. For example, we call source=XX | eval a=utc_time() | fields a, it will show

{
    "schema": [
        {
            "name": "a",
            "type": "time"
        }
    ],
    "datarows": [
        [
            "07:35:29.811442"
        ],
        [
            "07:35:29.811442"
        ],
....
}

The times are same even in microsecond level.
But other engine like calcite, spark has different performance. The result depends on the time the exact line is executed. Besides, avoiding passing function properties could make the logical plan clear and allow us the initialize static function object, improving the performance. After removing the function properties in argument, the return could be something like

{
    "schema": [
        {
            "name": "a",
            "type": "time"
        }
    ],
    "datarows": [
        [
            "07:35:29.811442"
        ],
        [
            "07:35:29.835123"
        ],
        [
            "07:35:29.849123"
        ],
....
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    calcitecalcite migration releated

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions