INFORMATION_SCHEMA.TABLE_OPTIONS 뷰에는 데이터 세트의 각 테이블 또는 뷰당 각 옵션당 하나의 행이 포함됩니다. TABLES 및 TABLE_OPTIONS 뷰에는 뷰에 대한 대략적인 정보도 포함되어 있습니다.
자세한 정보를 보려면 INFORMATION_SCHEMA.VIEWS 뷰를 쿼리하세요.
필수 권한
INFORMATION_SCHEMA.TABLE_OPTIONS 뷰를 쿼리하려면 다음 Identity and Access Management(IAM) 권한이 필요합니다.
네임스페이스화된 <키, 값> 문법의 테이블에 연결된 태그.
자세한 내용은 태그 및 조건부 액세스를 참조하세요.
외부 테이블에 다음 옵션을 사용할 수 있습니다.
옵션
allow_jagged_rows
BOOL
true이면 뒤에 오는 선택적인 열이 누락된 행을 허용합니다.
CSV 데이터에 적용됩니다.
allow_quoted_newlines
BOOL
true이면 파일에서 따옴표 안에 줄바꿈 문자가 포함된 데이터 섹션을 허용합니다.
CSV 데이터에 적용됩니다.
bigtable_options
STRING
Bigtable 외부 테이블을 만들 때만 필요합니다.
Bigtable 외부 테이블의 스키마를 JSON 형식으로 지정합니다.
Bigtable 테이블 정의 옵션의 목록은 REST API 참조에서 BigtableOptions를 참조하세요.
column_name_character_map
STRING
지원되는 열 이름 문자 범위 및 지원되지 않는 문자의 처리 동작을 정의합니다. 기본 설정은 STRICT입니다. 즉, 지원되지 않는 문자가 있으면 BigQuery에서 오류가 발생합니다.
V1 및 V2는 지원되지 않는 문자를 밑줄로 대체합니다.
지원되는 값은 다음과 같습니다.
STRICT. 유연한 열 이름을 사용 설정합니다.
기본값입니다. 열 이름에 지원되지 않는 문자가 포함된 작업을 로드하면 오류 메시지와 함께 실패합니다. 로드 작업이 성공하도록 지원되지 않는 문자를 밑줄로 바꾸도록 구성하려면 default_column_name_character_map 구성 설정을 지정합니다.
V1. 열 이름에는 표준 열 이름 문자만 포함할 수 있습니다.
지원되지 않는 문자는 밑줄로 대체됩니다.
이는 column_name_character_map이 도입되기 전에 생성된 테이블의 기본 동작입니다.
true이면 Avro 논리 유형을 해당 SQL 유형으로 변환합니다. 자세한 내용은 논리 유형을 참조하세요.
Avro 데이터에 적용됩니다.
encoding
STRING
데이터의 문자 인코딩입니다. 지원되는 값은 UTF8(또는 UTF-8), ISO_8859_1(또는 ISO-8859-1)입니다.
CSV 데이터에 적용됩니다.
enum_as_string
BOOL
true이면 기본적으로 BYTES 대신 Parquet ENUM 논리 유형을 STRING으로 추론합니다.
Parquet 데이터에 적용됩니다.
expiration_timestamp
TIMESTAMP
이 테이블이 만료되는 시간입니다. 지정하지 않으면 테이블이 만료되지 않습니다.
예: "2025-01-01 00:00:00 UTC"
field_delimiter
STRING
CSV 파일의 필드 구분 기호입니다.
CSV 데이터에 적용됩니다.
format
STRING
외부 데이터의 형식입니다.
CREATE EXTERNAL TABLE의 지원 값으로는 AVRO, CLOUD_BIGTABLE, CSV, DATASTORE_BACKUP, DELTA_LAKE(미리보기), GOOGLE_SHEETS, NEWLINE_DELIMITED_JSON(또는 JSON), ORC, PARQUET 등이 있습니다.
LOAD DATA의 지원 값으로는 AVRO, CSV, DELTA_LAKE(미리보기), NEWLINE_DELIMITED_JSON(또는 JSON), ORC, PARQUET 등이 있습니다.
값 JSON은 NEWLINE_DELIMITED_JSON과 동일합니다.
hive_partition_uri_prefix
STRING
파티션 키 인코딩이 시작되기 전에 모든 소스 URI의 공통 프리픽스입니다. 파티션을 나눈 하이브 외부 테이블에만 적용됩니다.
Avro, CSV, JSON, Parquet, ORC 데이터에 적용됩니다.
예: "gs://bucket/path"
file_set_spec_type
STRING
로드 작업 및 외부 테이블의 소스 URI를 해석하는 방법을 지정합니다.
지원되는 값은 다음과 같습니다.
FILE_SYSTEM_MATCH. 객체 저장소의 파일을 나열하여 소스 URI를 확장합니다. FileSetSpecType이 설정되지 않은 경우의 기본 동작입니다.
NEW_LINE_DELIMITED_MANIFEST. 제공된 URI가 줄바꿈으로 구분된 매니페스트 파일이며 한 줄에 URI가 하나씩 있음을 나타냅니다. 매니페스트 파일에서 와일드 카드 URI가 지원되지 않으며 모든 참조된 데이터 파일은 매니페스트 파일과 동일한 버킷에 있어야 합니다.
예를 들어 소스 URI가 "gs://bucket/path/file"이고 file_set_spec_type이 FILE_SYSTEM_MATCH인 경우 파일은 데이터 파일로 직접 사용됩니다. file_set_spec_type이 NEW_LINE_DELIMITED_MANIFEST면 파일의 각 줄이 데이터 파일을 가리키는 URI로 해석됩니다.
ignore_unknown_values
BOOL
true인 경우 오류를 반환하지 않고 테이블 스키마에 표시되지 않는 추가 값을 무시합니다.
CSV 및 JSON 데이터에 적용됩니다.
json_extension
STRING
JSON 데이터의 경우 특정 JSON 교환 형식을 나타냅니다. 지정되지 않은 경우 BigQuery는 데이터를 일반 JSON 레코드로 읽습니다.
테이블에 대한 작업에서 캐시된 메타데이터를 사용할지 여부와 작업이 사용하기 위해 캐시된 메타데이터가 얼마나 최신이어야 하는지를 지정합니다.
메타데이터 캐싱을 사용 중지하려면 0을 지정합니다. 이 값이 기본값입니다.
메타데이터 캐싱을 사용 설정하려면 30분에서 7일 사이의 간격 리터럴 값을 지정합니다. 예를 들어 4시간 비활성 간격에는 INTERVAL 4 HOUR를 지정합니다.
이 값을 사용하면 지난 4시간 이내에 새로고침된 경우 테이블에 대한 작업이 캐시된 메타데이터를 사용합니다. 캐시된 메타데이터가 이보다 오래된 경우 작업이 Cloud Storage에서 메타데이터를 대신 검색하도록 되돌아갑니다.
이 뷰에 대한 쿼리에는 데이터 세트나 리전 한정자가 포함되어야 합니다. 데이터 세트 한정자가 있는 쿼리에는 데이터 세트에 대한 권한이 있어야 합니다.
리전 한정자가 있는 쿼리에는 프로젝트에 대한 권한이 있어야 합니다.
자세한 내용은 구문을 참조하세요.
다음 표에서는 이 뷰의 리전 범위와 리소스 범위를 설명합니다.
DATASET_ID: 데이터 세트의 ID입니다. 자세한 내용은 데이터 세트 한정자를 참조하세요.
예
예 1:
다음 예시에서는 INFORMATION_SCHEMA.TABLE_OPTIONS 뷰를 쿼리하여 기본 프로젝트(myproject)의 mydataset에 있는 모든 테이블의 기본 테이블 만료 시간을 검색합니다.
기본 프로젝트가 아닌 프로젝트에 쿼리를 실행하려면 프로젝트 ID를 `project_id`.dataset.INFORMATION_SCHEMA.view 형식으로 데이터 세트에 추가합니다(예: `myproject`.mydataset.INFORMATION_SCHEMA.TABLE_OPTIONS).
다음 예시는 테스트 데이터가 포함된 mydataset의 모든 테이블에 대한 메타데이터를 검색합니다. 이 쿼리는 description 옵션의 값을 사용하여 설명의 아무 곳에서나 'test'가 포함된 테이블을 찾습니다. mydataset는 기본 프로젝트 myproject에 있습니다.
기본 프로젝트가 아닌 프로젝트에 쿼리를 실행하려면 프로젝트 ID를 `project_id`.dataset.INFORMATION_SCHEMA.view 형식으로 데이터 세트에 추가합니다(예: `myproject`.mydataset.INFORMATION_SCHEMA.TABLE_OPTIONS).
[[["이해하기 쉬움","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-03-06(UTC)"],[[["\u003cp\u003eThe \u003ccode\u003eINFORMATION_SCHEMA.TABLE_OPTIONS\u003c/code\u003e view provides detailed information about each option for every table or view within a dataset, with one row per option.\u003c/p\u003e\n"],["\u003cp\u003eTo query the \u003ccode\u003eINFORMATION_SCHEMA.TABLE_OPTIONS\u003c/code\u003e view, you need specific IAM permissions, including \u003ccode\u003ebigquery.tables.get\u003c/code\u003e, \u003ccode\u003ebigquery.tables.list\u003c/code\u003e, \u003ccode\u003ebigquery.routines.get\u003c/code\u003e, and \u003ccode\u003ebigquery.routines.list\u003c/code\u003e, which are included in roles such as \u003ccode\u003eroles/bigquery.admin\u003c/code\u003e, \u003ccode\u003eroles/bigquery.dataViewer\u003c/code\u003e, and \u003ccode\u003eroles/bigquery.metadataViewer\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe schema for \u003ccode\u003eINFORMATION_SCHEMA.TABLE_OPTIONS\u003c/code\u003e includes columns such as \u003ccode\u003eTABLE_CATALOG\u003c/code\u003e, \u003ccode\u003eTABLE_SCHEMA\u003c/code\u003e, \u003ccode\u003eTABLE_NAME\u003c/code\u003e, \u003ccode\u003eOPTION_NAME\u003c/code\u003e, \u003ccode\u003eOPTION_TYPE\u003c/code\u003e, and \u003ccode\u003eOPTION_VALUE\u003c/code\u003e, which together describe the project, dataset, table/view, option name, its type, and its value.\u003c/p\u003e\n"],["\u003cp\u003eThis view details various options for tables, including metadata like \u003ccode\u003edescription\u003c/code\u003e, \u003ccode\u003eexpiration_timestamp\u003c/code\u003e, and \u003ccode\u003efriendly_name\u003c/code\u003e, as well as specific settings for external tables such as \u003ccode\u003eallow_jagged_rows\u003c/code\u003e, \u003ccode\u003ecompression\u003c/code\u003e, \u003ccode\u003eformat\u003c/code\u003e, and \u003ccode\u003emax_bad_records\u003c/code\u003e, among others.\u003c/p\u003e\n"],["\u003cp\u003eQueries against this view require either a dataset or a region qualifier, with necessary permissions for the dataset or project depending on the qualifier used.\u003c/p\u003e\n"]]],[],null,["# TABLE_OPTIONS view\n==================\n\nThe `INFORMATION_SCHEMA.TABLE_OPTIONS` view contains one row for each option,\nfor each table or view in a dataset. The `TABLES`\nand `TABLE_OPTIONS` views also contain high-level information about views.\nFor detailed information, query the\n[`INFORMATION_SCHEMA.VIEWS`](/bigquery/docs/information-schema-views) view.\n\nRequired permissions\n--------------------\n\nTo query the `INFORMATION_SCHEMA.TABLE_OPTIONS` view, you need the following\nIdentity and Access Management (IAM) permissions:\n\n- `bigquery.tables.get`\n- `bigquery.tables.list`\n- `bigquery.routines.get`\n- `bigquery.routines.list`\n\nEach of the following predefined IAM roles includes the preceding\npermissions:\n\n- `roles/bigquery.admin`\n- `roles/bigquery.dataViewer`\n- `roles/bigquery.metadataViewer`\n\nFor more information about BigQuery permissions, see\n[Access control with IAM](/bigquery/docs/access-control).\n\nSchema\n------\n\nWhen you query the `INFORMATION_SCHEMA.TABLE_OPTIONS` view, the query results\ncontain one row for each option, for each table or view in a dataset. For\ndetailed information about\nviews, query the\n[`INFORMATION_SCHEMA.VIEWS` view](/bigquery/docs/information-schema-views)\ninstead.\n\nThe `INFORMATION_SCHEMA.TABLE_OPTIONS` view has the following schema:\n\n##### Options table\n\nFor external tables, the following options are possible:\n\nScope and syntax\n----------------\n\nQueries against this view must include a dataset or a region qualifier. For\nqueries with a dataset qualifier, you must have permissions for the dataset.\nFor queries with a region qualifier, you must have permissions for the project.\nFor more\ninformation see [Syntax](/bigquery/docs/information-schema-intro#syntax).\nThe following table explains the region and resource scopes for this view:\n\nReplace the following:\n\n- Optional: \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of your Google Cloud project. If not specified, the default project is used.\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: any [dataset region name](/bigquery/docs/locations). For example, ```region-us```.\n- \u003cvar translate=\"no\"\u003eDATASET_ID\u003c/var\u003e: the ID of your dataset. For more information, see [Dataset qualifier](/bigquery/docs/information-schema-intro#dataset_qualifier).\n\n \u003cbr /\u003e\n\n \u003cbr /\u003e\n\n | **Note:** You must use [a region qualifier](/bigquery/docs/information-schema-intro#region_qualifier) to query `INFORMATION_SCHEMA` views. The location of the query execution must match the region of the `INFORMATION_SCHEMA` view.\n\n\u003cbr /\u003e\n\nExample\n-------\n\n##### Example 1:\n\nThe following example retrieves the default table expiration times for all\ntables in `mydataset` in your default project (`myproject`) by querying the\n`INFORMATION_SCHEMA.TABLE_OPTIONS` view.\n\nTo run the query against a project other than your default project, add the\nproject ID to the dataset in the following format:\n```````\u003cvar translate=\"no\"\u003eproject_id\u003c/var\u003e````.```\u003cvar translate=\"no\"\u003edataset\u003c/var\u003e```.INFORMATION_SCHEMA.```\u003cvar translate=\"no\"\u003eview\u003c/var\u003e;\nfor example, ```myproject`.mydataset.INFORMATION_SCHEMA.TABLE_OPTIONS``.\n**Note:** `INFORMATION_SCHEMA` view names are case-sensitive. \n\n```googlesql\n SELECT\n *\n FROM\n mydataset.INFORMATION_SCHEMA.TABLE_OPTIONS\n WHERE\n option_name = 'expiration_timestamp';\n```\n\nThe result is similar to the following:\n\n\u003cbr /\u003e\n\n```\n +----------------+---------------+------------+----------------------+-------------+--------------------------------------+\n | table_catalog | table_schema | table_name | option_name | option_type | option_value |\n +----------------+---------------+------------+----------------------+-------------+--------------------------------------+\n | myproject | mydataset | mytable1 | expiration_timestamp | TIMESTAMP | TIMESTAMP \"2020-01-16T21:12:28.000Z\" |\n | myproject | mydataset | mytable2 | expiration_timestamp | TIMESTAMP | TIMESTAMP \"2021-01-01T21:12:28.000Z\" |\n +----------------+---------------+------------+----------------------+-------------+--------------------------------------+\n \n```\n\n\u003cbr /\u003e\n\n| **Note:** Tables without an expiration time are excluded from the query results.\n\n##### Example 2:\n\nThe following example retrieves metadata about all tables in `mydataset` that\ncontain test data. The query uses the values in the `description` option to find\ntables that contain \"test\" anywhere in the description. `mydataset` is in your\ndefault project --- `myproject`.\n\nTo run the query against a project other than your default project, add the\nproject ID to the dataset in the following format:\n```````\u003cvar translate=\"no\"\u003eproject_id\u003c/var\u003e````.```\u003cvar translate=\"no\"\u003edataset\u003c/var\u003e```.INFORMATION_SCHEMA.```\u003cvar translate=\"no\"\u003eview\u003c/var\u003e;\nfor example,\n```myproject`.mydataset.INFORMATION_SCHEMA.TABLE_OPTIONS``. \n\n```googlesql\n SELECT\n *\n FROM\n mydataset.INFORMATION_SCHEMA.TABLE_OPTIONS\n WHERE\n option_name = 'description'\n AND option_value LIKE '%test%';\n```\n\nThe result is similar to the following:\n\n\u003cbr /\u003e\n\n```\n +----------------+---------------+------------+-------------+-------------+--------------+\n | table_catalog | table_schema | table_name | option_name | option_type | option_value |\n +----------------+---------------+------------+-------------+-------------+--------------+\n | myproject | mydataset | mytable1 | description | STRING | \"test data\" |\n | myproject | mydataset | mytable2 | description | STRING | \"test data\" |\n +----------------+---------------+------------+-------------+-------------+--------------+\n \n```\n\n\u003cbr /\u003e"]]