Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

BigQuery Multi-statement Queries with Temporary Functions, Console preview question

When performing multistatement queries that are preceded with a temporary function, the output window repeats the function instead of giving a better preview of what the statement was. 

 

For example if you do something like:

 

CREATE TEMP FUNCTION nu (buzz FLOAT64) AS (
  buzz
);

SELECT 1;

SELECT 1;

SELECT 1;

Untitled.jpg

The output pane shows the temp function prepended to the query whether or not the function was used, and even if it was used, these functions are often quite long... is there a way to sort of name the sub-query so we can see what we are selecting when we click "view results"? 

Solved Solved
0 3 780
1 ACCEPTED SOLUTION

Hi,

I don't think that is doable since the column name SQL showed what query was executed which was displayed in full. You can just click these icons instead to see the full query:

Poala_Tenorio_3-1676073157336.png

 

 

 

 

View solution in original post

3 REPLIES 3

Hi,

I don't think that is doable since the column name SQL showed what query was executed which was displayed in full. You can just click these icons instead to see the full query:

Poala_Tenorio_3-1676073157336.png

 

 

 

 

I see, the only workaround/feature that might then "fix" this would be if there was a way to "tag" each new statement in a multistatement query, so that "tag" appears in that section instead of the raw SQL code for it. Just an idea! Thank you for the answer. 

This is very much a bug, where the temp function definition is shown with every step not only in multi-statement queries, but also stored procedures with temp functions.

I guess it could be a feature, since it seems like the function has to be recreated for every step individually at execution. But from the point of view of the user, this information is irrelevant and should be omitted from the GUI as well as job logs.