Skip to content

Improvement in NULL Handling for Datetime columns #8254

@KKcorps

Description

@KKcorps

if allowNullTimeValue is set to true, pinot fills in the System.currentMillis timestamp in place of nulls. This happens in the following piece of code in NullValueTransformer class

    // handle null value in time column
    if (_defaultTimeValueFormat != null && record.getValue(_dateTimeFieldSpec.getName()) == null) {
      String timeValueStr = _defaultTimeValueFormat.fromMillisToFormat(System.currentTimeMillis());
      Object timeValue = _dateTimeFieldSpec.getDataType().convert(timeValueStr);
      record.putDefaultNullValue(_dateTimeFieldSpec.getName(), timeValue);
    }

This default value however creates an unpredictable behaviour from querying perspective. e.g. I inserted data for duration from year 2016 to 2018 but suddenly I find there is a timestamp for year 2022 in my data.

Another scenario is where I re-insert my data after clearing the table and find totally different values.

Pinot either needs to set this value to Epoch 0 or move on to some better default.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions