apache / pinot

Apache Pinot - A realtime distributed OLAP datastore
https://pinot.apache.org/
Apache License 2.0
5.27k stars 1.23k forks source link

Query fails due to error in long conversion of millisecond time column in WHERE clause #8541

Closed Akshay2Agarwal closed 2 years ago

Akshay2Agarwal commented 2 years ago

Facing an issue in pinot where queries like (as mentioned over docs):

SELECT *
FROM table_name
WHER time_ms_epoch_col > now() - 86400000 * 7
LIMIT 10

fails over at this line due to conversion failure. Logs:

'QueryExecutionError:\n'
            'org.apache.pinot.spi.exception.BadQueryRequestException: '
            'java.lang.IllegalArgumentException: Cannot convert value: '
            "'1.649312982053E12' to type: LONG\n"
            '\tat '
            'org.apache.pinot.core.query.pruner.ColumnValueSegmentPruner.convertValue(ColumnValueSegmentPruner.java:424)\n'
            '\tat '
            'org.apache.pinot.core.query.pruner.ColumnValueSegmentPruner.pruneRangePredicate(ColumnValueSegmentPruner.java:369)\n'
            '\tat '
            'org.apache.pinot.core.query.pruner.ColumnValueSegmentPruner.pruneSegment(ColumnValueSegmentPruner.java:230)\n'
            '\tat '
            'org.apache.pinot.core.query.pruner.ColumnValueSegmentPruner.prune(ColumnValueSegmentPruner.java:160)\n'
            '...\n'
            'Caused by: java.lang.IllegalArgumentException: Cannot convert '
            "value: '1.649312982053E12' to type: LONG\n"
            '\tat '
            'org.apache.pinot.spi.data.FieldSpec$DataType.convertInternal(FieldSpec.java:510)\n'
            '\tat '
            'org.apache.pinot.core.query.pruner.ColumnValueSegmentPruner.convertValue(ColumnValueSegmentPruner.java:422)\n'
            '\t... 17 more'
Akshay2Agarwal commented 2 years ago

I realized schema was missing my bad.