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

Iceberg: Attempting to create a table with a percent symbol fails

    XMLWordPrintableJSON

Details

    Description

      This occurred while attempting to test creating a table 
      "[|]#&%@"."[|]#&%@"
      The stack trace is as follows:

       

      java.util.UnknownFormatConversionException: Conversion = '_'
      org.apache.hadoop.hive.ql.metadata.HiveException: java.util.UnknownFormatConversionException: Conversion = '_'
              at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:1383) ~[hive-exec-4.0.0-beta-1.jar:4.0.0-beta-1]
              at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:1388) ~[hive-exec-4.0.0-beta-1.jar:4.0.0-beta-1]
              at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:1278) ~[hive-exec-4.0.0-beta-1.jar:4.0.0-beta-1]
              …
      Caused by: java.util.UnknownFormatConversionException: Conversion = '_'
              at java.util.Formatter.checkText(Formatter.java:2590) ~[?:1.8.0]
              at java.util.Formatter.parse(Formatter.java:2566) ~[?:1.8.0]
              at java.util.Formatter.format(Formatter.java:2512) ~[?:1.8.0]
              at java.util.Formatter.format(Formatter.java:2466) ~[?:1.8.0]
              at java.lang.String.format(String.java:4268) ~[?:2.9 (05-29-2023)]
              at org.apache.iceberg.relocated.com.google.common.util.concurrent.ThreadFactoryBuilder.format(ThreadFactoryBuilder.java:186) ~[hive-iceberg-handler-4.0.0-beta-1.jar:4.0.0-beta-1]
              at org.apache.iceberg.relocated.com.google.common.util.concurrent.ThreadFactoryBuilder.setNameFormat(ThreadFactoryBuilder.java:73) ~[hive-iceberg-handler-4.0.0-beta-1.jar:4.0.0-beta-1]
              at org.apache.iceberg.hive.MetastoreLock.<init>(MetastoreLock.java:129) ~[hive-iceberg-handler-4.0.0-beta-1.jar:4.0.0-beta-1] 

       

       

      This was fixed by making a change to https://github.com/apache/hive/blob/branch-4.0.0-beta-1/iceberg/iceberg-catalog/src/main/java/org/apache/iceberg/hive/MetastoreLock.java#L129

       

      -                            .setNameFormat("iceberg-hive-lock-heartbeat-" + fullName + "-%d")
      +                            .setNameFormat("iceberg-hive-lock-heartbeat-" + fullName.replace("%", "%%") + "-%d")

       

      Attachments

        Activity

          People

            tthorpeca Tim Thorpe
            tthorpeca Tim Thorpe
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: