I tried to write data into my integer range partitioned table and I used this article like my reference. In fact, my table has two columns: customer_id (INT) and product_name (STRING), so I used customer_id as a field to partition. On the other hand, the article I've read says:
For streaming, data in the streaming buffer is in the UNPARTITIONED partition. When the data is extracted, it initially stays in the UNPARTITIONED partition. When there is enough unpartitioned data, it will be repartitioned into the specific partitions.
The sentence When there is enough unpartitioned data really confuses me because I don't know how many data rows is "enough" in this context, like 5000 rows or 10000 rows?. Do we have any chance to know that please?
In my demo, at the beginning, my table was empty so I streamed 4000 rows (same customer_id for these 4000 rows) into my table, and I waited until my data is out of streaming buffer (actually I waited until the Streaming buffer statistics disappear in the Details of my table), then, I used this query to know how many partition I have:
#legacySQL
select table_id, partition_id
from [mydataset.customer_product$__PARTITIONS_SUMMARY__]
And the result is:
|---------------------|------------------|
| table_id | partition_id |
|---------------------|------------------|
| customer_product |__UNPARTITIONED__ |
|---------------------|------------------|
So what is the problem, please?
Moreover, if I overwrite my table, via this query below and some settings of Query settings,
-- change some settings in Query settings to overwrite the table
select *
from mydataset.customer_product
and I'll get: (19265786 is the customer_id for 4000 data rows)
|---------------------|------------------|
| table_id | partition_id |
|---------------------|------------------|
| customer_product | 19265786 |
|---------------------|------------------|
So I have one partition which is good but I have no idea why, please? Could you guys please explain to me this problem?