Incompatible table partitioning specification when copying to the column partitioned table
-
반응형
embulk plugin에서 embulk-output-bigquery부분에서 아래와 같은 오류가 날 때 해결 방법에 대해서 적어 봤습니다.
Incompatible table partitioning specification when copying to the column partitioned table
위의 오류는 mysql -> big query로 갈 때 big query 쪽에 이미 partition이 되어 있는 경우 발생하였습니다. 상황에 따라서 다양하게 발생하는 것으로 보이는데 저의 경우 위의 상황으로 발생하였습니다.
관련해서 embulk plugin 쪽에 내용을 보면 다음과 같이 표기되어 있습니다.
아래의 내용은 mode에서 replace를 사용할 때 관련된 내용인 거 같은데, 사실 해결 방법과 별 상관이 없는 듯합니다...
replace
Load to temporary table (Create and WRITE_APPEND in parallel)
Copy temporary table to destination table (or partition). (WRITE_TRUNCATE)
is_skip_job_result_check must be false when replace mode
NOTE: BigQuery does not support replacing (actually, copying into) a non-partitioned table with a paritioned table atomically. You must once delete the non-partitioned table, otherwise, you get Incompatible table partitioning specification when copying to the column partitioned table error.
제가 힌트를 얻은 부분은 일본어 사이트에서 힌트를 얻었습니다.
구글 번역으로 돌려봤는데, input에서 partion으로 잡은 날짜(timestamp)를 정상적으로 읽었으나 output으로 갈 때는 그러지 못하는 듯하다는 내용입니다. 그래서 강제로 output에서 받을 때 이 칼럼을 날짜(timestamp)로 인식하도록 지정하여서 해결하였습니다.