1
resposta

Não consigo criar a tabela

Quando executo o código, me retorna o seguinte erro:

[UC_FILE_SCHEME_FOR_TABLE_CREATION_NOT_SUPPORTED] Creating table in Unity Catalog with file scheme dbfs is not supported.
Instead, please create a federated data source connection using the CREATE CONNECTION command for the same table provider, then create a catalog based on the connection with a CREATE FOREIGN CATALOG command to reference the tables therein. SQLSTATE: 0AKUC

1 resposta

Você está tentando criar uma tabela no Unity Catalog usando o esquema de arquivos dbfs, o que não é suportado.

Para resolver, faça isso:

  1. Não use USING DELTA LOCATION 'dbfs:/...' diretamente com Unity Catalog.
  2. Crie uma conexão federada com o comando CREATE CONNECTION.
  3. Depois, crie um catálogo externo com CREATE FOREIGN CATALOG.

Ou, se quiser usar arquivos do DBFS diretamente, não use o Unity Catalog crie a tabela fora dele, por exemplo, no esquema hive_metastore.