Skip to content

Commit 2f40fc5

Browse files
authored
feat: add more pseudocols to bq which are not expanded by star (#5509)
1 parent 964a275 commit 2f40fc5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sqlglot/dialects/bigquery.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,9 @@ class BigQuery(Dialect):
434434

435435
# The _PARTITIONTIME and _PARTITIONDATE pseudo-columns are not returned by a SELECT * statement
436436
# https://cloud.google.com/bigquery/docs/querying-partitioned-tables#query_an_ingestion-time_partitioned_table
437-
PSEUDOCOLUMNS = {"_PARTITIONTIME", "_PARTITIONDATE"}
437+
# https://cloud.google.com/bigquery/docs/querying-wildcard-tables#scanning_a_range_of_tables_using_table_suffix
438+
# https://cloud.google.com/bigquery/docs/query-cloud-storage-data#query_the_file_name_pseudo-column
439+
PSEUDOCOLUMNS = {"_PARTITIONTIME", "_PARTITIONDATE", "_TABLE_SUFFIX", "_FILE_NAME"}
438440

439441
# All set operations require either a DISTINCT or ALL specifier
440442
SET_OP_DISTINCT_BY_DEFAULT = dict.fromkeys((exp.Except, exp.Intersect, exp.Union), None)

0 commit comments

Comments
 (0)