Jackie-Jiang commented on code in PR #8872: URL: https://github.com/apache/pinot/pull/8872#discussion_r899573706
########## pinot-core/src/main/java/org/apache/pinot/core/common/NullBitmapUtils.java: ########## @@ -0,0 +1,51 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.pinot.core.common; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import org.roaringbitmap.RoaringBitmap; + + +public final class NullBitmapUtils { + private NullBitmapUtils() { + } + + public static void setNullRowIds(RoaringBitmap nullBitmap, ByteArrayOutputStream fixedSizeByteArrayOutputStream, + ByteArrayOutputStream variableSizeDataByteArrayOutputStream) + throws IOException { + if (nullBitmap != null) { Review Comment: Since we didn't store the `colId` of the null bitmap, we have to write all bitmaps. When the bitmap is null or empty, we can write the offset and 0 ########## pinot-core/src/main/java/org/apache/pinot/core/common/datablock/BaseDataBlock.java: ########## @@ -203,7 +204,7 @@ public BaseDataBlock(ByteBuffer byteBuffer) * Return the int serialized form of the data block version and type. * @return */ - protected abstract int getDataBlockVersionType(); + public abstract int getDataBlockVersionType(); Review Comment: We might not want to expose this method. It is for internal usage only ########## pinot-core/src/main/java/org/apache/pinot/core/common/datablock/RowDataBlock.java: ########## @@ -48,6 +50,29 @@ public RowDataBlock(ByteBuffer byteBuffer) computeBlockObjectConstants(); } + @Override + public RoaringBitmap getNullRowIds(int colId) { Review Comment: This should be part of the `BaseDataBlock` ########## pinot-core/src/test/java/org/apache/pinot/core/common/datatable/DataTableSerDeTest.java: ########## @@ -175,11 +177,7 @@ public void testV3V4Compatibility() DataSchema dataSchema = new DataSchema(columnNames, columnDataTypes); - // TODO: verify data table compatibility across multi-stage and normal query engine. Review Comment: Should we keep the TODOs? I don't think it is resolved yet ########## pinot-core/src/main/java/org/apache/pinot/core/common/datablock/DataBlockBuilder.java: ########## @@ -289,7 +304,7 @@ public static ColumnarDataBlock buildFromColumns(List<Object[]> columns, DataSch } private static RowDataBlock buildRowBlock(DataBlockBuilder builder) { - return new RowDataBlock(builder._numRows, builder._dataSchema, builder._reverseDictionaryMap, + return new DataTableImplV4(builder._numRows, builder._dataSchema, builder._reverseDictionaryMap, Review Comment: I think the issue is from using `DataBlockBuilder` to build data table in the test. If we switch to use `DataTableBuilder` to build data table, it should work. Changing this can break the data block code. cc @walterddr -- 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]
