Github user QiangCai commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2184#discussion_r183196683
--- Diff:
datamap/lucene/src/main/java/org/apache/carbondata/datamap/lucene/LuceneDataMapWriter.java
---
@@ -222,12 +236,10 @@ public void onPageAdded(int blockletId, int pageId,
ColumnPage[] pages) throws I
//doc.add(new NumericDocValuesField(ROWID_NAME,rowId));
}
- // add other fields
- for (int colIdx = 0; colIdx < columnsCount; colIdx++) {
- if
(indexedCarbonColumns.contains(pages[colIdx].getColumnSpec().getFieldName())) {
- if (!pages[colIdx].getNullBits().get(rowId)) {
- addField(doc, pages[colIdx], rowId, Field.Store.NO);
- }
+ // add indexed columns value into the document
+ for (int colIdx = 0; colIdx < luceneColumnIndex.length; colIdx++) {
+ if (!pages[luceneColumnIndex[colIdx]].getNullBits().get(rowId)) {
--- End diff --
The indexedCarbonColumns and pages have the same order. not required to
check it again.
---