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/26 20:56:06 UTC

[GitHub] [incubator-pinot] kkrugler opened a new issue #6491: Groovy-based SimpleTemplateScript1 parser for job yaml file complains about characters in commented-out lines

kkrugler opened a new issue #6491:
URL: https://github.com/apache/incubator-pinot/issues/6491


   If you have a job spec file that contains something like:
   
   ``` yaml
   # excludeFileNamePattern: exclude file name pattern, supported glob pattern.
   # Sample usage:
   #   'glob:*.avro' will exclude all avro files just under the inputDirURI, not sub directories;
   #   'glob:**\/*.avro' will exclude all the avro files under inputDirURI recursively.
   # _excludeFileNamePattern: ''
   ```
   
   Then the parsing of this file will fail with:
   
   ```
   SimpleTemplateScript1.groovy: 37: unexpected char: '\' @ line 37, column 13.
   ```
   
   Where line 37 is `#   'glob:**\/*.avro' will exclude all the avro files under inputDirURI recursively.`. The problem is the `\` character, which should be getting ignored since the line is commented out.


----------------------------------------------------------------
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] kkrugler commented on issue #6491: Groovy-based SimpleTemplateScript1 parser for job yaml file complains about characters in commented-out lines

Posted by GitBox <gi...@apache.org>.
kkrugler commented on issue #6491:
URL: https://github.com/apache/incubator-pinot/issues/6491#issuecomment-768465903


   The [Groovy Template Engine documentation](https://docs.groovy-lang.org/docs/next/html/documentation/template-engines.html#_advanced_usage_note) warns about backslashes in text:
   
   > If you happen to be embedding your template directly in your script (as we did above) you have to be careful about backslash escaping. Because the template string itself will be parsed by Groovy before it is passed to the templating framework, you have to escape any backslashes inside GString expressions or scriptlet 'code' that are entered as part of a Groovy program
   
   I think an appropriate solution would be to modify `GroovyTemplateUtils.renderTemplate()` to first strip out comment lines (maybe with a boolean parameter to control?) before passing text to the `GROOVY_TEMPLATE_ENGINE`. Or we could try to automatically escape backslashes, but I'd be in favor of removing 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] kkrugler commented on issue #6491: Groovy-based SimpleTemplateScript1 parser for job yaml file complains about characters in commented-out lines

Posted by GitBox <gi...@apache.org>.
kkrugler commented on issue #6491:
URL: https://github.com/apache/incubator-pinot/issues/6491#issuecomment-768788311


   I just noticed some yaml files have a comment at the end of a line, so the stripping should be from `#` to end of line, not complete lines.


----------------------------------------------------------------
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] kkrugler commented on issue #6491: Groovy-based SimpleTemplateScript1 parser for job yaml file complains about characters in commented-out lines

Posted by GitBox <gi...@apache.org>.
kkrugler commented on issue #6491:
URL: https://github.com/apache/incubator-pinot/issues/6491#issuecomment-769981635


   Hi @fx19880617 - thanks for fixing so quickly!
   
   I am curious, though - since the template engine is inspecting text (even comments), could a poorly-formed substitution pattern in a comment also trigger an issue?


----------------------------------------------------------------
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 closed issue #6491: Groovy-based SimpleTemplateScript1 parser for job yaml file complains about characters in commented-out lines

Posted by GitBox <gi...@apache.org>.
fx19880617 closed issue #6491:
URL: 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 issue #6491: Groovy-based SimpleTemplateScript1 parser for job yaml file complains about characters in commented-out lines

Posted by GitBox <gi...@apache.org>.
fx19880617 commented on issue #6491:
URL: https://github.com/apache/incubator-pinot/issues/6491#issuecomment-768675718


   Agreed. Will make the change.


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