You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 11, 2022. It is now read-only.
When using raw SQL queries, _extractFromClause() fails to extract the project, dataset and table name from the FROM clause when using variables or when using FROM in a subquery.
Expected Behavior
Variables are interpolated before extracting the FROM clause and there are no API errors when using raw SQL queries with variables and/or subqueries.
Actual Behavior
Given a variable $source_table set as my_project.my_dataset.my_table:
SELECTCURRENT_TIMESTAMP() AStime,
SUM(cost) AS value
FROM`$source_table`WHERE
$__timeFilter(usage_start_time)
GROUP BY1ORDER BY1ASC
Also if using FROM in a subquery earlier in the SELECT clause for instance:
SELECTCURRENT_TIMESTAMP() AStime,
SUM(IFNULL((SELECTSUM(c.amount) FROM UNNEST(credits) c), 0)) AS value
FROM`$source_table`WHERE
$__timeFilter(usage_start_time)
GROUP BY1ORDER BY1ASC
Also could we have an option for disabling "fixing" the raw queries? I prefer adding the partition filter explicitly myself and not having the query altered in any way (aside from variable/macro interpolation).
Bug Report
When using raw SQL queries,
_extractFromClause()
fails to extract the project, dataset and table name from the FROM clause when using variables or when using FROM in a subquery.Expected Behavior
Variables are interpolated before extracting the FROM clause and there are no API errors when using raw SQL queries with variables and/or subqueries.
Actual Behavior
Given a variable
$source_table
set asmy_project.my_dataset.my_table
:results in this error:
Also if using FROM in a subquery earlier in the SELECT clause for instance:
results in this error:
Steps to Reproduce the Problem
Variable interpolation case:
source_table
set as the full table namesource_table
in the FROM clause (see example above)Subquery case:
Specifications
The text was updated successfully, but these errors were encountered: