You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by si...@apache.org on 2021/01/27 22:27:26 UTC

[incubator-pinot] branch fic-sql-orderby-hotfix updated: Fixing the issue with result schema (#6353)

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

siddteotia pushed a commit to branch fic-sql-orderby-hotfix
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git


The following commit(s) were added to refs/heads/fic-sql-orderby-hotfix by this push:
     new 1865e89  Fixing the issue with result schema (#6353)
1865e89 is described below

commit 1865e898f675daf9529605c5ec9d097e3bf45f21
Author: Seunghyun Lee <sn...@linkedin.com>
AuthorDate: Mon Dec 14 23:46:08 2020 -0800

    Fixing the issue with result schema (#6353)
    
    The existing code returns the wrong result schema
    when order by column does not appear as part of the
    selection columns. This fixes the minor bug in the
    code and returns the schema correctly.
---
 .../org/apache/pinot/core/query/selection/SelectionOperatorUtils.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pinot-core/src/main/java/org/apache/pinot/core/query/selection/SelectionOperatorUtils.java b/pinot-core/src/main/java/org/apache/pinot/core/query/selection/SelectionOperatorUtils.java
index 99d8f8b..f589806 100644
--- a/pinot-core/src/main/java/org/apache/pinot/core/query/selection/SelectionOperatorUtils.java
+++ b/pinot-core/src/main/java/org/apache/pinot/core/query/selection/SelectionOperatorUtils.java
@@ -179,7 +179,7 @@ public class SelectionOperatorUtils {
     int numColumns = selectionColumns.size();
     Map<String, DataSchema.ColumnDataType> columnNameToDataType = new HashMap<>();
     DataSchema.ColumnDataType[] finalColumnDataTypes = new DataSchema.ColumnDataType[numColumns];
-    for (int i = 0; i < numColumns; i++) {
+    for (int i = 0; i < dataSchema.size(); i++) {
       columnNameToDataType.put(dataSchema.getColumnName(i), dataSchema.getColumnDataType(i));
     }
     for (int i = 0; i < numColumns; i++) {


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