Skip to content

[Bug]: 'Failed to copy Non partitioned table to Column partitioned table: not supported.' #38017

Closed

Description

@tomaslink

What happened?

I have a Python Dataflow streaming pipeline which reads from PubSub, does some processing, and writes to BigQuery. Using STORAGE_WRITE_API works fine but I'm trying to use FILE_LOADS to reduce costs, and I get the following exception:

Error message from worker: generic::unknown: Traceback (most recent call last):
  File "apache_beam/runners/common.py", line 1498, in apache_beam.runners.common.DoFnRunner.process
  File "apache_beam/runners/common.py", line 912, in apache_beam.runners.common.PerWindowInvoker.invoke_process
  File "apache_beam/runners/common.py", line 1057, in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
  File "/usr/local/lib/python3.12/site-packages/apache_beam/io/gcp/bigquery_file_loads.py", line 528, in process
    self.process_one(element, job_name_prefix)
  File "/usr/local/lib/python3.12/site-packages/apache_beam/io/gcp/bigquery_file_loads.py", line 575, in process_one
    self.bq_wrapper.wait_for_bq_job(job_reference, sleep_duration_sec=10)
  File "/usr/local/lib/python3.12/site-packages/apache_beam/io/gcp/bigquery_tools.py", line 690, in wait_for_bq_job
    raise RuntimeError(
RuntimeError: BigQuery job beam_bq_job_COPY_pipenmeafileloads_COPY_STEP_e2c58135db064a1e869f3633a7a1b037_0b8da1df1d54f6591407114d91108002 failed. Error Result: <ErrorProto
 message: 'Failed to copy Non partitioned table to Column partitioned table: not supported.'
 reason: 'invalid'>

I've done this successfully in the past, and I think it could be related to high volume of incoming messages.
I'm using DAY partitioning in the output table, and a triggering_frequency of 5 minutes. Does anyone know why this could be happening? Is there a set of parameters that could help resolve this issue?

Someone reported something similar here:
https://stackoverflow.com/questions/68556242/pub-sub-to-bigquery-batch-using-dataflow-python

Thanks.

Issue Priority

Priority: 2 (default / most bugs should be filed as P2)

Issue Components

  • Component: Python SDK
  • Component: Java SDK
  • Component: Go SDK
  • Component: Typescript SDK
  • Component: IO connector
  • Component: Beam YAML
  • Component: Beam examples
  • Component: Beam playground
  • Component: Beam katas
  • Component: Website
  • Component: Infrastructure
  • Component: Spark Runner
  • Component: Flink Runner
  • Component: Samza Runner
  • Component: Twister2 Runner
  • Component: Hazelcast Jet Runner
  • Component: Google Cloud Dataflow Runner

Activity

  1. apanich commented on Apr 3, 2026

    @apanich
    Contributor

    I think you get "Failed to copy Non partitioned table to Column partitioned table: not supported" when FILE_LOADS tries to load a large volume of data into your DAY-partitioned BigQuery table via additional copy to temp non-partitioned table. And this is probably what cases the error (on small data size no need to copy to temp non-partitioned table). So assuming you wan to keep using FILE_LOADS you would rather change triggering_frequency to lower value (sorry cannot give you right value, might need to play with it).

    One more alternative is to set withNumFileShards() - forcing it lower, maybe can help to keep direct copy. But I would not pursue this option - requires even more tuning to get good results.

    Finally please keep in mind that STORAGE_WRITE_API is the recommended way (while in some cases it is less cost effective, yet it is more reliable)

  2. tomaslink commented on Apr 6, 2026

    @tomaslink
    Author

    I think you get "Failed to copy Non partitioned table to Column partitioned table: not supported" when FILE_LOADS tries to load a large volume of data into your DAY-partitioned BigQuery table via additional copy to temp non-partitioned table. And this is probably what cases the error (on small data size no need to copy to temp non-partitioned table). So assuming you wan to keep using FILE_LOADS you would rather change triggering_frequency to lower value (sorry cannot give you right value, might need to play with it).

    One more alternative is to set withNumFileShards() - forcing it lower, maybe can help to keep direct copy. But I would not pursue this option - requires even more tuning to get good results.

    Finally please keep in mind that STORAGE_WRITE_API is the recommended way (while in some cases it is less cost effective, yet it is more reliable)

    @apanich Thanks!

    Yes, I know STORAGE_WRITE_API is the recommended way, and it works well for me. But it is too expensive for our use case.
    I will try to play with those parameters.

  3. tomaslink commented on Apr 6, 2026

    @tomaslink
    Author

    @apanich Reducing triggering_frequency to 60 seconds helped temporarily, but the issue started occurring again after a while. I’m concerned that lowering it further could cause us to hit the daily job quota.

  4. ahmedabu98 commented on Apr 13, 2026

    @ahmedabu98
    Contributor

    Hey @tomaslink, the BQ sink takes the copy job route when it accumulates either 10K files or 15TB of data (check here).

    If the time interval is just 60seconds and it still triggers copy jobs, my guess is we're just creating too many files. Can you try reducing max_files_per_bundle (default is 20) ? That will reduce the number of writers created per bundle and hopefully get you below the 10K limit

  5. tomaslink commented on Apr 14, 2026

    @tomaslink
    Author

    Hey @tomaslink, the BQ sink takes the copy job route when it accumulates either 10K files or 15TB of data (check here).

    If the time interval is just 60seconds and it still triggers copy jobs, my guess is we're just creating too many files. Can you try reducing max_files_per_bundle (default is 20) ? That will reduce the number of writers created per bundle and hopefully get you below the 10K limit

    @ahmedabu98 Hi! Thanks for the suggestion, I will try it.

  6. added this to the 2.76.0 Release milestone on Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions