Query -- SELECT partition_id from Mydataset.Table$__PARTITIONS_SUMMARY__
;
gives below error-- Table "Mydataset.Table$PARTITIONS_SUMMARY" cannot include decorator`
4
votes
2 Answers
6
votes
Try below in Legacy SQL
SELECT project_id,
dataset_id,
table_id,
partition_id,
TIMESTAMP(creation_time/1000) AS creation_time
FROM [Mydataset.Table$__PARTITIONS_SUMMARY__]
and below for Standard SQL
SELECT _PARTITIONTIME as pt
FROM `Mydataset.Table`
GROUP BY 1
which also works for Legacy SQL
SELECT _PARTITIONTIME as pt
FROM [Mydataset.Table]
GROUP BY 1