nizarhejazi commented on code in PR #8927:
URL: https://github.com/apache/pinot/pull/8927#discussion_r907006878
##########
pinot-core/src/main/java/org/apache/pinot/core/operator/blocks/IntermediateResultsBlock.java:
##########
@@ -311,16 +343,50 @@ private DataTable getResultDataTable()
throws IOException {
DataTableBuilder dataTableBuilder =
DataTableFactory.getDataTableBuilder(_dataSchema);
ColumnDataType[] storedColumnDataTypes =
_dataSchema.getStoredColumnDataTypes();
+ int numColumns = _dataSchema.size();
Iterator<Record> iterator = _table.iterator();
- while (iterator.hasNext()) {
- Record record = iterator.next();
- dataTableBuilder.startRow();
- int columnIndex = 0;
- for (Object value : record.getValues()) {
- setDataTableColumn(storedColumnDataTypes[columnIndex],
dataTableBuilder, columnIndex, value);
- columnIndex++;
+ RoaringBitmap[] nullBitmaps = null;
+ if (_isNullHandlingEnabled) {
+ nullBitmaps = new RoaringBitmap[numColumns];
+ Object[] colDefaultNullValues = new Object[numColumns];
+ for (int colId = 0; colId < numColumns; colId++) {
+ if (storedColumnDataTypes[colId] != ColumnDataType.OBJECT) {
+ colDefaultNullValues[colId] =
FieldSpec.getDefaultNullValue(FieldSpec.FieldType.METRIC,
Review Comment:
Changed to:
```
// Store a dummy value that is both a valid numeric, and a valid hex
encoded value.
String specialVal = "30";
colDefaultNullValues[colId] =
storedColumnDataTypes[colId].toDataType().convert(specialVal);
```
Setting it in `setDataTableColumn()` may hurt performance (need to check for
null and type together).
--
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]