title: Do SQL User-Defined Functions support SELECT clauses?
body: <p>The documentation for SQL-based UDFs is <a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/user-defined-functions#sql-udf-structure" rel="nofollow noreferrer">sparse</a>. I'm wondering if it's possible to write a full-fledged SELECT clause, using the UDF parameters in the query. So in effect, each invocation of the UDF would result in a subquery.</p>
  
  <p>Contrived example:</p>
  
  <pre><code>CREATE TEMP FUNCTION foo(bar STRING) AS (
  SELECT * FROM `example.latest` WHERE thing = bar
  );
  
  SELECT foo('abc')
  </code></pre>
  
  <p>BigQuery gives the error "Syntax error: Unexpected keyword SELECT; failed to parse CREATE [TEMP] FUNCTION statement" so I assume it's not possible, but would love to get confirmation.</p>