Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Exportar resultados de consulta para o Blob Storage
Este documento descreve como exportar o resultado de uma consulta executada em uma
tabela do BigLake para o
Armazenamento de Blobs do Azure.
Para informações sobre como os dados fluem entre o BigQuery e o
Armazenamento de Blobs do Azure,
consulte Fluxo de dados ao exportar dados.
Limitações
Para acessar uma lista completa de limitações que se aplicam a tabelas do BigLake
baseadas no Amazon S3 e no Armazenamento de Blobs, consulte Limitações.
Antes de começar
Confira se você tem os seguintes recursos:
Uma conexão para acessar o armazenamento de blobs.
Na conexão, crie uma política para o caminho do contêiner
do Armazenamento de blobs em que você quer exportar. Dentro dessa política,
crie um papel que tenha a
permissão Microsoft.Storage/storageAccounts/blobServices/containers/write.
O BigQuery Omni grava no local do Armazenamento de Blobs especificado, independentemente do conteúdo
existente. A consulta de exportação pode substituir os dados ou combinar o resultado da
consulta com os dados existentes. Recomendamos que você exporte o resultado da consulta para um
contêiner vazio do Armazenamento de blobs.
No Google Cloud console, acesse a página BigQuery.
CONNECTION_REGION: a região em que a
conexão foi criada.
CONNECTION_NAME: o nome da conexão que você
criou com a permissão necessária para gravar no contêiner.
AZURE_STORAGE_ACCOUNT_NAME: o nome da
conta do Armazenamento de blobs em que você quer gravar o resultado da consulta.
CONTAINER_NAME: o nome do contêiner
em que você quer gravar o resultado da consulta.
FILE_PATH: o caminho em que você quer gravar
o arquivo exportado. Ele precisa conter exatamente um caractere curinga * em qualquer lugar
no diretório da string do caminho, por exemplo, ../aa/*,
../aa/b*c, ../aa/*bc e ../aa/bc*. O BigQuery
substitui * por 0000..N dependendo do número de arquivos exportados.
O BigQuery determina a contagem e os tamanhos de arquivos. Se
o BigQuery decidir exportar dois arquivos, o * no primeiro nome do
arquivo será substituído por 000000000000, e o * no
segundo nome do arquivo, substituído por 000000000001:
FORMAT: os formatos compatíveis são JSON, AVRO
e CSV e PARQUET
QUERY: a consulta para analisar os dados
armazenados em uma tabela do BigLake.
Solução de problemas
Se você receber um erro relacionado a quota failure, verifique se tem reserva de
capacidade para as consultas. Para mais informações sobre reservas de slot, consulte
Antes de começar neste documento.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-17 UTC."],[[["\u003cp\u003eThis guide outlines the process of exporting query results from a BigLake table to Azure Blob Storage.\u003c/p\u003e\n"],["\u003cp\u003eBefore exporting, you must establish a connection to your Blob Storage with appropriate write permissions and have a BigLake table in place.\u003c/p\u003e\n"],["\u003cp\u003eThe export process involves using a specific GoogleSQL \u003ccode\u003eEXPORT DATA\u003c/code\u003e query with connection details, target URI, desired format, and the source query.\u003c/p\u003e\n"],["\u003cp\u003eIt is recommended to export query results to an empty Blob Storage container, because the export query can overwrite or mix with existing data.\u003c/p\u003e\n"],["\u003cp\u003eIf you are receiving \u003ccode\u003equota failure\u003c/code\u003e error, check if you have reserved capacity for your queries.\u003c/p\u003e\n"]]],[],null,["# Export query results to Blob Storage\n====================================\n\nThis document describes how to export the result of a query that runs against a\n[BigLake table](/bigquery/docs/biglake-intro) to your\nAzure Blob Storage.\n\nFor information about how data flows between BigQuery and\nAzure Blob Storage,\nsee [Data flow when exporting data](/bigquery/docs/omni-introduction#export-data).\n\nLimitations\n-----------\n\nFor a full list of limitations that apply to BigLake tables\nbased on Amazon S3 and Blob Storage, see [Limitations](/bigquery/docs/omni-introduction#limitations).\n\nBefore you begin\n----------------\n\nEnsure that you have the following resources:\n\n\n- A [connection to access your Blob Storage](/bigquery/docs/omni-azure-create-connection). Within the connection, you must create a policy for the Blob Storage container path that you want to export to. Then, within that policy, create a role that has the `Microsoft.Storage/storageAccounts/blobServices/containers/write` permission.\n- An [Blob Storage BigLake table](/bigquery/docs/omni-azure-create-external-table).\n\n\u003c!-- --\u003e\n\n- If you are on the [capacity-based pricing model](/bigquery/pricing#capacity_compute_analysis_pricing), then ensure that you have enabled the [BigQuery Reservation API](https://console.cloud.google.com/apis/library/bigqueryreservation.googleapis.com) for your project. For information about pricing, see [BigQuery Omni pricing](/bigquery/pricing#bqomni).\n\nExport query results\n--------------------\n\nBigQuery Omni writes to the specified Blob Storage location regardless of any existing\ncontent. The export query can overwrite existing data or mix the query result\nwith existing data. We recommend that you export the query result to an empty\nBlob Storage container.\n\n1. In the Google Cloud console, go to the **BigQuery** page.\n\n [Go to BigQuery](https://console.cloud.google.com/bigquery)\n2. In the **Query editor** field, enter a GoogleSQL export query:\n\n ```bash\n EXPORT DATA WITH CONNECTION \\`CONNECTION_REGION.CONNECTION_NAME\\`\n OPTIONS(\n uri=\"azure://\u003cvar translate=\"no\"\u003eAZURE_STORAGE_ACCOUNT_NAME\u003c/var\u003e.blob.core.windows.net/\u003cvar translate=\"no\"\u003eCONTAINER_NAME\u003c/var\u003e/\u003cvar translate=\"no\"\u003eFILE_PATH\u003c/var\u003e/*\",\n format=\"\u003cvar translate=\"no\"\u003eFORMAT\u003c/var\u003e\"\n )\n AS QUERY\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eCONNECTION_REGION\u003c/var\u003e: the region where the connection was created.\n - \u003cvar translate=\"no\"\u003eCONNECTION_NAME\u003c/var\u003e: the connection name that you created with the necessary permission to write to the container.\n - \u003cvar translate=\"no\"\u003eAZURE_STORAGE_ACCOUNT_NAME\u003c/var\u003e: the name of the Blob Storage account to which you want to write the query result.\n - \u003cvar translate=\"no\"\u003eCONTAINER_NAME\u003c/var\u003e: the name of the container to which you want to write the query result.\n - \u003cvar translate=\"no\"\u003eFILE_PATH\u003c/var\u003e: the path where you want to write the exported file to. It must contain exactly one wildcard `*` anywhere in the leaf directory of the path string, for example, `../aa/*`, `../aa/b*c`, `../aa/*bc`, and `../aa/bc*`. BigQuery replaces `*` with `0000..N` depending on the number of files exported. BigQuery determines the file count and sizes. If BigQuery decides to export two files, then `*` in the first file's filename is replaced by `000000000000`, and `*` in the second file's filename is replaced by `000000000001`.\n - \u003cvar translate=\"no\"\u003eFORMAT\u003c/var\u003e: supported formats are `JSON`, `AVRO`, `CSV`, and `PARQUET`.\n - \u003cvar translate=\"no\"\u003eQUERY\u003c/var\u003e: the query to analyze the data that is stored in a BigLake table.\n\n| **Note:** To override the default project, use the `--project_id=`\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e parameter. Replace \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e with the ID of your Google Cloud project.\n\nTroubleshooting\n---------------\n\nIf you get an error related to `quota failure`, then check if you have reserved\ncapacity for your queries. For more information about slot reservations, see\n[Before you begin](#before_you_begin) in this document.\n\nWhat's next\n-----------\n\n- Learn about [BigQuery Omni](/bigquery/docs/omni-introduction).\n- Learn how to [export table data](/bigquery/docs/exporting-data).\n- Learn how to [query data stored in Blob Storage](/bigquery/docs/query-azure-data).\n- Learn how to [set up VPC Service Controls for BigQuery Omni](/bigquery/docs/omni-vpc-sc)."]]