Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-10518

Replace US_ASCII charset with US-ASCII in encode and decode description

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Pending Closed
    • Affects Version/s: None
    • Fix Version/s: 1.3.0
    • Component/s: UDF
    • Labels:
      None

      Description

      GenericUDFEncode line 45 says

      extended = "Possible options for the character set are 'US_ASCII', 'ISO-8859-1',\n" +
      

      But Java Charset API says that valid ASCII charset value is US-ASCII
      https://docs.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html

      java.nio.charset.StandardCharset line 44

      public static final Charset US_ASCII = Charset.forName("US-ASCII");
      

      http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7u40-b43/java/nio/charset/StandardCharsets.java#StandardCharsets
      So, US_ASCII (with underscore) is java constant name
      But the value is "US-ASCII" (with hyphen)

      TestGenericUDFEncode JUnit tests uses 'US-ASCII' from the beginning (line 34).
      https://github.com/apache/hive/blob/master/ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFEncode.java

        Attachments

        1. HIVE-10518.1.patch
          2 kB
          Alexander Pivovarov

          Issue Links

            Activity

              People

              • Assignee:
                apivovarov Alexander Pivovarov
                Reporter:
                apivovarov Alexander Pivovarov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: