You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "Jackie-Jiang (via GitHub)" <gi...@apache.org> on 2023/08/29 20:39:14 UTC

[GitHub] [pinot] Jackie-Jiang commented on a diff in pull request #11453: Fix the data type handling in multi-stage engine

Jackie-Jiang commented on code in PR #11453:
URL: https://github.com/apache/pinot/pull/11453#discussion_r1309330635


##########
pinot-common/src/main/java/org/apache/pinot/common/datablock/DataBlockUtils.java:
##########
@@ -275,43 +264,91 @@ private static Object[] extractRowFromDataBlock(DataBlock dataBlock, int rowId,
    * TODO: Add support for COLUMNAR format.
    * @return int array of values in the column
    */
-  public static int[] extractIntValuesForColumn(DataBlock dataBlock, int columnIndex) {
+  public static int[] extractIntValuesForColumn(DataBlock dataBlock, int colId) {
     DataSchema dataSchema = dataBlock.getDataSchema();
-    DataSchema.ColumnDataType[] columnDataTypes = dataSchema.getColumnDataTypes();
-
-    // Get null bitmap for the column.
-    RoaringBitmap nullBitmap = extractNullBitmaps(dataBlock)[columnIndex];
+    ColumnDataType storedType = dataSchema.getColumnDataType(colId).getStoredType();
+    RoaringBitmap nullBitmap = dataBlock.getNullRowIds(colId);
     int numRows = dataBlock.getNumberOfRows();
-
-    int[] rows = new int[numRows];
-    for (int rowId = 0; rowId < numRows; rowId++) {
-      if (nullBitmap != null && nullBitmap.contains(rowId)) {
-        continue;
+    int[] values = new int[numRows];
+    if (nullBitmap == null) {
+      switch (storedType) {
+        case INT:
+          for (int rowId = 0; rowId < numRows; rowId++) {
+            values[rowId] = dataBlock.getInt(rowId, colId);

Review Comment:
   All the loops are different (all combination of source type and dest type), and I guess the first thing JIT would do is to inline the method if we extract it out. We may revisit this in a separate thread



-- 
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-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org