XMLWordPrintableJSON

Details

    • Reviewed

    Description

      We had earlier decided to punt on this, but in discussing YARN-5109 we thought it would be best to just be safe rather than sorry later on.

      Encoded sequences can occur in the original string, especially in case of "foreign key" if we decide to have lookups.

      For example, space is encoded as %2$.
      Encoding "String with %2$ in it" would decode to "String with in it".
      We though we should first escape existing occurrences of encoded strings by prefixing a backslash (even if there is already a backslash that should be ok). Then we should replace all unencoded strings.
      On the way out, we should replace all occurrences of our encoded string to the original except when it is prefixed by an escape character. Lastly we should strip off the one additional backslash in front of each remaining (escaped) sequence.

      If we add the following entry to TestSeparator#testEncodeDecode() that demonstrates what this jira should accomplish:

          testEncodeDecode("Double-escape %2$ and %3$ or \\%2$ or \\%3$, nor  \\\\%2$ = no problem!", Separator.QUALIFIERS,
              Separator.VALUES, Separator.SPACE, Separator.TAB);
      

      Attachments

        1. YARN-5167-YARN-2928.03.patch
          11 kB
          Sangjin Lee
        2. YARN-5167-YARN-2928.02.patch
          11 kB
          Sangjin Lee
        3. YARN-5167-YARN-2928.01.patch
          9 kB
          Sangjin Lee

        Activity

          People

            sjlee0 Sangjin Lee
            jrottinghuis Joep Rottinghuis
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: