Uploaded image for project: 'Pig'
  1. Pig
  2. PIG-2074

When passing a parameter to Pig, if the value contains $ it has to be escaped because of a bug in PrecprocessorContext

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • None
    • None
    • impl
    • None

    Description

      This was raised while looking at PIG-1827

      There seems to be a bug in PreprocessorContext:
      http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/tools/parameters/PreprocessorContext.java?view=markup

      235 	//String litVal = Matcher.quoteReplacement(val);
      236 	replaced_line = replaced_line.replaceFirst("\\$"+key, val);
      

      the replacement (2nd) parameter of replaceFirst is not a plain string, it can contain references to the matched pattern like "$0" so $ in val must be escaped.
      Does someone know why line 235 is commented out ?

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              julienledem Julien Le Dem
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: