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

Database name is not encoded when used to create default database location

    XMLWordPrintableJSON

Details

    Description

      The database directory is created using the following code in Warehouse.java:

      private String dbDirFromDbName(Database db) throwsMetaException { 
        return db.getName().toLowerCase() +DATABASE_WAREHOUSE_SUFFIX; }

      The database name is not encoded, as done when generating directories for table names. As a consequence, special characters in schema names yield problems, e.g., when a schema having name "my:schema" is created:

      metastore.RetryingHMSHandler: MetaException(message:java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: my:schema.db)
              at org.apache.hadoop.hive.metastore.ExceptionHandler.newMetaException(ExceptionHandler.java:152)
              at org.apache.hadoop.hive.metastore.ExceptionHandler.defaultMetaException(ExceptionHandler.java:168)
              at org.apache.hadoop.hive.metastore.HMSHandler.create_database(HMSHandler.java:1397)

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              oschille Oliver Schiller
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: