{"record":{"id":"0de92302a69bac9c","repo":"apache/iceberg","slug":"snowflakecatalog-does-not-currently-support-defaul","errorCode":null,"errorMessage":"SnowflakeCatalog does not currently support defaultWarehouseLocation","messagePattern":"SnowflakeCatalog does not currently support defaultWarehouseLocation","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"snowflake/src/main/java/org/apache/iceberg/snowflake/SnowflakeCatalog.java","lineNumber":262,"sourceCode":"    String fileIOImpl = DEFAULT_FILE_IO_IMPL;\n    if (catalogProperties.containsKey(CatalogProperties.FILE_IO_IMPL)) {\n      fileIOImpl = catalogProperties.get(CatalogProperties.FILE_IO_IMPL);\n    }\n\n    // Initialize a fresh FileIO for each TableOperations created, because some FileIO\n    // implementations such as S3FileIO can become bound to a single S3 bucket. Additionally,\n    // FileIO implementations often support only a finite set of one or more URI schemes (i.e.\n    // S3FileIO only supports s3/s3a/s3n, and even ResolvingFileIO only supports the combination\n    // of schemes registered for S3FileIO and HadoopFileIO). Individual catalogs may need to\n    // support tables across different cloud/storage providers with disjoint FileIO implementations.\n    FileIO fileIO = fileIOFactory.newFileIO(fileIOImpl, catalogProperties, conf);\n    closeableGroup.addCloseable(fileIO);\n    return new SnowflakeTableOperations(snowflakeClient, fileIO, catalogName, tableIdentifier);\n  }\n\n  @Override\n  protected String defaultWarehouseLocation(TableIdentifier tableIdentifier) {\n    throw new UnsupportedOperationException(\n        \"SnowflakeCatalog does not currently support defaultWarehouseLocation\");\n  }\n\n  @Override\n  public void setConf(Object conf) {\n    this.conf = conf;\n  }\n}\n","sourceCodeStart":244,"sourceCodeEnd":271,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/snowflake/src/main/java/org/apache/iceberg/snowflake/SnowflakeCatalog.java#L244-L271","documentation":"SnowflakeCatalog's BaseCatalog hook defaultWarehouseLocation (used when creating new tables by deriving a default storage location) is not implemented. Snowflake tables live in Snowflake-managed locations, so the catalog cannot compute a warehouse path, and any table-creation path that needs a default location throws UnsupportedOperationException.","triggerScenarios":"Creating a table through SnowflakeCatalog without an explicit location: catalog.createTable(ident, schema, spec, null /* no location */) or SQL CREATE TABLE without a LOCATION clause routed through this catalog.","commonSituations":"Spark 'CREATE TABLE ... (no LOCATION)' against a Snowflake catalog; tooling that creates staging/sink tables assuming the catalog derives locations; CTAS pipelines ported from Hadoop/Hive catalogs.","solutions":["Always supply an explicit location when creating tables via SnowflakeCatalog: createTable(ident, schema, spec, sortOrder, properties, location) with a valid object-storage URI.","In Spark, add a LOCATION clause to CREATE TABLE statements targeting the Snowflake catalog.","Prefer CREATE TABLE ... AS SELECT through Snowflake itself (the SnowflakeCatalog mainly exposes existing Snowflake-managed Iceberg tables); create Iceberg tables via Snowflake SQL instead of the Iceberg API.","If default-location creation is required, use a catalog that supports defaultWarehouseLocation (Hadoop/Hive/Nessie)."],"exampleFix":"// before\ncatalog.createTable(TableIdentifier.of(\"db\", \"t\"), schema, PartitionSpec.unpartitioned());\n// after\ncatalog.createTable(TableIdentifier.of(\"db\", \"t\"), schema, PartitionSpec.unpartitioned(),\n    \"s3://my-bucket/warehouse/db/t\");","handlingStrategy":"validation","validationCode":"Preconditions.checkArgument(location != null && !location.isEmpty(),\n    \"SnowflakeCatalog requires an explicit table location\");\ncatalog.createTable(ident, schema, spec, sortOrder, props, location);","typeGuard":null,"tryCatchPattern":"try { catalog.createTable(ident, schema, spec); } catch (UnsupportedOperationException e) { /* retry with explicit location */ catalog.createTable(ident, schema, spec, sortOrder, props, location); }","preventionTips":["Always pass an explicit location when creating tables via SnowflakeCatalog","Add LOCATION clauses to CREATE TABLE SQL targeting the Snowflake catalog","Create Iceberg tables through Snowflake SQL for fully Snowflake-managed tables"],"tags":["unsupported-operation","snowflake-catalog","table-creation"],"backgroundTag":"unsupported-operation","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}