walterddr commented on code in PR #9205:
URL: https://github.com/apache/pinot/pull/9205#discussion_r947279578
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/column/DefaultNullValueVirtualColumnProvider.java:
##########
@@ -85,7 +85,13 @@ public InvertedIndexReader<?>
buildInvertedIndex(VirtualColumnContext context) {
@Override
public ColumnMetadataImpl buildMetadata(VirtualColumnContext context) {
- return
getColumnMetadataBuilder(context).setCardinality(1).setSorted(context.getFieldSpec().isSingleValueField())
- .setHasDictionary(true).build();
+
+ ColumnMetadataImpl.Builder builder =
getColumnMetadataBuilder(context).setCardinality(1).setHasDictionary(true);
+ if (context.getFieldSpec().isSingleValueField()) {
+ builder.setSorted(true);
+ } else {
+ builder.setMaxNumberOfMultiValues(1);
Review Comment:
why setting this to 1 ?
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/indexsegment/mutable/MutableSegmentImpl.java:
##########
@@ -966,16 +966,21 @@ public Set<String> getPhysicalColumnNames() {
public DataSource getDataSource(String column) {
FieldSpec fieldSpec = _schema.getFieldSpecFor(column);
if (fieldSpec == null || fieldSpec.isVirtualColumn()) {
+ VirtualColumnContext virtualColumnContext = null;
// Column is either added during ingestion, or was initiated with a
virtual column provider
if (fieldSpec == null) {
// If the column was added during ingestion, we will construct the
column provider based on its fieldSpec to
// provide values
fieldSpec = _newlyAddedColumnsFieldMap.get(column);
Preconditions.checkNotNull(fieldSpec,
"FieldSpec for " + column + " should not be null. " + "Potentially
invalid column name specified.");
+ // newly added column shouldn't have any doc count?
+ virtualColumnContext = new VirtualColumnContext(fieldSpec, 0);
Review Comment:
newly added column should have same doc count right? just cardinality will
always be 1 due to only default null value will be select out?
--
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]