0
votes

create or replace table test.sourav_part_test_1 partition by DATE(_PARTITIONTIME) as select *, _PARTITIONTIME as pt from test.sourav

showing error: "Unrecognized name: _PARTITIONTIME at [1:66]" i need the partition column name as _PARTITIONTIME

1

1 Answers

1
votes

Check out https://cloud.google.com/bigquery/docs/data-definition-language#partition_expression

PARTITION BY DATE(_PARTITIONTIME) — partitions the table using the date-based timestamp in the _PARTITIONTIME pseudo column. This syntax is only supported with CREATE TABLE without the AS query_statement clause.