This is an automated email from the ASF dual-hosted git repository.

jlli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 8a231a6  Fix SegmentConverter to handle virtual column (#3711)
8a231a6 is described below

commit 8a231a636dd3c3a12740a4082ae04d67730171d2
Author: Jialiang Li <[email protected]>
AuthorDate: Sun Jan 20 12:51:21 2019 -0800

    Fix SegmentConverter to handle virtual column (#3711)
---
 .../org/apache/pinot/core/data/readers/PinotSegmentRecordReader.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/pinot-core/src/main/java/org/apache/pinot/core/data/readers/PinotSegmentRecordReader.java
 
b/pinot-core/src/main/java/org/apache/pinot/core/data/readers/PinotSegmentRecordReader.java
index 38bde67..f00d1d1 100644
--- 
a/pinot-core/src/main/java/org/apache/pinot/core/data/readers/PinotSegmentRecordReader.java
+++ 
b/pinot-core/src/main/java/org/apache/pinot/core/data/readers/PinotSegmentRecordReader.java
@@ -35,6 +35,7 @@ import 
org.apache.pinot.core.data.readers.sort.PinotSegmentSorter;
 import org.apache.pinot.core.data.readers.sort.SegmentSorter;
 import org.apache.pinot.core.indexsegment.immutable.ImmutableSegment;
 import org.apache.pinot.core.indexsegment.immutable.ImmutableSegmentLoader;
+import org.apache.pinot.core.segment.index.SegmentMetadataImpl;
 
 
 /**
@@ -72,7 +73,9 @@ public class PinotSegmentRecordReader implements RecordReader 
{
       SegmentMetadata segmentMetadata = _immutableSegment.getSegmentMetadata();
       _numDocs = segmentMetadata.getTotalRawDocs();
       if (schema == null) {
-        _schema = segmentMetadata.getSchema();
+        // In order not to expose virtual columns to client, schema shouldn't 
be fetched from segmentMetadata;
+        // otherwise the original metadata will be modified. Hence, initialize 
a new schema.
+        _schema = new SegmentMetadataImpl(indexDir).getSchema();
         Collection<String> columnNames = _schema.getColumnNames();
         _columnReaderMap = new HashMap<>(columnNames.size());
         for (String columnName : columnNames) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to