apache / pinot

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

Servers return wrong column types in case of empty results (everything defaults to STRING) #6962

Open sajjad-moradi opened 3 years ago

sajjad-moradi commented 3 years ago

Non-empty results (correct types): image

Empty results (incorrect types): image

This part of the code needs to be changed: https://github.com/apache/incubator-pinot/blob/master/pinot-core/src/main/java/org/apache/pinot/core/common/datatable/DataTableUtils.java#L121

Jackie-Jiang commented 3 years ago

This happens when all the segments are pruned out, and Pinot server short-circuits the query to directly return without checking the schema. We should just not return the schema when there is no record returned.