gortiz commented on code in PR #10687:
URL: https://github.com/apache/pinot/pull/10687#discussion_r1176661376
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/indexsegment/mutable/MutableSegmentImpl.java:
##########
@@ -698,54 +647,16 @@ private void addNewRow(int docId, GenericRow row) {
indexContainer._valuesInfo.updateSVNumValues();
// Update indexes
- MutableForwardIndex forwardIndex = indexContainer._forwardIndex;
int dictId = indexContainer._dictId;
- if (dictId >= 0) {
- // Dictionary-encoded single-value column
-
- // Update forward index
- forwardIndex.setDictId(docId, dictId);
-
- // Update inverted index
- MutableInvertedIndex invertedIndex = indexContainer._invertedIndex;
- if (invertedIndex != null) {
- try {
- invertedIndex.add(dictId, docId);
- } catch (Exception e) {
- recordIndexingError(FieldConfig.IndexType.INVERTED, e);
- }
- }
- } else {
- // Single-value column with raw index
-
- // Update forward index
- switch (dataType.getStoredType()) {
- case INT:
- forwardIndex.setInt(docId, (Integer) value);
- break;
- case LONG:
- forwardIndex.setLong(docId, (Long) value);
- break;
- case FLOAT:
- forwardIndex.setFloat(docId, (Float) value);
- break;
- case DOUBLE:
- forwardIndex.setDouble(docId, (Double) value);
- break;
- case BIG_DECIMAL:
- forwardIndex.setBigDecimal(docId, (BigDecimal) value);
- break;
- case STRING:
- forwardIndex.setString(docId, (String) value);
- break;
- case BYTES:
- forwardIndex.setBytes(docId, (byte[]) value);
- break;
- default:
- throw new UnsupportedOperationException(
- "Unsupported data type: " + dataType + " for no-dictionary
column: " + column);
+ for (Map.Entry<IndexType, MutableIndex> indexEntry :
indexContainer._mutableIndexes.entrySet()) {
+ try {
+ indexEntry.getValue().add(value, dictId, docId);
+ } catch (Exception e) {
+ recordIndexingError(indexEntry.getKey(), e);
Review Comment:
This will introduce the log and the metric for all index types that support
mutable indexes.
--
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]