gortiz commented on code in PR #11824: URL: https://github.com/apache/pinot/pull/11824#discussion_r1372762637
########## pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/nullvalue/NullValueIndexType.java: ########## @@ -67,7 +71,7 @@ public NullValueVectorCreator createIndexCreator(IndexCreationContext context, I @Override public IndexConfig getDefaultConfig() { - return IndexConfig.DISABLED; + return IndexConfig.ENABLED; Review Comment: This is tricky. It is necessary to change that to keep backward compatibility in case we read the segment without providing schema and/or table config, as it is usual in test (but not limited to them). In that case, we end up delegating to the default index config. Before this PR, we returned DISABLED, but it wasn't problematic because in `createIndexReader` we completely ignored the IndexConfig. We returned the vector if and only if there was a buffer stored for this column and index. Now we don't do that. The new logic is to return not null if and only if: - There is a buffer for the column and index - And the index is enabled. In normal cases, where table config and schema are provided, that means to delegate on the config returned by `createDeserializer`, which basically is: ```java fieldSpec.getNullable() == Boolean.TRUE || fieldSpec.getNullable() == null && nullHandlingEnabled ``` That is good enough. But in cases where schema or table config is not provided (which is something for some reason we do when reading segments in _read only mode_, like when doing tests) we delegate on the default values. That is why we need to default to ENABLE in order to return the null index in this case. -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org