I recently got an alert that several events in a Datastream Stream were discarded because streaming to a BQ table partition more than 5 years in the past is not supported. I paused the stream and created non-partitioned BQ tables with the same schema, and then loaded the original tables' data into them. However, now I'm not able to rename the old tables so I can use the original names for the non-partitioned tables and restart the steam. When I attempt an `ALTER TABLE ... RENAME TO` command, I get this error:
```
Invalid value: Cannot rename project:dataset.tablename because it has streaming data. at [1:1]
```
I paused the Stream 3 days ago, and I'm still getting this message. What is the right way to rename a table Datastream has streamed to historically, or alert BQ that there is no more data in the streaming buffer? Do I need to delete the Datastream info columns? I'm wary of creating a new stream and potentially losing the record of progress for what has already been written to BQ from the current Stream.
Hi @lorenh,
The error Cannot rename <dataset.table> because it has streaming data
happens due to a known limitation when renaming BigQuery tables which have data streaming into them. To troubleshoot, follow these steps:
Draining
to Paused.
If these steps didn’t resolve the issue, you can also try the following workaround instead of renaming a table:
For now, I recommend to +1 yourself to the public tracker issue, subscribe for updates, and add a comment with a summary of the issue, screenshots of your logs, and other errors you might have received. Our team may sometimes ask for more details, clarification, or a follow up. Since this is a developing issue, there isn’t a specific time-frame for its resolution. However, once we've fixed the issue, we'll indicate this on the bug and provide a resolution or workarounds if available.
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.