amrishlal opened a new issue, #9660:
URL: https://github.com/apache/pinot/issues/9660
This caused a bit of confusion when one of our users ran an query on their
table and the metadata that came back showed that all the columns in the result
set were STRING. I debugged the issue and narrowed down the cause to the code
below:
```
private static SelectionResultsBlock
buildEmptySelectionQueryResults(QueryContext queryContext) {
List<ExpressionContext> selectExpressions =
queryContext.getSelectExpressions();
int numSelectExpressions = selectExpressions.size();
String[] columnNames = new String[numSelectExpressions];
for (int i = 0; i < numSelectExpressions; i++) {
columnNames[i] = selectExpressions.get(i).toString();
}
ColumnDataType[] columnDataTypes = new
ColumnDataType[numSelectExpressions];
// NOTE: Use STRING column data type as default for selection query
Arrays.fill(columnDataTypes, ColumnDataType.STRING);
DataSchema dataSchema = new DataSchema(columnNames, columnDataTypes);
return new SelectionResultsBlock(dataSchema, Collections.emptyList());
}
```
Note the use of `Arrays.fill(columnDataTypes, ColumnDataType.STRING)` which
sets all the columns in result metadata to STRING when resultset is empty. I am
wondering if can modify this to return either no metadata or no column
datatypes or are there backward compatibly concerns around making such a change?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]