Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pegjs/bigquery.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -2450,7 +2450,7 @@ over_partition
/ on_update_current_timestamp

aggr_fun_count
= name:KW_COUNT __ LPAREN __ arg:count_arg __ RPAREN __ bc:over_partition? {
= name:(KW_COUNT / 'string_agg'i) __ LPAREN __ arg:count_arg __ RPAREN __ bc:over_partition? {
return {
type: 'aggr_func',
name: name,
Expand Down
7 changes: 7 additions & 0 deletions test/bigquery.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,13 @@ describe('BigQuery', () => {
"CREATE OR REPLACE TEMP TABLE table1 DEFAULT COLLATE 'und:ci' PARTITION BY DATE(event_time) CLUSTER BY id OPTIONS (require_partition_filter = TRUE) AS SELECT table2.id, table2.value, table2.event_time FROM table2"
]
},
{
title: 'string_agg function',
sql: [
'SELECT string_agg(DISTINCT column1) as some_column1, string_agg(column2) as some_column1 from table1',
'SELECT string_agg(DISTINCT column1) AS some_column1, string_agg(column2) AS some_column1 FROM table1'
]
},
]

SQL_LIST.forEach(sqlInfo => {
Expand Down