외부 데이터 소스는 데이터가 BigQuery 스토리지에 저장되어 있지 않더라도 BigQuery에서 직접 쿼리할 수 있는 데이터 소스입니다. 예를 들어 다른 Google Cloud 데이터베이스, Cloud Storage의 파일 또는 다른 클라우드 제품에 BigQuery에서 분석하려는 데이터가 있는데 마이그레이션 준비가 되지 않았을 수 있습니다.
외부 데이터 소스의 사용 사례에는 다음이 포함됩니다.
ELT(extract-load-transform) 워크로드의 경우 CREATE TABLE ... AS SELECT 쿼리를 사용하여 한 번에 데이터를 로드 및 정리하고 정리된 결과를 BigQuery 스토리지에 씁니다.
외부 데이터 소스에서 자주 변경되는 데이터와 BigQuery 테이블을 조인합니다. 외부 데이터 소스를 직접 쿼리하면 데이터가 변경될 때마다 BigQuery 스토리지를 새로고침할 필요가 없습니다.
BigQuery에서 외부 데이터를 쿼리하는 2가지 메커니즘으로는 외부 테이블과 통합 쿼리가 있습니다.
외부 테이블
외부 테이블은 메타데이터 및 스키마를 BigQuery 스토리지에 저장한다는 점에서 표준 BigQuery 테이블과 유사합니다. 하지만 데이터는 외부 소스에 있습니다.
외부 테이블은 데이터 세트 내에 포함되어 있으며 표준 BigQuery 테이블을 관리하는 것과 동일한 방식으로 관리합니다. 예를 들어 테이블 속성 보기, 액세스 제어 설정 등을 수행할 수 있습니다. 이러한 테이블을 쿼리할 수 있으며 대부분의 경우 다른 테이블과 조인할 수 있습니다.
외부 테이블에는 네 가지 종류가 있습니다.
BigLake 테이블
BigQuery Omni 테이블
객체 테이블
BigLake 외의 외부 테이블
BigLake 테이블
BigLake 테이블을 사용하면 액세스 위임으로 외부 데이터 스토어의 구조화된 데이터를 쿼리할 수 있습니다. 액세스 위임은 BigLake 테이블에 대한 액세스 권한을 기본 데이터 스토어에 대한 액세스 권한과 분리합니다. 서비스 계정과 연결된 외부 연결은 데이터 스토어에 연결하는 데 사용됩니다. 이 서비스 계정이 데이터 스토어에서 데이터 가져오기를 처리하므로 사용자에게 BigLake 테이블에 대한 액세스 권한만 부여하면 됩니다. 이렇게 하면 행 수준 및 열 수준 보안을 포함하여 테이블 수준에서 세부 조정된 보안을 적용할 수 있습니다. Cloud Storage 기반 BigLake 테이블의 경우 동적 데이터 마스킹도 사용할 수 있습니다. Amazon S3 또는 Blob Storage 데이터가 있는 BigLake 테이블을 사용하는 멀티 클라우드 분석 솔루션에 대한 자세한 내용은 BigQuery Omni를 참조하세요.
객체 테이블을 사용하면 Cloud Storage에서 구조화되지 않은 데이터를 분석할 수 있습니다. BigQuery ML을 사용하여 원격 함수로 분석하거나 추론을 수행한 다음 이러한 작업 결과를 BigQuery의 나머지 구조화된 데이터와 조인할 수 있습니다.
BigLake 테이블과 마찬가지로 객체 테이블은 액세스 위임을 사용하여 Cloud Storage 객체에 대한 액세스로부터 객체 테이블에 대한 액세스를 분리합니다. 서비스 계정과 연결된 외부 연결은 Cloud Storage에 연결하는 데 사용되므로 사용자에게 객체 테이블에 대한 액세스 권한만 부여하면 됩니다. 이렇게 하면 행 수준 보안을 적용하고 사용자가 액세스할 수 있는 객체를 관리할 수 있습니다.
BigLake 외의 외부 테이블을 사용하면 외부 데이터 스토어에서 구조화된 데이터를 쿼리할 수 있습니다. BigLake 외의 외부 테이블을 쿼리하려면 외부 테이블과 외부 데이터 소스 모두에 대한 권한이 있어야 합니다. 예를 들어 Cloud Storage에서 데이터 소스를 사용하는 BigLake 외부 테이블을 쿼리하려면 다음 권한이 있어야 합니다.
통합 쿼리를 사용하면 쿼리 문을 AlloyDB, Spanner 또는 Cloud SQL 데이터베이스에 보내고 결과를 임시 테이블로 다시 가져올 수 있습니다. 통합 쿼리는 BigQuery Connection API를 사용하여 AlloyDB, Spanner 또는 Cloud SQL과의 연결을 설정합니다.
쿼리에서 EXTERNAL_QUERY 함수를 사용하여 쿼리 문을 외부 데이터베이스로 전송하며 이때 해당 데이터베이스의 SQL 언어를 사용합니다.
결과는 GoogleSQL 데이터 유형으로 변환됩니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[[["\u003cp\u003eExternal data sources allow querying data directly from outside of BigQuery storage, such as other Google Cloud databases, files in Cloud Storage, or other cloud products.\u003c/p\u003e\n"],["\u003cp\u003eBigQuery offers two primary mechanisms for querying external data: external tables, which store metadata in BigQuery but data externally, and federated queries, which send queries directly to databases like AlloyDB, Spanner, or Cloud SQL.\u003c/p\u003e\n"],["\u003cp\u003eExternal tables are categorized into BigLake tables, Object tables, and non-BigLake external tables, each with different functionalities and access delegation capabilities.\u003c/p\u003e\n"],["\u003cp\u003eBigLake tables provide access delegation through service accounts, enabling fine-grained security controls like row-level and column-level security, and support multi-cloud analysis with Amazon S3 and Azure Storage.\u003c/p\u003e\n"],["\u003cp\u003eFederated queries enable real-time querying of external databases using the \u003ccode\u003eEXTERNAL_QUERY\u003c/code\u003e function, converting results to GoogleSQL data types, and support connections through BigQuery Connection API.\u003c/p\u003e\n"]]],[],null,["# Introduction to external data sources\n=====================================\n\nThis page provides an overview of querying data stored outside of\nBigQuery.\n\nAn external data source is a data source that you can query directly from\nBigQuery, even though the data is not stored in\nBigQuery storage. For example, you might have data in a\ndifferent Google Cloud database, in files in Cloud Storage, or in a\ndifferent cloud product altogether that you would like to analyze in\nBigQuery, but that you aren't prepared to migrate.\n\nUse cases for external data sources include the following:\n\n- For extract-load-transform (ELT) workloads, loading and cleaning your data in one pass and writing the cleaned result into BigQuery storage, by using a `CREATE TABLE ... AS SELECT` query.\n- Joining BigQuery tables with frequently changing data from an external data source. By querying the external data source directly, you don't need to reload the data into BigQuery storage every time it changes.\n\nBigQuery has two different mechanisms for querying external\ndata: external tables and federated queries.\n\nExternal tables\n---------------\n\nExternal tables are similar to standard BigQuery tables, in\nthat these tables store their metadata and schema in BigQuery\nstorage. However, their data resides in an external source.\n\nExternal tables are contained inside a dataset, and you manage them in\nthe same way that you manage a standard\nBigQuery table. For example, you can\n[view the table's properties](/bigquery/docs/tables#get_information_about_tables),\n[set access controls](/bigquery/docs/table-access-controls), and so\nforth. You can query these tables and in most cases you can join them with\nother tables.\n\nThere are four kinds of external tables:\n\n- BigLake tables\n- BigQuery Omni tables\n- Object tables\n- Non-BigLake external tables\n\n### BigLake tables\n\nBigLake tables let you query structured data in\nexternal data stores with access delegation. Access delegation\ndecouples access to the BigLake table from access to\nthe underlying data store. An\n[external connection](/bigquery/docs/connections-api-intro)\nassociated with a service account is used to connect to the data store. Because\nthe service account handles retrieving data from the data store, you only have\nto grant users access to the BigLake table. This lets you enforce\nfine-grained security at the table level, including\n[row-level](/bigquery/docs/row-level-security-intro) and\n[column-level](/bigquery/docs/column-level-security-intro) security. For\nBigLake tables based on Cloud Storage, you can also use\n[dynamic data masking](/bigquery/docs/column-data-masking). To learn more about\nmulti-cloud analytic solutions using BigLake tables with\nAmazon S3 or Blob Storage data, see\n[BigQuery Omni](/bigquery/docs/omni-introduction).\n\nFor more information, see\n[Introduction to BigLake tables](/bigquery/docs/biglake-intro).\n\n### Object tables\n\nObject tables let you analyze unstructured data in\nCloud Storage. You can perform analysis with remote functions or\nperform inference by using BigQuery ML, and then join the results of\nthese operations with the rest of your structured data in BigQuery.\n\nLike BigLake tables, object tables use access delegation,\nwhich decouples access to the object table from access to the\nCloud Storage objects. An\n[external connection](/bigquery/docs/working-with-connections)\nassociated with a service account is used to connect to Cloud Storage,\nso you only have to grant users access to the object table. This lets you\nenforce [row-level](/bigquery/docs/row-level-security-intro) security and manage\nwhich objects users have access to.\n\nFor more information, see\n[Introduction to object tables](/bigquery/docs/object-table-introduction).\n\n### Non-BigLake external tables\n\nNon-BigLake external tables let you query structured data\nin external data stores. To query a non-BigLake external\ntable, you must have permissions to both the external table and the\nexternal data source. For example, to query a non-BigLake\nexternal table that uses a data source in Cloud Storage,\nyou must have the following permissions:\n\n- `bigquery.tables.getData`\n- `bigquery.jobs.create`\n- `storage.buckets.get`\n- `storage.objects.get`\n\nFor more information, see\n[Introduction to external tables](/bigquery/docs/external-tables).\n\nFederated queries\n-----------------\n\n\nFederated queries let you send a query statement to AlloyDB, Spanner, or Cloud SQL databases\nand get the result back as a temporary table. Federated queries use the\nBigQuery Connection API to establish a connection with AlloyDB, Spanner, or Cloud SQL.\nIn your query, you use the `EXTERNAL_QUERY` function to send a\nquery statement to the external database, using that database's SQL dialect.\nThe results are converted to GoogleSQL data types.\n\nFor more information, see\n[Introduction to federated queries](/bigquery/docs/federated-queries-intro).\n\nExternal data source feature comparison\n---------------------------------------\n\nThe following table compares the behavior of external data sources:\n\nWhat's next\n-----------\n\n- Learn more about [BigLake tables](/bigquery/docs/biglake-intro).\n- Learn more about [object tables](/bigquery/docs/object-table-introduction)\n- Learn more about [external tables](/bigquery/docs/external-tables).\n- Learn more about [federated queries](/bigquery/docs/federated-queries-intro).\n- Learn about [BigQuery pricing](/bigquery/pricing#on_demand_pricing)."]]