bqquery\--use_legacy_sql=false\--destination_table='my_table$20160501'\--append_table=true\'SELECT * FROM my_dataset.another_table'
수집 시간으로 파티션 나누기를 사용하면 이 기법으로 데이터가 원래 생성된 시간에 해당하는 이전 데이터를 파티션에 로드할 수 있습니다.
이 기법을 사용하여 시간대를 조정할 수도 있습니다. 기본적으로 수집 시간 파티션은 UTC 시간을 따릅니다. 파티션 시간을 특정 시간대와 일치시키려면 파티션 데코레이터를 사용하여 UTC 수집 시간을 상쇄하면 됩니다. 예를 들어 태평양 표준시(PST)를 사용하는 경우에는 2016년 5월 1일 PST에 생성된 데이터를 해당 파티션 데코레이터 $20160501을 사용하여 해당 날짜의 파티션에 로드할 수 있습니다.
시간 단위 열과 정수 범위로 파티션을 나눈 테이블의 경우 데코레이터에 지정된 파티션 ID가 작성 중인 데이터와 일치해야 합니다. 예를 들어 DATE 열에서 테이블 파티션을 나눈 경우 데코레이터가 해당 열의 값과 일치해야 합니다. 그렇지 않으면 오류가 발생합니다. 그러나 데이터가 단일 파티션에 있음을 미리 알고 있는 경우 파티션 데코레이터를 지정하면 쓰기 성능을 향상시킬 수 있습니다.
앞의 예시에서는 데이터를 파티션에 추가합니다. 파티션의 데이터를 덮어쓰려면 각 명령어에 서로 다른 플래그(bq load --replace=true ... 및 bq query --append_table=false ...)를 포함해야 합니다.
이러한 명령어의 플래그에 대한 자세한 내용은 bq load 및 bq query를 참조하세요.
[[["이해하기 쉬움","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-02-11(UTC)"],[[["Data can be loaded into a specific partition of a table using the `bq load` command with a partition decorator, such as `$20160501` for the May 1, 2016 partition."],["Query results can be written to a specific partition by using the `bq query` command and specifying the destination table with a partition decorator, along with appropriate flags."],["Partition decorators can be used with ingestion-time partitioning to load older data into the correct partition or to adjust for time zone differences, by loading the data into a partition reflecting the correct time."],["For time-unit column and integer-range partitioned tables, the partition ID specified in the decorator must align with the data being written to avoid errors, although it can improve write performance."],["Data can be appended or overwritten in a partition by adjusting `bq load` or `bq query` flags."]]],[]]