Skip to content

Failed to create hive table with hadoopCatalog #1718

@qphien

Description

@qphien

Related to #1495

set iceberg.mr.catalog=hadoop;
hive (default)> create external table iceberg_table (id int) 
              > stored by 'org.apache.iceberg.mr.hive.HiveIcebergStorageHandler' 
              > location '/hive/default.db/iceberg_table';
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Cannot set a custom location for a path-based table. Expected hdfs://mycluster/iceberg/warehouse/default/iceberg_table but got hdfs://mycluster/hive/default.db/iceberg_table
    // HadoopCatalog.java
private class HadoopCatalogTableBuilder extends BaseMetastoreCatalogTableBuilder {
     ...
    @Override
    public TableBuilder withLocation(String location) {
      Preconditions.checkArgument(location == null || location.equals(defaultLocation),
          "Cannot set a custom location for a path-based table. Expected " + defaultLocation + " but got " + location);
      return this;
    }
   ...
}

HadoopCatalogTableBuilder only support null location

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions