You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2021/01/28 10:30:23 UTC

[GitHub] [incubator-pinot] fx19880617 opened a new pull request #6501: Fixing groovy parser with back slash

fx19880617 opened a new pull request #6501:
URL: https://github.com/apache/incubator-pinot/pull/6501


   ## Description
   Fix issue: https://github.com/apache/incubator-pinot/issues/6491


----------------------------------------------------------------
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.

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


[GitHub] [incubator-pinot] fx19880617 commented on a change in pull request #6501: Fixing groovy parser with back slash

Posted by GitBox <gi...@apache.org>.
fx19880617 commented on a change in pull request #6501:
URL: https://github.com/apache/incubator-pinot/pull/6501#discussion_r566353103



##########
File path: 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.

Review comment:
       These are just comments in the yaml file, however the groovy template engine throws exceptions on the back slash in the comments

##########
File path: pinot-spi/src/main/java/org/apache/pinot/spi/utils/GroovyTemplateUtils.java
##########
@@ -77,5 +77,6 @@ public static String renderTemplate(String template)
 
   static {
     DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC"));
+    ((SimpleTemplateEngine) GROOVY_TEMPLATE_ENGINE).setEscapeBackslash(true);

Review comment:
       agreed 




----------------------------------------------------------------
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.

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


[GitHub] [incubator-pinot] fx19880617 merged pull request #6501: Fixing groovy parser with back slash

Posted by GitBox <gi...@apache.org>.
fx19880617 merged pull request #6501:
URL: https://github.com/apache/incubator-pinot/pull/6501


   


----------------------------------------------------------------
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.

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


[GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull request #6501: Fixing groovy parser with back slash

Posted by GitBox <gi...@apache.org>.
Jackie-Jiang commented on a change in pull request #6501:
URL: https://github.com/apache/incubator-pinot/pull/6501#discussion_r566342076



##########
File path: 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.

Review comment:
       Do we need the backslash here?

##########
File path: pinot-spi/src/main/java/org/apache/pinot/spi/utils/GroovyTemplateUtils.java
##########
@@ -77,5 +77,6 @@ public static String renderTemplate(String template)
 
   static {
     DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC"));
+    ((SimpleTemplateEngine) GROOVY_TEMPLATE_ENGINE).setEscapeBackslash(true);

Review comment:
       (nit) We can change the declaration of `GROOVY_TEMPLATE_ENGINE` to `SimpleTemplateEngine` to avoid this type cast for clarity

##########
File path: 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.

Review comment:
       Do we need the backslash here?




----------------------------------------------------------------
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.

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


[GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull request #6501: Fixing groovy parser with back slash

Posted by GitBox <gi...@apache.org>.
Jackie-Jiang commented on a change in pull request #6501:
URL: https://github.com/apache/incubator-pinot/pull/6501#discussion_r566359391



##########
File path: 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.

Review comment:
       I see. So we just want to test backslash within the comments?




----------------------------------------------------------------
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.

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


[GitHub] [incubator-pinot] fx19880617 commented on a change in pull request #6501: Fixing groovy parser with back slash

Posted by GitBox <gi...@apache.org>.
fx19880617 commented on a change in pull request #6501:
URL: https://github.com/apache/incubator-pinot/pull/6501#discussion_r566382099



##########
File path: 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.

Review comment:
       yes




----------------------------------------------------------------
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.

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