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 2021/01/29 03:58:34 UTC

[incubator-pinot] branch master updated: Fixing groovy parser with back slash (#6501)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 56df592  Fixing groovy parser with back slash (#6501)
56df592 is described below

commit 56df592ad16681ab629829d1b7e32df60777c169
Author: Xiang Fu <fx...@gmail.com>
AuthorDate: Thu Jan 28 19:58:11 2021 -0800

    Fixing groovy parser with back slash (#6501)
---
 .../main/java/org/apache/pinot/spi/utils/GroovyTemplateUtils.java  | 4 ++--
 pinot-spi/src/test/resources/ingestion_job_spec_template.yaml      | 7 ++++++-
 2 files changed, 8 insertions(+), 3 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 f7d0375..21852a4 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
@@ -19,7 +19,6 @@
 package org.apache.pinot.spi.utils;
 
 import groovy.text.SimpleTemplateEngine;
-import groovy.text.TemplateEngine;
 import java.io.IOException;
 import java.text.SimpleDateFormat;
 import java.time.Instant;
@@ -33,7 +32,7 @@ import java.util.TimeZone;
 
 
 public class GroovyTemplateUtils {
-  private static final TemplateEngine GROOVY_TEMPLATE_ENGINE = new SimpleTemplateEngine();
+  private static final SimpleTemplateEngine GROOVY_TEMPLATE_ENGINE = new SimpleTemplateEngine();
   private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd");
 
   public static String renderTemplate(String template, Map<String, Object> newContext)
@@ -77,5 +76,6 @@ public class GroovyTemplateUtils {
 
   static {
     DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC"));
+    GROOVY_TEMPLATE_ENGINE.setEscapeBackslash(true);
   }
 }
diff --git a/pinot-spi/src/test/resources/ingestion_job_spec_template.yaml b/pinot-spi/src/test/resources/ingestion_job_spec_template.yaml
index a786506..23a1e53 100644
--- a/pinot-spi/src/test/resources/ingestion_job_spec_template.yaml
+++ b/pinot-spi/src/test/resources/ingestion_job_spec_template.yaml
@@ -23,9 +23,14 @@ executionFrameworkSpec:
   segmentTarPushJobRunnerClassName: 'org.apache.pinot.plugin.ingestion.batch.standalone.SegmentTarPushJobRunner'
   segmentUriPushJobRunnerClassName: 'org.apache.pinot.plugin.ingestion.batch.standalone.SegmentUriPushJobRunner'
 jobType: SegmentCreationAndTarPush
+
 inputDirURI: 'file:///path/to/input/${ year }/${ month }/${ day }'
+# includeFileNamePattern: include file name pattern, supported glob pattern.
+# Sample usage:
+#   'glob:*.avro' will include all avro files just under the inputDirURI, not sub directories;
+#   'glob:**\/*.avro' will include all the avro files under inputDirURI recursively.
 includeFileNamePattern: 'glob:**/*.parquet'
-excludeFileNamePattern: 'glob:**/*.avro'
+excludeFileNamePattern: 'glob:**/*.avro' # 'glob:**\/*.avro' will exclude all the avro files.
 outputDirURI: 'file:///path/to/output/${year}/${month}/${day}'
 overwriteOutput: true
 segmentCreationJobParallelism: 100


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