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/05/16 08:24:42 UTC

[incubator-pinot] branch fixing_groovy_templates_utils_npe updated (d0b851a -> 2a5ee19)

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

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


 discard d0b851a  fixing template argument if not specify values
     new 2a5ee19  fixing template argument if not specify values

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   (d0b851a)
            \
             N -- N -- N   refs/heads/fixing_groovy_templates_utils_npe (2a5ee19)

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:
 .../tools/admin/command/LaunchDataIngestionJobCommand.java     | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)


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


[incubator-pinot] 01/01: fixing template argument if not specify values

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

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

commit 2a5ee1930e4cb8a40f677f67670fd14e08d88f5f
Author: Xiang Fu <fx...@gmail.com>
AuthorDate: Sat May 16 01:20:32 2020 -0700

    fixing template argument if not specify values
---
 .../java/org/apache/pinot/spi/utils/GroovyTemplateUtils.java   |  3 +++
 .../tools/admin/command/LaunchDataIngestionJobCommand.java     | 10 ++++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/pinot-spi/src/main/java/org/apache/pinot/spi/utils/GroovyTemplateUtils.java b/pinot-spi/src/main/java/org/apache/pinot/spi/utils/GroovyTemplateUtils.java
index 5319b1d..f7d0375 100644
--- a/pinot-spi/src/main/java/org/apache/pinot/spi/utils/GroovyTemplateUtils.java
+++ b/pinot-spi/src/main/java/org/apache/pinot/spi/utils/GroovyTemplateUtils.java
@@ -57,6 +57,9 @@ public class GroovyTemplateUtils {
   }
 
   public static Map<String, Object> getTemplateContext(List<String> values) {
+    if (values == null) {
+      return Collections.emptyMap();
+    }
     Map<String, Object> context = new HashMap<>();
     for (String value : values) {
       String[] splits = value.split("=", 2);
diff --git a/pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/LaunchDataIngestionJobCommand.java b/pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/LaunchDataIngestionJobCommand.java
index 4ac3993..5965fcd 100644
--- a/pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/LaunchDataIngestionJobCommand.java
+++ b/pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/LaunchDataIngestionJobCommand.java
@@ -107,8 +107,14 @@ public class LaunchDataIngestionJobCommand extends AbstractBaseAdminCommand impl
 
   @Override
   public String toString() {
-    return ("LaunchDataIngestionJob -jobSpecFile " + _jobSpecFile + " -propertyFile " + _propertyFile + " -values "
-        + Arrays.toString(_values.toArray()));
+    String results = "LaunchDataIngestionJob -jobSpecFile " + _jobSpecFile;
+    if (_propertyFile != null) {
+      results += " -propertyFile " + _propertyFile;
+    }
+    if (_values != null) {
+      results += " -values " + Arrays.toString(_values.toArray());
+    }
+    return results;
   }
 
   @Override


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