You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by xi...@apache.org on 2020/10/08 23:27:04 UTC

[incubator-pinot] branch make_transform_functions_support_underscore_in_it updated (937189c -> f071063)

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

xiangfu pushed a change to branch make_transform_functions_support_underscore_in_it
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git.


 discard 937189c  Make transform functions support underscore in the query functions
     new f071063  Make transform functions support underscore in the query functions

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (937189c)
            \
             N -- N -- N   refs/heads/make_transform_functions_support_underscore_in_it (f071063)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 pinot-core/src/test/java/org/apache/pinot/queries/IdSetQueriesTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


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


[incubator-pinot] 01/01: Make transform functions support underscore in the query functions

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiangfu pushed a commit to branch make_transform_functions_support_underscore_in_it
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git

commit f0710637200ef99733e67ecf9aaacac18149cf44
Author: Xiang Fu <fx...@gmail.com>
AuthorDate: Thu Oct 8 16:23:50 2020 -0700

    Make transform functions support underscore in the query functions
---
 .../operator/transform/function/TransformFunctionFactory.java    | 9 +++++++--
 .../src/test/java/org/apache/pinot/queries/IdSetQueriesTest.java | 2 +-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/pinot-core/src/main/java/org/apache/pinot/core/operator/transform/function/TransformFunctionFactory.java b/pinot-core/src/main/java/org/apache/pinot/core/operator/transform/function/TransformFunctionFactory.java
index 6bdc701..287ba08 100644
--- a/pinot-core/src/main/java/org/apache/pinot/core/operator/transform/function/TransformFunctionFactory.java
+++ b/pinot-core/src/main/java/org/apache/pinot/core/operator/transform/function/TransformFunctionFactory.java
@@ -23,6 +23,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.pinot.common.function.FunctionInfo;
 import org.apache.pinot.common.function.FunctionRegistry;
 import org.apache.pinot.common.function.TransformFunctionType;
@@ -148,7 +149,7 @@ public class TransformFunctionFactory {
             "Caught exception while instantiating transform function from class: " + transformFunctionClass.toString(),
             e);
       }
-      String transformFunctionName = transformFunction.getName().toLowerCase();
+      String transformFunctionName = canonicalize(transformFunction.getName());
       if (TRANSFORM_FUNCTION_MAP.containsKey(transformFunctionName)) {
         throw new IllegalArgumentException("Transform function: " + transformFunctionName + " already exists");
       }
@@ -167,7 +168,7 @@ public class TransformFunctionFactory {
     switch (expression.getType()) {
       case FUNCTION:
         FunctionContext function = expression.getFunction();
-        String functionName = function.getFunctionName();
+        String functionName = canonicalize(function.getFunctionName());
         List<ExpressionContext> arguments = function.getArguments();
         int numArguments = arguments.size();
 
@@ -210,4 +211,8 @@ public class TransformFunctionFactory {
         throw new IllegalStateException();
     }
   }
+
+  private static String canonicalize(String functionName) {
+    return StringUtils.remove(functionName, '_').toLowerCase();
+  }
 }
diff --git a/pinot-core/src/test/java/org/apache/pinot/queries/IdSetQueriesTest.java b/pinot-core/src/test/java/org/apache/pinot/queries/IdSetQueriesTest.java
index 0ee4f0e..df83cab 100644
--- a/pinot-core/src/test/java/org/apache/pinot/queries/IdSetQueriesTest.java
+++ b/pinot-core/src/test/java/org/apache/pinot/queries/IdSetQueriesTest.java
@@ -425,7 +425,7 @@ public class IdSetQueriesTest extends BaseQueriesTest {
     }
 
     {
-      String query = "SELECT COUNT(*) FROM testTable where INIDSET(intColumn, '" + serializedIdSet + "') = 0";
+      String query = "SELECT COUNT(*) FROM testTable where IN_ID_SET(intColumn, '" + serializedIdSet + "') = 0";
       AggregationOperator aggregationOperator = getOperatorForPqlQuery(query);
       IntermediateResultsBlock resultsBlock = aggregationOperator.nextBlock();
       QueriesTestUtils.testInnerSegmentExecutionStatistics(aggregationOperator.getExecutionStatistics(),


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