summaryrefslogtreecommitdiffstats
path: root/docs/sqlglot/dialects/bigquery.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/sqlglot/dialects/bigquery.html')
-rw-r--r--docs/sqlglot/dialects/bigquery.html1425
1 files changed, 746 insertions, 679 deletions
diff --git a/docs/sqlglot/dialects/bigquery.html b/docs/sqlglot/dialects/bigquery.html
index 761adb6..47969bb 100644
--- a/docs/sqlglot/dialects/bigquery.html
+++ b/docs/sqlglot/dialects/bigquery.html
@@ -69,6 +69,9 @@
<li>
<a class="function" href="#BigQuery.Generator.intersect_op">intersect_op</a>
</li>
+ <li>
+ <a class="function" href="#BigQuery.Generator.with_properties">with_properties</a>
+ </li>
</ul>
</li>
@@ -139,277 +142,294 @@
</span><span id="L-39"><a href="#L-39"><span class="linenos"> 39</span></a>
</span><span id="L-40"><a href="#L-40"><span class="linenos"> 40</span></a><span class="k">def</span> <span class="nf">_derived_table_values_to_unnest</span><span class="p">(</span><span class="bp">self</span><span class="p">:</span> <span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Values</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
</span><span id="L-41"><a href="#L-41"><span class="linenos"> 41</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> <span class="n">exp</span><span class="o">.</span><span class="n">From</span><span class="p">):</span>
-</span><span id="L-42"><a href="#L-42"><span class="linenos"> 42</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">t</span><span class="o">.</span><span class="n">cast</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">Values</span><span class="p">,</span> <span class="n">transforms</span><span class="o">.</span><span class="n">remove_precision_parameterized_types</span><span class="p">(</span><span class="n">expression</span><span class="p">))</span>
-</span><span id="L-43"><a href="#L-43"><span class="linenos"> 43</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">values_sql</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span>
-</span><span id="L-44"><a href="#L-44"><span class="linenos"> 44</span></a> <span class="n">rows</span> <span class="o">=</span> <span class="p">[</span><span class="n">tuple_exp</span><span class="o">.</span><span class="n">expressions</span> <span class="k">for</span> <span class="n">tuple_exp</span> <span class="ow">in</span> <span class="n">expression</span><span class="o">.</span><span class="n">find_all</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">Tuple</span><span class="p">)]</span>
-</span><span id="L-45"><a href="#L-45"><span class="linenos"> 45</span></a> <span class="n">structs</span> <span class="o">=</span> <span class="p">[]</span>
-</span><span id="L-46"><a href="#L-46"><span class="linenos"> 46</span></a> <span class="k">for</span> <span class="n">row</span> <span class="ow">in</span> <span class="n">rows</span><span class="p">:</span>
-</span><span id="L-47"><a href="#L-47"><span class="linenos"> 47</span></a> <span class="n">aliases</span> <span class="o">=</span> <span class="p">[</span>
-</span><span id="L-48"><a href="#L-48"><span class="linenos"> 48</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">alias_</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">column_name</span><span class="p">)</span>
-</span><span id="L-49"><a href="#L-49"><span class="linenos"> 49</span></a> <span class="k">for</span> <span class="n">value</span><span class="p">,</span> <span class="n">column_name</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">row</span><span class="p">,</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">&quot;alias&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">&quot;columns&quot;</span><span class="p">])</span>
-</span><span id="L-50"><a href="#L-50"><span class="linenos"> 50</span></a> <span class="p">]</span>
-</span><span id="L-51"><a href="#L-51"><span class="linenos"> 51</span></a> <span class="n">structs</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">Struct</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="n">aliases</span><span class="p">))</span>
-</span><span id="L-52"><a href="#L-52"><span class="linenos"> 52</span></a> <span class="n">unnest_exp</span> <span class="o">=</span> <span class="n">exp</span><span class="o">.</span><span class="n">Unnest</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="p">[</span><span class="n">exp</span><span class="o">.</span><span class="n">Array</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="n">structs</span><span class="p">)])</span>
-</span><span id="L-53"><a href="#L-53"><span class="linenos"> 53</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">unnest_sql</span><span class="p">(</span><span class="n">unnest_exp</span><span class="p">)</span>
-</span><span id="L-54"><a href="#L-54"><span class="linenos"> 54</span></a>
+</span><span id="L-42"><a href="#L-42"><span class="linenos"> 42</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">values_sql</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span>
+</span><span id="L-43"><a href="#L-43"><span class="linenos"> 43</span></a>
+</span><span id="L-44"><a href="#L-44"><span class="linenos"> 44</span></a> <span class="n">structs</span> <span class="o">=</span> <span class="p">[</span>
+</span><span id="L-45"><a href="#L-45"><span class="linenos"> 45</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Struct</span><span class="p">(</span>
+</span><span id="L-46"><a href="#L-46"><span class="linenos"> 46</span></a> <span class="n">expressions</span><span class="o">=</span><span class="p">[</span>
+</span><span id="L-47"><a href="#L-47"><span class="linenos"> 47</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">alias_</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">column_name</span><span class="p">)</span>
+</span><span id="L-48"><a href="#L-48"><span class="linenos"> 48</span></a> <span class="k">for</span> <span class="n">value</span><span class="p">,</span> <span class="n">column_name</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span>
+</span><span id="L-49"><a href="#L-49"><span class="linenos"> 49</span></a> <span class="n">t</span><span class="o">.</span><span class="n">expressions</span><span class="p">,</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">&quot;alias&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">&quot;columns&quot;</span><span class="p">]</span>
+</span><span id="L-50"><a href="#L-50"><span class="linenos"> 50</span></a> <span class="p">)</span>
+</span><span id="L-51"><a href="#L-51"><span class="linenos"> 51</span></a> <span class="p">]</span>
+</span><span id="L-52"><a href="#L-52"><span class="linenos"> 52</span></a> <span class="p">)</span>
+</span><span id="L-53"><a href="#L-53"><span class="linenos"> 53</span></a> <span class="k">for</span> <span class="n">t</span> <span class="ow">in</span> <span class="n">expression</span><span class="o">.</span><span class="n">find_all</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">Tuple</span><span class="p">)</span>
+</span><span id="L-54"><a href="#L-54"><span class="linenos"> 54</span></a> <span class="p">]</span>
</span><span id="L-55"><a href="#L-55"><span class="linenos"> 55</span></a>
-</span><span id="L-56"><a href="#L-56"><span class="linenos"> 56</span></a><span class="k">def</span> <span class="nf">_returnsproperty_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">:</span> <span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">ReturnsProperty</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
-</span><span id="L-57"><a href="#L-57"><span class="linenos"> 57</span></a> <span class="n">this</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">this</span>
-</span><span id="L-58"><a href="#L-58"><span class="linenos"> 58</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">this</span><span class="p">,</span> <span class="n">exp</span><span class="o">.</span><span class="n">Schema</span><span class="p">):</span>
-</span><span id="L-59"><a href="#L-59"><span class="linenos"> 59</span></a> <span class="n">this</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="n">this</span><span class="o">.</span><span class="n">this</span><span class="si">}</span><span class="s2"> &lt;</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">expressions</span><span class="p">(</span><span class="n">this</span><span class="p">)</span><span class="si">}</span><span class="s2">&gt;&quot;</span>
-</span><span id="L-60"><a href="#L-60"><span class="linenos"> 60</span></a> <span class="k">else</span><span class="p">:</span>
-</span><span id="L-61"><a href="#L-61"><span class="linenos"> 61</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">this</span><span class="p">)</span>
-</span><span id="L-62"><a href="#L-62"><span class="linenos"> 62</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">&quot;RETURNS </span><span class="si">{</span><span class="n">this</span><span class="si">}</span><span class="s2">&quot;</span>
-</span><span id="L-63"><a href="#L-63"><span class="linenos"> 63</span></a>
-</span><span id="L-64"><a href="#L-64"><span class="linenos"> 64</span></a>
-</span><span id="L-65"><a href="#L-65"><span class="linenos"> 65</span></a><span class="k">def</span> <span class="nf">_create_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">:</span> <span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Create</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
-</span><span id="L-66"><a href="#L-66"><span class="linenos"> 66</span></a> <span class="n">kind</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">&quot;kind&quot;</span><span class="p">]</span>
-</span><span id="L-67"><a href="#L-67"><span class="linenos"> 67</span></a> <span class="n">returns</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">find</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">ReturnsProperty</span><span class="p">)</span>
-</span><span id="L-68"><a href="#L-68"><span class="linenos"> 68</span></a> <span class="k">if</span> <span class="n">kind</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> <span class="o">==</span> <span class="s2">&quot;FUNCTION&quot;</span> <span class="ow">and</span> <span class="n">returns</span> <span class="ow">and</span> <span class="n">returns</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;is_table&quot;</span><span class="p">):</span>
-</span><span id="L-69"><a href="#L-69"><span class="linenos"> 69</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span>
-</span><span id="L-70"><a href="#L-70"><span class="linenos"> 70</span></a> <span class="n">expression</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">&quot;kind&quot;</span><span class="p">,</span> <span class="s2">&quot;TABLE FUNCTION&quot;</span><span class="p">)</span>
-</span><span id="L-71"><a href="#L-71"><span class="linenos"> 71</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span>
-</span><span id="L-72"><a href="#L-72"><span class="linenos"> 72</span></a> <span class="n">expression</span><span class="o">.</span><span class="n">expression</span><span class="p">,</span>
-</span><span id="L-73"><a href="#L-73"><span class="linenos"> 73</span></a> <span class="p">(</span>
-</span><span id="L-74"><a href="#L-74"><span class="linenos"> 74</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Subquery</span><span class="p">,</span>
-</span><span id="L-75"><a href="#L-75"><span class="linenos"> 75</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Literal</span><span class="p">,</span>
-</span><span id="L-76"><a href="#L-76"><span class="linenos"> 76</span></a> <span class="p">),</span>
-</span><span id="L-77"><a href="#L-77"><span class="linenos"> 77</span></a> <span class="p">):</span>
-</span><span id="L-78"><a href="#L-78"><span class="linenos"> 78</span></a> <span class="n">expression</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">&quot;expression&quot;</span><span class="p">,</span> <span class="n">expression</span><span class="o">.</span><span class="n">expression</span><span class="o">.</span><span class="n">this</span><span class="p">)</span>
-</span><span id="L-79"><a href="#L-79"><span class="linenos"> 79</span></a>
-</span><span id="L-80"><a href="#L-80"><span class="linenos"> 80</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">create_sql</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span>
-</span><span id="L-81"><a href="#L-81"><span class="linenos"> 81</span></a>
-</span><span id="L-82"><a href="#L-82"><span class="linenos"> 82</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">create_sql</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span>
-</span><span id="L-83"><a href="#L-83"><span class="linenos"> 83</span></a>
+</span><span id="L-56"><a href="#L-56"><span class="linenos"> 56</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">unnest_sql</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">Unnest</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="p">[</span><span class="n">exp</span><span class="o">.</span><span class="n">Array</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="n">structs</span><span class="p">)]))</span>
+</span><span id="L-57"><a href="#L-57"><span class="linenos"> 57</span></a>
+</span><span id="L-58"><a href="#L-58"><span class="linenos"> 58</span></a>
+</span><span id="L-59"><a href="#L-59"><span class="linenos"> 59</span></a><span class="k">def</span> <span class="nf">_returnsproperty_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">:</span> <span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">ReturnsProperty</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="L-60"><a href="#L-60"><span class="linenos"> 60</span></a> <span class="n">this</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">this</span>
+</span><span id="L-61"><a href="#L-61"><span class="linenos"> 61</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">this</span><span class="p">,</span> <span class="n">exp</span><span class="o">.</span><span class="n">Schema</span><span class="p">):</span>
+</span><span id="L-62"><a href="#L-62"><span class="linenos"> 62</span></a> <span class="n">this</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="n">this</span><span class="o">.</span><span class="n">this</span><span class="si">}</span><span class="s2"> &lt;</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">expressions</span><span class="p">(</span><span class="n">this</span><span class="p">)</span><span class="si">}</span><span class="s2">&gt;&quot;</span>
+</span><span id="L-63"><a href="#L-63"><span class="linenos"> 63</span></a> <span class="k">else</span><span class="p">:</span>
+</span><span id="L-64"><a href="#L-64"><span class="linenos"> 64</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">this</span><span class="p">)</span>
+</span><span id="L-65"><a href="#L-65"><span class="linenos"> 65</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">&quot;RETURNS </span><span class="si">{</span><span class="n">this</span><span class="si">}</span><span class="s2">&quot;</span>
+</span><span id="L-66"><a href="#L-66"><span class="linenos"> 66</span></a>
+</span><span id="L-67"><a href="#L-67"><span class="linenos"> 67</span></a>
+</span><span id="L-68"><a href="#L-68"><span class="linenos"> 68</span></a><span class="k">def</span> <span class="nf">_create_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">:</span> <span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Create</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="L-69"><a href="#L-69"><span class="linenos"> 69</span></a> <span class="n">kind</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">&quot;kind&quot;</span><span class="p">]</span>
+</span><span id="L-70"><a href="#L-70"><span class="linenos"> 70</span></a> <span class="n">returns</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">find</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">ReturnsProperty</span><span class="p">)</span>
+</span><span id="L-71"><a href="#L-71"><span class="linenos"> 71</span></a> <span class="k">if</span> <span class="n">kind</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> <span class="o">==</span> <span class="s2">&quot;FUNCTION&quot;</span> <span class="ow">and</span> <span class="n">returns</span> <span class="ow">and</span> <span class="n">returns</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;is_table&quot;</span><span class="p">):</span>
+</span><span id="L-72"><a href="#L-72"><span class="linenos"> 72</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span>
+</span><span id="L-73"><a href="#L-73"><span class="linenos"> 73</span></a> <span class="n">expression</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">&quot;kind&quot;</span><span class="p">,</span> <span class="s2">&quot;TABLE FUNCTION&quot;</span><span class="p">)</span>
+</span><span id="L-74"><a href="#L-74"><span class="linenos"> 74</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span>
+</span><span id="L-75"><a href="#L-75"><span class="linenos"> 75</span></a> <span class="n">expression</span><span class="o">.</span><span class="n">expression</span><span class="p">,</span>
+</span><span id="L-76"><a href="#L-76"><span class="linenos"> 76</span></a> <span class="p">(</span>
+</span><span id="L-77"><a href="#L-77"><span class="linenos"> 77</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Subquery</span><span class="p">,</span>
+</span><span id="L-78"><a href="#L-78"><span class="linenos"> 78</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Literal</span><span class="p">,</span>
+</span><span id="L-79"><a href="#L-79"><span class="linenos"> 79</span></a> <span class="p">),</span>
+</span><span id="L-80"><a href="#L-80"><span class="linenos"> 80</span></a> <span class="p">):</span>
+</span><span id="L-81"><a href="#L-81"><span class="linenos"> 81</span></a> <span class="n">expression</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">&quot;expression&quot;</span><span class="p">,</span> <span class="n">expression</span><span class="o">.</span><span class="n">expression</span><span class="o">.</span><span class="n">this</span><span class="p">)</span>
+</span><span id="L-82"><a href="#L-82"><span class="linenos"> 82</span></a>
+</span><span id="L-83"><a href="#L-83"><span class="linenos"> 83</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">create_sql</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span>
</span><span id="L-84"><a href="#L-84"><span class="linenos"> 84</span></a>
-</span><span id="L-85"><a href="#L-85"><span class="linenos"> 85</span></a><span class="k">def</span> <span class="nf">_unqualify_unnest</span><span class="p">(</span><span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Expression</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">exp</span><span class="o">.</span><span class="n">Expression</span><span class="p">:</span>
-</span><span id="L-86"><a href="#L-86"><span class="linenos"> 86</span></a><span class="w"> </span><span class="sd">&quot;&quot;&quot;Remove references to unnest table aliases since bigquery doesn&#39;t allow them.</span>
+</span><span id="L-85"><a href="#L-85"><span class="linenos"> 85</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">create_sql</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span>
+</span><span id="L-86"><a href="#L-86"><span class="linenos"> 86</span></a>
</span><span id="L-87"><a href="#L-87"><span class="linenos"> 87</span></a>
-</span><span id="L-88"><a href="#L-88"><span class="linenos"> 88</span></a><span class="sd"> These are added by the optimizer&#39;s qualify_column step.</span>
-</span><span id="L-89"><a href="#L-89"><span class="linenos"> 89</span></a><span class="sd"> &quot;&quot;&quot;</span>
-</span><span id="L-90"><a href="#L-90"><span class="linenos"> 90</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">exp</span><span class="o">.</span><span class="n">Select</span><span class="p">):</span>
-</span><span id="L-91"><a href="#L-91"><span class="linenos"> 91</span></a> <span class="n">unnests</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="L-92"><a href="#L-92"><span class="linenos"> 92</span></a> <span class="n">unnest</span><span class="o">.</span><span class="n">alias</span>
-</span><span id="L-93"><a href="#L-93"><span class="linenos"> 93</span></a> <span class="k">for</span> <span class="n">unnest</span> <span class="ow">in</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;from&quot;</span><span class="p">,</span> <span class="n">exp</span><span class="o">.</span><span class="n">From</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="p">[]))</span><span class="o">.</span><span class="n">expressions</span>
-</span><span id="L-94"><a href="#L-94"><span class="linenos"> 94</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">unnest</span><span class="p">,</span> <span class="n">exp</span><span class="o">.</span><span class="n">Unnest</span><span class="p">)</span> <span class="ow">and</span> <span class="n">unnest</span><span class="o">.</span><span class="n">alias</span>
-</span><span id="L-95"><a href="#L-95"><span class="linenos"> 95</span></a> <span class="p">}</span>
-</span><span id="L-96"><a href="#L-96"><span class="linenos"> 96</span></a>
-</span><span id="L-97"><a href="#L-97"><span class="linenos"> 97</span></a> <span class="k">if</span> <span class="n">unnests</span><span class="p">:</span>
-</span><span id="L-98"><a href="#L-98"><span class="linenos"> 98</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span>
+</span><span id="L-88"><a href="#L-88"><span class="linenos"> 88</span></a><span class="k">def</span> <span class="nf">_unqualify_unnest</span><span class="p">(</span><span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Expression</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">exp</span><span class="o">.</span><span class="n">Expression</span><span class="p">:</span>
+</span><span id="L-89"><a href="#L-89"><span class="linenos"> 89</span></a><span class="w"> </span><span class="sd">&quot;&quot;&quot;Remove references to unnest table aliases since bigquery doesn&#39;t allow them.</span>
+</span><span id="L-90"><a href="#L-90"><span class="linenos"> 90</span></a>
+</span><span id="L-91"><a href="#L-91"><span class="linenos"> 91</span></a><span class="sd"> These are added by the optimizer&#39;s qualify_column step.</span>
+</span><span id="L-92"><a href="#L-92"><span class="linenos"> 92</span></a><span class="sd"> &quot;&quot;&quot;</span>
+</span><span id="L-93"><a href="#L-93"><span class="linenos"> 93</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">exp</span><span class="o">.</span><span class="n">Select</span><span class="p">):</span>
+</span><span id="L-94"><a href="#L-94"><span class="linenos"> 94</span></a> <span class="n">unnests</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="L-95"><a href="#L-95"><span class="linenos"> 95</span></a> <span class="n">unnest</span><span class="o">.</span><span class="n">alias</span>
+</span><span id="L-96"><a href="#L-96"><span class="linenos"> 96</span></a> <span class="k">for</span> <span class="n">unnest</span> <span class="ow">in</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;from&quot;</span><span class="p">,</span> <span class="n">exp</span><span class="o">.</span><span class="n">From</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="p">[]))</span><span class="o">.</span><span class="n">expressions</span>
+</span><span id="L-97"><a href="#L-97"><span class="linenos"> 97</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">unnest</span><span class="p">,</span> <span class="n">exp</span><span class="o">.</span><span class="n">Unnest</span><span class="p">)</span> <span class="ow">and</span> <span class="n">unnest</span><span class="o">.</span><span class="n">alias</span>
+</span><span id="L-98"><a href="#L-98"><span class="linenos"> 98</span></a> <span class="p">}</span>
</span><span id="L-99"><a href="#L-99"><span class="linenos"> 99</span></a>
-</span><span id="L-100"><a href="#L-100"><span class="linenos">100</span></a> <span class="k">for</span> <span class="n">select</span> <span class="ow">in</span> <span class="n">expression</span><span class="o">.</span><span class="n">expressions</span><span class="p">:</span>
-</span><span id="L-101"><a href="#L-101"><span class="linenos">101</span></a> <span class="k">for</span> <span class="n">column</span> <span class="ow">in</span> <span class="n">select</span><span class="o">.</span><span class="n">find_all</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">Column</span><span class="p">):</span>
-</span><span id="L-102"><a href="#L-102"><span class="linenos">102</span></a> <span class="k">if</span> <span class="n">column</span><span class="o">.</span><span class="n">table</span> <span class="ow">in</span> <span class="n">unnests</span><span class="p">:</span>
-</span><span id="L-103"><a href="#L-103"><span class="linenos">103</span></a> <span class="n">column</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">&quot;table&quot;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
-</span><span id="L-104"><a href="#L-104"><span class="linenos">104</span></a>
-</span><span id="L-105"><a href="#L-105"><span class="linenos">105</span></a> <span class="k">return</span> <span class="n">expression</span>
-</span><span id="L-106"><a href="#L-106"><span class="linenos">106</span></a>
+</span><span id="L-100"><a href="#L-100"><span class="linenos">100</span></a> <span class="k">if</span> <span class="n">unnests</span><span class="p">:</span>
+</span><span id="L-101"><a href="#L-101"><span class="linenos">101</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span>
+</span><span id="L-102"><a href="#L-102"><span class="linenos">102</span></a>
+</span><span id="L-103"><a href="#L-103"><span class="linenos">103</span></a> <span class="k">for</span> <span class="n">select</span> <span class="ow">in</span> <span class="n">expression</span><span class="o">.</span><span class="n">expressions</span><span class="p">:</span>
+</span><span id="L-104"><a href="#L-104"><span class="linenos">104</span></a> <span class="k">for</span> <span class="n">column</span> <span class="ow">in</span> <span class="n">select</span><span class="o">.</span><span class="n">find_all</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">Column</span><span class="p">):</span>
+</span><span id="L-105"><a href="#L-105"><span class="linenos">105</span></a> <span class="k">if</span> <span class="n">column</span><span class="o">.</span><span class="n">table</span> <span class="ow">in</span> <span class="n">unnests</span><span class="p">:</span>
+</span><span id="L-106"><a href="#L-106"><span class="linenos">106</span></a> <span class="n">column</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">&quot;table&quot;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
</span><span id="L-107"><a href="#L-107"><span class="linenos">107</span></a>
-</span><span id="L-108"><a href="#L-108"><span class="linenos">108</span></a><span class="k">class</span> <span class="nc">BigQuery</span><span class="p">(</span><span class="n">Dialect</span><span class="p">):</span>
-</span><span id="L-109"><a href="#L-109"><span class="linenos">109</span></a> <span class="n">unnest_column_only</span> <span class="o">=</span> <span class="kc">True</span>
-</span><span id="L-110"><a href="#L-110"><span class="linenos">110</span></a> <span class="n">time_mapping</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="L-111"><a href="#L-111"><span class="linenos">111</span></a> <span class="s2">&quot;%M&quot;</span><span class="p">:</span> <span class="s2">&quot;%-M&quot;</span><span class="p">,</span>
-</span><span id="L-112"><a href="#L-112"><span class="linenos">112</span></a> <span class="s2">&quot;</span><span class="si">%d</span><span class="s2">&quot;</span><span class="p">:</span> <span class="s2">&quot;</span><span class="si">%-d</span><span class="s2">&quot;</span><span class="p">,</span>
-</span><span id="L-113"><a href="#L-113"><span class="linenos">113</span></a> <span class="s2">&quot;%m&quot;</span><span class="p">:</span> <span class="s2">&quot;%-m&quot;</span><span class="p">,</span>
-</span><span id="L-114"><a href="#L-114"><span class="linenos">114</span></a> <span class="s2">&quot;%y&quot;</span><span class="p">:</span> <span class="s2">&quot;%-y&quot;</span><span class="p">,</span>
-</span><span id="L-115"><a href="#L-115"><span class="linenos">115</span></a> <span class="s2">&quot;%H&quot;</span><span class="p">:</span> <span class="s2">&quot;%-H&quot;</span><span class="p">,</span>
-</span><span id="L-116"><a href="#L-116"><span class="linenos">116</span></a> <span class="s2">&quot;%I&quot;</span><span class="p">:</span> <span class="s2">&quot;%-I&quot;</span><span class="p">,</span>
-</span><span id="L-117"><a href="#L-117"><span class="linenos">117</span></a> <span class="s2">&quot;%S&quot;</span><span class="p">:</span> <span class="s2">&quot;%-S&quot;</span><span class="p">,</span>
-</span><span id="L-118"><a href="#L-118"><span class="linenos">118</span></a> <span class="s2">&quot;%j&quot;</span><span class="p">:</span> <span class="s2">&quot;%-j&quot;</span><span class="p">,</span>
-</span><span id="L-119"><a href="#L-119"><span class="linenos">119</span></a> <span class="p">}</span>
-</span><span id="L-120"><a href="#L-120"><span class="linenos">120</span></a>
-</span><span id="L-121"><a href="#L-121"><span class="linenos">121</span></a> <span class="k">class</span> <span class="nc">Tokenizer</span><span class="p">(</span><span class="n">tokens</span><span class="o">.</span><span class="n">Tokenizer</span><span class="p">):</span>
-</span><span id="L-122"><a href="#L-122"><span class="linenos">122</span></a> <span class="n">QUOTES</span> <span class="o">=</span> <span class="p">[</span>
-</span><span id="L-123"><a href="#L-123"><span class="linenos">123</span></a> <span class="p">(</span><span class="n">prefix</span> <span class="o">+</span> <span class="n">quote</span><span class="p">,</span> <span class="n">quote</span><span class="p">)</span> <span class="k">if</span> <span class="n">prefix</span> <span class="k">else</span> <span class="n">quote</span>
-</span><span id="L-124"><a href="#L-124"><span class="linenos">124</span></a> <span class="k">for</span> <span class="n">quote</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">&quot;&#39;&quot;</span><span class="p">,</span> <span class="s1">&#39;&quot;&#39;</span><span class="p">,</span> <span class="s1">&#39;&quot;&quot;&quot;&#39;</span><span class="p">,</span> <span class="s2">&quot;&#39;&#39;&#39;&quot;</span><span class="p">]</span>
-</span><span id="L-125"><a href="#L-125"><span class="linenos">125</span></a> <span class="k">for</span> <span class="n">prefix</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="s2">&quot;r&quot;</span><span class="p">,</span> <span class="s2">&quot;R&quot;</span><span class="p">]</span>
-</span><span id="L-126"><a href="#L-126"><span class="linenos">126</span></a> <span class="p">]</span>
-</span><span id="L-127"><a href="#L-127"><span class="linenos">127</span></a> <span class="n">COMMENTS</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;--&quot;</span><span class="p">,</span> <span class="s2">&quot;#&quot;</span><span class="p">,</span> <span class="p">(</span><span class="s2">&quot;/*&quot;</span><span class="p">,</span> <span class="s2">&quot;*/&quot;</span><span class="p">)]</span>
-</span><span id="L-128"><a href="#L-128"><span class="linenos">128</span></a> <span class="n">IDENTIFIERS</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;`&quot;</span><span class="p">]</span>
-</span><span id="L-129"><a href="#L-129"><span class="linenos">129</span></a> <span class="n">STRING_ESCAPES</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;</span><span class="se">\\</span><span class="s2">&quot;</span><span class="p">]</span>
-</span><span id="L-130"><a href="#L-130"><span class="linenos">130</span></a> <span class="n">HEX_STRINGS</span> <span class="o">=</span> <span class="p">[(</span><span class="s2">&quot;0x&quot;</span><span class="p">,</span> <span class="s2">&quot;&quot;</span><span class="p">),</span> <span class="p">(</span><span class="s2">&quot;0X&quot;</span><span class="p">,</span> <span class="s2">&quot;&quot;</span><span class="p">)]</span>
-</span><span id="L-131"><a href="#L-131"><span class="linenos">131</span></a>
-</span><span id="L-132"><a href="#L-132"><span class="linenos">132</span></a> <span class="n">KEYWORDS</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="L-133"><a href="#L-133"><span class="linenos">133</span></a> <span class="o">**</span><span class="n">tokens</span><span class="o">.</span><span class="n">Tokenizer</span><span class="o">.</span><span class="n">KEYWORDS</span><span class="p">,</span>
-</span><span id="L-134"><a href="#L-134"><span class="linenos">134</span></a> <span class="s2">&quot;ANY TYPE&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">VARIANT</span><span class="p">,</span>
-</span><span id="L-135"><a href="#L-135"><span class="linenos">135</span></a> <span class="s2">&quot;BEGIN&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">COMMAND</span><span class="p">,</span>
-</span><span id="L-136"><a href="#L-136"><span class="linenos">136</span></a> <span class="s2">&quot;BEGIN TRANSACTION&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">BEGIN</span><span class="p">,</span>
-</span><span id="L-137"><a href="#L-137"><span class="linenos">137</span></a> <span class="s2">&quot;CURRENT_DATETIME&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">CURRENT_DATETIME</span><span class="p">,</span>
-</span><span id="L-138"><a href="#L-138"><span class="linenos">138</span></a> <span class="s2">&quot;DECLARE&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">COMMAND</span><span class="p">,</span>
-</span><span id="L-139"><a href="#L-139"><span class="linenos">139</span></a> <span class="s2">&quot;GEOGRAPHY&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">GEOGRAPHY</span><span class="p">,</span>
-</span><span id="L-140"><a href="#L-140"><span class="linenos">140</span></a> <span class="s2">&quot;FLOAT64&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">DOUBLE</span><span class="p">,</span>
-</span><span id="L-141"><a href="#L-141"><span class="linenos">141</span></a> <span class="s2">&quot;INT64&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">BIGINT</span><span class="p">,</span>
-</span><span id="L-142"><a href="#L-142"><span class="linenos">142</span></a> <span class="s2">&quot;NOT DETERMINISTIC&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">VOLATILE</span><span class="p">,</span>
-</span><span id="L-143"><a href="#L-143"><span class="linenos">143</span></a> <span class="s2">&quot;UNKNOWN&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">NULL</span><span class="p">,</span>
-</span><span id="L-144"><a href="#L-144"><span class="linenos">144</span></a> <span class="p">}</span>
-</span><span id="L-145"><a href="#L-145"><span class="linenos">145</span></a> <span class="n">KEYWORDS</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s2">&quot;DIV&quot;</span><span class="p">)</span>
-</span><span id="L-146"><a href="#L-146"><span class="linenos">146</span></a>
-</span><span id="L-147"><a href="#L-147"><span class="linenos">147</span></a> <span class="k">class</span> <span class="nc">Parser</span><span class="p">(</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="p">):</span>
-</span><span id="L-148"><a href="#L-148"><span class="linenos">148</span></a> <span class="n">PREFIXED_PIVOT_COLUMNS</span> <span class="o">=</span> <span class="kc">True</span>
-</span><span id="L-149"><a href="#L-149"><span class="linenos">149</span></a>
-</span><span id="L-150"><a href="#L-150"><span class="linenos">150</span></a> <span class="n">LOG_BASE_FIRST</span> <span class="o">=</span> <span class="kc">False</span>
-</span><span id="L-151"><a href="#L-151"><span class="linenos">151</span></a> <span class="n">LOG_DEFAULTS_TO_LN</span> <span class="o">=</span> <span class="kc">True</span>
-</span><span id="L-152"><a href="#L-152"><span class="linenos">152</span></a>
-</span><span id="L-153"><a href="#L-153"><span class="linenos">153</span></a> <span class="n">FUNCTIONS</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="L-154"><a href="#L-154"><span class="linenos">154</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">FUNCTIONS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
-</span><span id="L-155"><a href="#L-155"><span class="linenos">155</span></a> <span class="s2">&quot;DATE_TRUNC&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="n">args</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">DateTrunc</span><span class="p">(</span>
-</span><span id="L-156"><a href="#L-156"><span class="linenos">156</span></a> <span class="n">unit</span><span class="o">=</span><span class="n">exp</span><span class="o">.</span><span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">name</span><span class="p">),</span> <span class="c1"># type: ignore</span>
-</span><span id="L-157"><a href="#L-157"><span class="linenos">157</span></a> <span class="n">this</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span>
-</span><span id="L-158"><a href="#L-158"><span class="linenos">158</span></a> <span class="p">),</span>
-</span><span id="L-159"><a href="#L-159"><span class="linenos">159</span></a> <span class="s2">&quot;DATE_ADD&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">DateAdd</span><span class="p">),</span>
-</span><span id="L-160"><a href="#L-160"><span class="linenos">160</span></a> <span class="s2">&quot;DATETIME_ADD&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">DatetimeAdd</span><span class="p">),</span>
-</span><span id="L-161"><a href="#L-161"><span class="linenos">161</span></a> <span class="s2">&quot;DIV&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="n">args</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">IntDiv</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="n">expression</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">1</span><span class="p">)),</span>
-</span><span id="L-162"><a href="#L-162"><span class="linenos">162</span></a> <span class="s2">&quot;REGEXP_CONTAINS&quot;</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">RegexpLike</span><span class="o">.</span><span class="n">from_arg_list</span><span class="p">,</span>
-</span><span id="L-163"><a href="#L-163"><span class="linenos">163</span></a> <span class="s2">&quot;REGEXP_EXTRACT&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="n">args</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">RegexpExtract</span><span class="p">(</span>
-</span><span id="L-164"><a href="#L-164"><span class="linenos">164</span></a> <span class="n">this</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span>
-</span><span id="L-165"><a href="#L-165"><span class="linenos">165</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span>
-</span><span id="L-166"><a href="#L-166"><span class="linenos">166</span></a> <span class="n">position</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span>
-</span><span id="L-167"><a href="#L-167"><span class="linenos">167</span></a> <span class="n">occurrence</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span>
-</span><span id="L-168"><a href="#L-168"><span class="linenos">168</span></a> <span class="n">group</span><span class="o">=</span><span class="n">exp</span><span class="o">.</span><span class="n">Literal</span><span class="o">.</span><span class="n">number</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
-</span><span id="L-169"><a href="#L-169"><span class="linenos">169</span></a> <span class="k">if</span> <span class="n">re</span><span class="o">.</span><span class="n">compile</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">1</span><span class="p">)))</span><span class="o">.</span><span class="n">groups</span> <span class="o">==</span> <span class="mi">1</span>
-</span><span id="L-170"><a href="#L-170"><span class="linenos">170</span></a> <span class="k">else</span> <span class="kc">None</span><span class="p">,</span>
-</span><span id="L-171"><a href="#L-171"><span class="linenos">171</span></a> <span class="p">),</span>
-</span><span id="L-172"><a href="#L-172"><span class="linenos">172</span></a> <span class="s2">&quot;TIME_ADD&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">TimeAdd</span><span class="p">),</span>
-</span><span id="L-173"><a href="#L-173"><span class="linenos">173</span></a> <span class="s2">&quot;TIMESTAMP_ADD&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">TimestampAdd</span><span class="p">),</span>
-</span><span id="L-174"><a href="#L-174"><span class="linenos">174</span></a> <span class="s2">&quot;DATE_SUB&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">DateSub</span><span class="p">),</span>
-</span><span id="L-175"><a href="#L-175"><span class="linenos">175</span></a> <span class="s2">&quot;DATETIME_SUB&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">DatetimeSub</span><span class="p">),</span>
-</span><span id="L-176"><a href="#L-176"><span class="linenos">176</span></a> <span class="s2">&quot;TIME_SUB&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">TimeSub</span><span class="p">),</span>
-</span><span id="L-177"><a href="#L-177"><span class="linenos">177</span></a> <span class="s2">&quot;TIMESTAMP_SUB&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">TimestampSub</span><span class="p">),</span>
-</span><span id="L-178"><a href="#L-178"><span class="linenos">178</span></a> <span class="s2">&quot;PARSE_TIMESTAMP&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="n">args</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">StrToTime</span><span class="p">(</span>
-</span><span id="L-179"><a href="#L-179"><span class="linenos">179</span></a> <span class="n">this</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="nb">format</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
-</span><span id="L-180"><a href="#L-180"><span class="linenos">180</span></a> <span class="p">),</span>
-</span><span id="L-181"><a href="#L-181"><span class="linenos">181</span></a> <span class="p">}</span>
-</span><span id="L-182"><a href="#L-182"><span class="linenos">182</span></a>
-</span><span id="L-183"><a href="#L-183"><span class="linenos">183</span></a> <span class="n">FUNCTION_PARSERS</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="L-184"><a href="#L-184"><span class="linenos">184</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">FUNCTION_PARSERS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
-</span><span id="L-185"><a href="#L-185"><span class="linenos">185</span></a> <span class="s2">&quot;ARRAY&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">Array</span><span class="p">,</span> <span class="n">expressions</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">_parse_statement</span><span class="p">()]),</span>
-</span><span id="L-186"><a href="#L-186"><span class="linenos">186</span></a> <span class="p">}</span>
-</span><span id="L-187"><a href="#L-187"><span class="linenos">187</span></a> <span class="n">FUNCTION_PARSERS</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s2">&quot;TRIM&quot;</span><span class="p">)</span>
-</span><span id="L-188"><a href="#L-188"><span class="linenos">188</span></a>
-</span><span id="L-189"><a href="#L-189"><span class="linenos">189</span></a> <span class="n">NO_PAREN_FUNCTIONS</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="L-190"><a href="#L-190"><span class="linenos">190</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">NO_PAREN_FUNCTIONS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
-</span><span id="L-191"><a href="#L-191"><span class="linenos">191</span></a> <span class="n">TokenType</span><span class="o">.</span><span class="n">CURRENT_DATETIME</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">CurrentDatetime</span><span class="p">,</span>
-</span><span id="L-192"><a href="#L-192"><span class="linenos">192</span></a> <span class="p">}</span>
-</span><span id="L-193"><a href="#L-193"><span class="linenos">193</span></a>
-</span><span id="L-194"><a href="#L-194"><span class="linenos">194</span></a> <span class="n">NESTED_TYPE_TOKENS</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="L-195"><a href="#L-195"><span class="linenos">195</span></a> <span class="o">*</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">NESTED_TYPE_TOKENS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
-</span><span id="L-196"><a href="#L-196"><span class="linenos">196</span></a> <span class="n">TokenType</span><span class="o">.</span><span class="n">TABLE</span><span class="p">,</span>
-</span><span id="L-197"><a href="#L-197"><span class="linenos">197</span></a> <span class="p">}</span>
-</span><span id="L-198"><a href="#L-198"><span class="linenos">198</span></a>
-</span><span id="L-199"><a href="#L-199"><span class="linenos">199</span></a> <span class="n">ID_VAR_TOKENS</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="L-200"><a href="#L-200"><span class="linenos">200</span></a> <span class="o">*</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">ID_VAR_TOKENS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
-</span><span id="L-201"><a href="#L-201"><span class="linenos">201</span></a> <span class="n">TokenType</span><span class="o">.</span><span class="n">VALUES</span><span class="p">,</span>
-</span><span id="L-202"><a href="#L-202"><span class="linenos">202</span></a> <span class="p">}</span>
-</span><span id="L-203"><a href="#L-203"><span class="linenos">203</span></a>
-</span><span id="L-204"><a href="#L-204"><span class="linenos">204</span></a> <span class="n">PROPERTY_PARSERS</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="L-205"><a href="#L-205"><span class="linenos">205</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">PROPERTY_PARSERS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
-</span><span id="L-206"><a href="#L-206"><span class="linenos">206</span></a> <span class="s2">&quot;NOT DETERMINISTIC&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span>
-</span><span id="L-207"><a href="#L-207"><span class="linenos">207</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">StabilityProperty</span><span class="p">,</span> <span class="n">this</span><span class="o">=</span><span class="n">exp</span><span class="o">.</span><span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="s2">&quot;VOLATILE&quot;</span><span class="p">)</span>
-</span><span id="L-208"><a href="#L-208"><span class="linenos">208</span></a> <span class="p">),</span>
-</span><span id="L-209"><a href="#L-209"><span class="linenos">209</span></a> <span class="p">}</span>
-</span><span id="L-210"><a href="#L-210"><span class="linenos">210</span></a>
-</span><span id="L-211"><a href="#L-211"><span class="linenos">211</span></a> <span class="k">class</span> <span class="nc">Generator</span><span class="p">(</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="p">):</span>
-</span><span id="L-212"><a href="#L-212"><span class="linenos">212</span></a> <span class="n">EXPLICIT_UNION</span> <span class="o">=</span> <span class="kc">True</span>
-</span><span id="L-213"><a href="#L-213"><span class="linenos">213</span></a> <span class="n">INTERVAL_ALLOWS_PLURAL_FORM</span> <span class="o">=</span> <span class="kc">False</span>
-</span><span id="L-214"><a href="#L-214"><span class="linenos">214</span></a> <span class="n">JOIN_HINTS</span> <span class="o">=</span> <span class="kc">False</span>
-</span><span id="L-215"><a href="#L-215"><span class="linenos">215</span></a> <span class="n">TABLE_HINTS</span> <span class="o">=</span> <span class="kc">False</span>
-</span><span id="L-216"><a href="#L-216"><span class="linenos">216</span></a> <span class="n">LIMIT_FETCH</span> <span class="o">=</span> <span class="s2">&quot;LIMIT&quot;</span>
-</span><span id="L-217"><a href="#L-217"><span class="linenos">217</span></a>
-</span><span id="L-218"><a href="#L-218"><span class="linenos">218</span></a> <span class="n">TRANSFORMS</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="L-219"><a href="#L-219"><span class="linenos">219</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">TRANSFORMS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
-</span><span id="L-220"><a href="#L-220"><span class="linenos">220</span></a> <span class="o">**</span><span class="n">transforms</span><span class="o">.</span><span class="n">REMOVE_PRECISION_PARAMETERIZED_TYPES</span><span class="p">,</span> <span class="c1"># type: ignore</span>
-</span><span id="L-221"><a href="#L-221"><span class="linenos">221</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">ArraySize</span><span class="p">:</span> <span class="n">rename_func</span><span class="p">(</span><span class="s2">&quot;ARRAY_LENGTH&quot;</span><span class="p">),</span>
-</span><span id="L-222"><a href="#L-222"><span class="linenos">222</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">AtTimeZone</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">func</span><span class="p">(</span>
-</span><span id="L-223"><a href="#L-223"><span class="linenos">223</span></a> <span class="s2">&quot;TIMESTAMP&quot;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">func</span><span class="p">(</span><span class="s2">&quot;DATETIME&quot;</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;zone&quot;</span><span class="p">))</span>
-</span><span id="L-224"><a href="#L-224"><span class="linenos">224</span></a> <span class="p">),</span>
-</span><span id="L-225"><a href="#L-225"><span class="linenos">225</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DateAdd</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;DATE&quot;</span><span class="p">,</span> <span class="s2">&quot;ADD&quot;</span><span class="p">),</span>
-</span><span id="L-226"><a href="#L-226"><span class="linenos">226</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DateSub</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;DATE&quot;</span><span class="p">,</span> <span class="s2">&quot;SUB&quot;</span><span class="p">),</span>
-</span><span id="L-227"><a href="#L-227"><span class="linenos">227</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DatetimeAdd</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;DATETIME&quot;</span><span class="p">,</span> <span class="s2">&quot;ADD&quot;</span><span class="p">),</span>
-</span><span id="L-228"><a href="#L-228"><span class="linenos">228</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DatetimeSub</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;DATETIME&quot;</span><span class="p">,</span> <span class="s2">&quot;SUB&quot;</span><span class="p">),</span>
-</span><span id="L-229"><a href="#L-229"><span class="linenos">229</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DateDiff</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">&quot;DATE_DIFF(</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">&#39;this&#39;</span><span class="p">)</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">&#39;expression&#39;</span><span class="p">)</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;unit&#39;</span><span class="p">,</span><span class="w"> </span><span class="s1">&#39;DAY&#39;</span><span class="p">))</span><span class="si">}</span><span class="s2">)&quot;</span><span class="p">,</span>
-</span><span id="L-230"><a href="#L-230"><span class="linenos">230</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DateStrToDate</span><span class="p">:</span> <span class="n">datestrtodate_sql</span><span class="p">,</span>
-</span><span id="L-231"><a href="#L-231"><span class="linenos">231</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DateTrunc</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">func</span><span class="p">(</span><span class="s2">&quot;DATE_TRUNC&quot;</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">&quot;unit&quot;</span><span class="p">)),</span>
-</span><span id="L-232"><a href="#L-232"><span class="linenos">232</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">GroupConcat</span><span class="p">:</span> <span class="n">rename_func</span><span class="p">(</span><span class="s2">&quot;STRING_AGG&quot;</span><span class="p">),</span>
-</span><span id="L-233"><a href="#L-233"><span class="linenos">233</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">ILike</span><span class="p">:</span> <span class="n">no_ilike_sql</span><span class="p">,</span>
-</span><span id="L-234"><a href="#L-234"><span class="linenos">234</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">IntDiv</span><span class="p">:</span> <span class="n">rename_func</span><span class="p">(</span><span class="s2">&quot;DIV&quot;</span><span class="p">),</span>
-</span><span id="L-235"><a href="#L-235"><span class="linenos">235</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Max</span><span class="p">:</span> <span class="n">max_or_greatest</span><span class="p">,</span>
-</span><span id="L-236"><a href="#L-236"><span class="linenos">236</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Min</span><span class="p">:</span> <span class="n">min_or_least</span><span class="p">,</span>
-</span><span id="L-237"><a href="#L-237"><span class="linenos">237</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Select</span><span class="p">:</span> <span class="n">transforms</span><span class="o">.</span><span class="n">preprocess</span><span class="p">([</span><span class="n">_unqualify_unnest</span><span class="p">]),</span>
-</span><span id="L-238"><a href="#L-238"><span class="linenos">238</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">StrToTime</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">&quot;PARSE_TIMESTAMP(</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">format_time</span><span class="p">(</span><span class="n">e</span><span class="p">)</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">&#39;this&#39;</span><span class="p">)</span><span class="si">}</span><span class="s2">)&quot;</span><span class="p">,</span>
-</span><span id="L-239"><a href="#L-239"><span class="linenos">239</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TimeAdd</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;TIME&quot;</span><span class="p">,</span> <span class="s2">&quot;ADD&quot;</span><span class="p">),</span>
-</span><span id="L-240"><a href="#L-240"><span class="linenos">240</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TimeSub</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;TIME&quot;</span><span class="p">,</span> <span class="s2">&quot;SUB&quot;</span><span class="p">),</span>
-</span><span id="L-241"><a href="#L-241"><span class="linenos">241</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TimestampAdd</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;TIMESTAMP&quot;</span><span class="p">,</span> <span class="s2">&quot;ADD&quot;</span><span class="p">),</span>
-</span><span id="L-242"><a href="#L-242"><span class="linenos">242</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TimestampSub</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;TIMESTAMP&quot;</span><span class="p">,</span> <span class="s2">&quot;SUB&quot;</span><span class="p">),</span>
-</span><span id="L-243"><a href="#L-243"><span class="linenos">243</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TimeStrToTime</span><span class="p">:</span> <span class="n">timestrtotime_sql</span><span class="p">,</span>
-</span><span id="L-244"><a href="#L-244"><span class="linenos">244</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TsOrDsToDate</span><span class="p">:</span> <span class="n">ts_or_ds_to_date_sql</span><span class="p">(</span><span class="s2">&quot;bigquery&quot;</span><span class="p">),</span>
-</span><span id="L-245"><a href="#L-245"><span class="linenos">245</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TsOrDsAdd</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;DATE&quot;</span><span class="p">,</span> <span class="s2">&quot;ADD&quot;</span><span class="p">),</span>
-</span><span id="L-246"><a href="#L-246"><span class="linenos">246</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">PartitionedByProperty</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">&quot;PARTITION BY </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">&#39;this&#39;</span><span class="p">)</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">,</span>
-</span><span id="L-247"><a href="#L-247"><span class="linenos">247</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">VariancePop</span><span class="p">:</span> <span class="n">rename_func</span><span class="p">(</span><span class="s2">&quot;VAR_POP&quot;</span><span class="p">),</span>
-</span><span id="L-248"><a href="#L-248"><span class="linenos">248</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Values</span><span class="p">:</span> <span class="n">_derived_table_values_to_unnest</span><span class="p">,</span>
-</span><span id="L-249"><a href="#L-249"><span class="linenos">249</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">ReturnsProperty</span><span class="p">:</span> <span class="n">_returnsproperty_sql</span><span class="p">,</span>
-</span><span id="L-250"><a href="#L-250"><span class="linenos">250</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Create</span><span class="p">:</span> <span class="n">_create_sql</span><span class="p">,</span>
-</span><span id="L-251"><a href="#L-251"><span class="linenos">251</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Trim</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">func</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;TRIM&quot;</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">expression</span><span class="p">),</span>
-</span><span id="L-252"><a href="#L-252"><span class="linenos">252</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">StabilityProperty</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">&quot;DETERMINISTIC&quot;</span>
-</span><span id="L-253"><a href="#L-253"><span class="linenos">253</span></a> <span class="k">if</span> <span class="n">e</span><span class="o">.</span><span class="n">name</span> <span class="o">==</span> <span class="s2">&quot;IMMUTABLE&quot;</span>
-</span><span id="L-254"><a href="#L-254"><span class="linenos">254</span></a> <span class="k">else</span> <span class="s2">&quot;NOT DETERMINISTIC&quot;</span><span class="p">,</span>
-</span><span id="L-255"><a href="#L-255"><span class="linenos">255</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">RegexpLike</span><span class="p">:</span> <span class="n">rename_func</span><span class="p">(</span><span class="s2">&quot;REGEXP_CONTAINS&quot;</span><span class="p">),</span>
-</span><span id="L-256"><a href="#L-256"><span class="linenos">256</span></a> <span class="p">}</span>
-</span><span id="L-257"><a href="#L-257"><span class="linenos">257</span></a>
-</span><span id="L-258"><a href="#L-258"><span class="linenos">258</span></a> <span class="n">TYPE_MAPPING</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="L-259"><a href="#L-259"><span class="linenos">259</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">TYPE_MAPPING</span><span class="p">,</span> <span class="c1"># type: ignore</span>
-</span><span id="L-260"><a href="#L-260"><span class="linenos">260</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">BIGDECIMAL</span><span class="p">:</span> <span class="s2">&quot;BIGNUMERIC&quot;</span><span class="p">,</span>
-</span><span id="L-261"><a href="#L-261"><span class="linenos">261</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">BIGINT</span><span class="p">:</span> <span class="s2">&quot;INT64&quot;</span><span class="p">,</span>
-</span><span id="L-262"><a href="#L-262"><span class="linenos">262</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">BOOLEAN</span><span class="p">:</span> <span class="s2">&quot;BOOL&quot;</span><span class="p">,</span>
-</span><span id="L-263"><a href="#L-263"><span class="linenos">263</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">CHAR</span><span class="p">:</span> <span class="s2">&quot;STRING&quot;</span><span class="p">,</span>
-</span><span id="L-264"><a href="#L-264"><span class="linenos">264</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">DECIMAL</span><span class="p">:</span> <span class="s2">&quot;NUMERIC&quot;</span><span class="p">,</span>
-</span><span id="L-265"><a href="#L-265"><span class="linenos">265</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">DOUBLE</span><span class="p">:</span> <span class="s2">&quot;FLOAT64&quot;</span><span class="p">,</span>
-</span><span id="L-266"><a href="#L-266"><span class="linenos">266</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">FLOAT</span><span class="p">:</span> <span class="s2">&quot;FLOAT64&quot;</span><span class="p">,</span>
-</span><span id="L-267"><a href="#L-267"><span class="linenos">267</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">INT</span><span class="p">:</span> <span class="s2">&quot;INT64&quot;</span><span class="p">,</span>
-</span><span id="L-268"><a href="#L-268"><span class="linenos">268</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">NCHAR</span><span class="p">:</span> <span class="s2">&quot;STRING&quot;</span><span class="p">,</span>
-</span><span id="L-269"><a href="#L-269"><span class="linenos">269</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">NVARCHAR</span><span class="p">:</span> <span class="s2">&quot;STRING&quot;</span><span class="p">,</span>
-</span><span id="L-270"><a href="#L-270"><span class="linenos">270</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">SMALLINT</span><span class="p">:</span> <span class="s2">&quot;INT64&quot;</span><span class="p">,</span>
-</span><span id="L-271"><a href="#L-271"><span class="linenos">271</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">TEXT</span><span class="p">:</span> <span class="s2">&quot;STRING&quot;</span><span class="p">,</span>
-</span><span id="L-272"><a href="#L-272"><span class="linenos">272</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMP</span><span class="p">:</span> <span class="s2">&quot;DATETIME&quot;</span><span class="p">,</span>
-</span><span id="L-273"><a href="#L-273"><span class="linenos">273</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMPTZ</span><span class="p">:</span> <span class="s2">&quot;TIMESTAMP&quot;</span><span class="p">,</span>
-</span><span id="L-274"><a href="#L-274"><span class="linenos">274</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">TINYINT</span><span class="p">:</span> <span class="s2">&quot;INT64&quot;</span><span class="p">,</span>
-</span><span id="L-275"><a href="#L-275"><span class="linenos">275</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">VARCHAR</span><span class="p">:</span> <span class="s2">&quot;STRING&quot;</span><span class="p">,</span>
-</span><span id="L-276"><a href="#L-276"><span class="linenos">276</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">VARIANT</span><span class="p">:</span> <span class="s2">&quot;ANY TYPE&quot;</span><span class="p">,</span>
-</span><span id="L-277"><a href="#L-277"><span class="linenos">277</span></a> <span class="p">}</span>
-</span><span id="L-278"><a href="#L-278"><span class="linenos">278</span></a>
-</span><span id="L-279"><a href="#L-279"><span class="linenos">279</span></a> <span class="n">PROPERTIES_LOCATION</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="L-280"><a href="#L-280"><span class="linenos">280</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">PROPERTIES_LOCATION</span><span class="p">,</span> <span class="c1"># type: ignore</span>
-</span><span id="L-281"><a href="#L-281"><span class="linenos">281</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">PartitionedByProperty</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_SCHEMA</span><span class="p">,</span>
-</span><span id="L-282"><a href="#L-282"><span class="linenos">282</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">VolatileProperty</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">UNSUPPORTED</span><span class="p">,</span>
-</span><span id="L-283"><a href="#L-283"><span class="linenos">283</span></a> <span class="p">}</span>
-</span><span id="L-284"><a href="#L-284"><span class="linenos">284</span></a>
-</span><span id="L-285"><a href="#L-285"><span class="linenos">285</span></a> <span class="k">def</span> <span class="nf">array_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Array</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
-</span><span id="L-286"><a href="#L-286"><span class="linenos">286</span></a> <span class="n">first_arg</span> <span class="o">=</span> <span class="n">seq_get</span><span class="p">(</span><span class="n">expression</span><span class="o">.</span><span class="n">expressions</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
-</span><span id="L-287"><a href="#L-287"><span class="linenos">287</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">first_arg</span><span class="p">,</span> <span class="n">exp</span><span class="o">.</span><span class="n">Subqueryable</span><span class="p">):</span>
-</span><span id="L-288"><a href="#L-288"><span class="linenos">288</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">&quot;ARRAY</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">wrap</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">first_arg</span><span class="p">))</span><span class="si">}</span><span class="s2">&quot;</span>
-</span><span id="L-289"><a href="#L-289"><span class="linenos">289</span></a>
-</span><span id="L-290"><a href="#L-290"><span class="linenos">290</span></a> <span class="k">return</span> <span class="n">inline_array_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">)</span>
-</span><span id="L-291"><a href="#L-291"><span class="linenos">291</span></a>
-</span><span id="L-292"><a href="#L-292"><span class="linenos">292</span></a> <span class="k">def</span> <span class="nf">transaction_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">_</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
-</span><span id="L-293"><a href="#L-293"><span class="linenos">293</span></a> <span class="k">return</span> <span class="s2">&quot;BEGIN TRANSACTION&quot;</span>
-</span><span id="L-294"><a href="#L-294"><span class="linenos">294</span></a>
-</span><span id="L-295"><a href="#L-295"><span class="linenos">295</span></a> <span class="k">def</span> <span class="nf">commit_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">_</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
-</span><span id="L-296"><a href="#L-296"><span class="linenos">296</span></a> <span class="k">return</span> <span class="s2">&quot;COMMIT TRANSACTION&quot;</span>
-</span><span id="L-297"><a href="#L-297"><span class="linenos">297</span></a>
-</span><span id="L-298"><a href="#L-298"><span class="linenos">298</span></a> <span class="k">def</span> <span class="nf">rollback_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">_</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
-</span><span id="L-299"><a href="#L-299"><span class="linenos">299</span></a> <span class="k">return</span> <span class="s2">&quot;ROLLBACK TRANSACTION&quot;</span>
-</span><span id="L-300"><a href="#L-300"><span class="linenos">300</span></a>
-</span><span id="L-301"><a href="#L-301"><span class="linenos">301</span></a> <span class="k">def</span> <span class="nf">in_unnest_op</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Unnest</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
-</span><span id="L-302"><a href="#L-302"><span class="linenos">302</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span>
+</span><span id="L-108"><a href="#L-108"><span class="linenos">108</span></a> <span class="k">return</span> <span class="n">expression</span>
+</span><span id="L-109"><a href="#L-109"><span class="linenos">109</span></a>
+</span><span id="L-110"><a href="#L-110"><span class="linenos">110</span></a>
+</span><span id="L-111"><a href="#L-111"><span class="linenos">111</span></a><span class="k">class</span> <span class="nc">BigQuery</span><span class="p">(</span><span class="n">Dialect</span><span class="p">):</span>
+</span><span id="L-112"><a href="#L-112"><span class="linenos">112</span></a> <span class="n">unnest_column_only</span> <span class="o">=</span> <span class="kc">True</span>
+</span><span id="L-113"><a href="#L-113"><span class="linenos">113</span></a> <span class="n">time_mapping</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="L-114"><a href="#L-114"><span class="linenos">114</span></a> <span class="s2">&quot;%M&quot;</span><span class="p">:</span> <span class="s2">&quot;%-M&quot;</span><span class="p">,</span>
+</span><span id="L-115"><a href="#L-115"><span class="linenos">115</span></a> <span class="s2">&quot;</span><span class="si">%d</span><span class="s2">&quot;</span><span class="p">:</span> <span class="s2">&quot;</span><span class="si">%-d</span><span class="s2">&quot;</span><span class="p">,</span>
+</span><span id="L-116"><a href="#L-116"><span class="linenos">116</span></a> <span class="s2">&quot;%m&quot;</span><span class="p">:</span> <span class="s2">&quot;%-m&quot;</span><span class="p">,</span>
+</span><span id="L-117"><a href="#L-117"><span class="linenos">117</span></a> <span class="s2">&quot;%y&quot;</span><span class="p">:</span> <span class="s2">&quot;%-y&quot;</span><span class="p">,</span>
+</span><span id="L-118"><a href="#L-118"><span class="linenos">118</span></a> <span class="s2">&quot;%H&quot;</span><span class="p">:</span> <span class="s2">&quot;%-H&quot;</span><span class="p">,</span>
+</span><span id="L-119"><a href="#L-119"><span class="linenos">119</span></a> <span class="s2">&quot;%I&quot;</span><span class="p">:</span> <span class="s2">&quot;%-I&quot;</span><span class="p">,</span>
+</span><span id="L-120"><a href="#L-120"><span class="linenos">120</span></a> <span class="s2">&quot;%S&quot;</span><span class="p">:</span> <span class="s2">&quot;%-S&quot;</span><span class="p">,</span>
+</span><span id="L-121"><a href="#L-121"><span class="linenos">121</span></a> <span class="s2">&quot;%j&quot;</span><span class="p">:</span> <span class="s2">&quot;%-j&quot;</span><span class="p">,</span>
+</span><span id="L-122"><a href="#L-122"><span class="linenos">122</span></a> <span class="p">}</span>
+</span><span id="L-123"><a href="#L-123"><span class="linenos">123</span></a>
+</span><span id="L-124"><a href="#L-124"><span class="linenos">124</span></a> <span class="k">class</span> <span class="nc">Tokenizer</span><span class="p">(</span><span class="n">tokens</span><span class="o">.</span><span class="n">Tokenizer</span><span class="p">):</span>
+</span><span id="L-125"><a href="#L-125"><span class="linenos">125</span></a> <span class="n">QUOTES</span> <span class="o">=</span> <span class="p">[</span>
+</span><span id="L-126"><a href="#L-126"><span class="linenos">126</span></a> <span class="p">(</span><span class="n">prefix</span> <span class="o">+</span> <span class="n">quote</span><span class="p">,</span> <span class="n">quote</span><span class="p">)</span> <span class="k">if</span> <span class="n">prefix</span> <span class="k">else</span> <span class="n">quote</span>
+</span><span id="L-127"><a href="#L-127"><span class="linenos">127</span></a> <span class="k">for</span> <span class="n">quote</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">&quot;&#39;&quot;</span><span class="p">,</span> <span class="s1">&#39;&quot;&#39;</span><span class="p">,</span> <span class="s1">&#39;&quot;&quot;&quot;&#39;</span><span class="p">,</span> <span class="s2">&quot;&#39;&#39;&#39;&quot;</span><span class="p">]</span>
+</span><span id="L-128"><a href="#L-128"><span class="linenos">128</span></a> <span class="k">for</span> <span class="n">prefix</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="s2">&quot;r&quot;</span><span class="p">,</span> <span class="s2">&quot;R&quot;</span><span class="p">]</span>
+</span><span id="L-129"><a href="#L-129"><span class="linenos">129</span></a> <span class="p">]</span>
+</span><span id="L-130"><a href="#L-130"><span class="linenos">130</span></a> <span class="n">COMMENTS</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;--&quot;</span><span class="p">,</span> <span class="s2">&quot;#&quot;</span><span class="p">,</span> <span class="p">(</span><span class="s2">&quot;/*&quot;</span><span class="p">,</span> <span class="s2">&quot;*/&quot;</span><span class="p">)]</span>
+</span><span id="L-131"><a href="#L-131"><span class="linenos">131</span></a> <span class="n">IDENTIFIERS</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;`&quot;</span><span class="p">]</span>
+</span><span id="L-132"><a href="#L-132"><span class="linenos">132</span></a> <span class="n">STRING_ESCAPES</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;</span><span class="se">\\</span><span class="s2">&quot;</span><span class="p">]</span>
+</span><span id="L-133"><a href="#L-133"><span class="linenos">133</span></a> <span class="n">HEX_STRINGS</span> <span class="o">=</span> <span class="p">[(</span><span class="s2">&quot;0x&quot;</span><span class="p">,</span> <span class="s2">&quot;&quot;</span><span class="p">),</span> <span class="p">(</span><span class="s2">&quot;0X&quot;</span><span class="p">,</span> <span class="s2">&quot;&quot;</span><span class="p">)]</span>
+</span><span id="L-134"><a href="#L-134"><span class="linenos">134</span></a>
+</span><span id="L-135"><a href="#L-135"><span class="linenos">135</span></a> <span class="n">KEYWORDS</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="L-136"><a href="#L-136"><span class="linenos">136</span></a> <span class="o">**</span><span class="n">tokens</span><span class="o">.</span><span class="n">Tokenizer</span><span class="o">.</span><span class="n">KEYWORDS</span><span class="p">,</span>
+</span><span id="L-137"><a href="#L-137"><span class="linenos">137</span></a> <span class="s2">&quot;ANY TYPE&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">VARIANT</span><span class="p">,</span>
+</span><span id="L-138"><a href="#L-138"><span class="linenos">138</span></a> <span class="s2">&quot;BEGIN&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">COMMAND</span><span class="p">,</span>
+</span><span id="L-139"><a href="#L-139"><span class="linenos">139</span></a> <span class="s2">&quot;BEGIN TRANSACTION&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">BEGIN</span><span class="p">,</span>
+</span><span id="L-140"><a href="#L-140"><span class="linenos">140</span></a> <span class="s2">&quot;CURRENT_DATETIME&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">CURRENT_DATETIME</span><span class="p">,</span>
+</span><span id="L-141"><a href="#L-141"><span class="linenos">141</span></a> <span class="s2">&quot;DECLARE&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">COMMAND</span><span class="p">,</span>
+</span><span id="L-142"><a href="#L-142"><span class="linenos">142</span></a> <span class="s2">&quot;GEOGRAPHY&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">GEOGRAPHY</span><span class="p">,</span>
+</span><span id="L-143"><a href="#L-143"><span class="linenos">143</span></a> <span class="s2">&quot;FLOAT64&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">DOUBLE</span><span class="p">,</span>
+</span><span id="L-144"><a href="#L-144"><span class="linenos">144</span></a> <span class="s2">&quot;INT64&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">BIGINT</span><span class="p">,</span>
+</span><span id="L-145"><a href="#L-145"><span class="linenos">145</span></a> <span class="s2">&quot;BYTES&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">BINARY</span><span class="p">,</span>
+</span><span id="L-146"><a href="#L-146"><span class="linenos">146</span></a> <span class="s2">&quot;NOT DETERMINISTIC&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">VOLATILE</span><span class="p">,</span>
+</span><span id="L-147"><a href="#L-147"><span class="linenos">147</span></a> <span class="s2">&quot;UNKNOWN&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">NULL</span><span class="p">,</span>
+</span><span id="L-148"><a href="#L-148"><span class="linenos">148</span></a> <span class="p">}</span>
+</span><span id="L-149"><a href="#L-149"><span class="linenos">149</span></a> <span class="n">KEYWORDS</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s2">&quot;DIV&quot;</span><span class="p">)</span>
+</span><span id="L-150"><a href="#L-150"><span class="linenos">150</span></a>
+</span><span id="L-151"><a href="#L-151"><span class="linenos">151</span></a> <span class="k">class</span> <span class="nc">Parser</span><span class="p">(</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="p">):</span>
+</span><span id="L-152"><a href="#L-152"><span class="linenos">152</span></a> <span class="n">PREFIXED_PIVOT_COLUMNS</span> <span class="o">=</span> <span class="kc">True</span>
+</span><span id="L-153"><a href="#L-153"><span class="linenos">153</span></a>
+</span><span id="L-154"><a href="#L-154"><span class="linenos">154</span></a> <span class="n">LOG_BASE_FIRST</span> <span class="o">=</span> <span class="kc">False</span>
+</span><span id="L-155"><a href="#L-155"><span class="linenos">155</span></a> <span class="n">LOG_DEFAULTS_TO_LN</span> <span class="o">=</span> <span class="kc">True</span>
+</span><span id="L-156"><a href="#L-156"><span class="linenos">156</span></a>
+</span><span id="L-157"><a href="#L-157"><span class="linenos">157</span></a> <span class="n">FUNCTIONS</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="L-158"><a href="#L-158"><span class="linenos">158</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">FUNCTIONS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
+</span><span id="L-159"><a href="#L-159"><span class="linenos">159</span></a> <span class="s2">&quot;DATE_TRUNC&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="n">args</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">DateTrunc</span><span class="p">(</span>
+</span><span id="L-160"><a href="#L-160"><span class="linenos">160</span></a> <span class="n">unit</span><span class="o">=</span><span class="n">exp</span><span class="o">.</span><span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">name</span><span class="p">),</span> <span class="c1"># type: ignore</span>
+</span><span id="L-161"><a href="#L-161"><span class="linenos">161</span></a> <span class="n">this</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span>
+</span><span id="L-162"><a href="#L-162"><span class="linenos">162</span></a> <span class="p">),</span>
+</span><span id="L-163"><a href="#L-163"><span class="linenos">163</span></a> <span class="s2">&quot;DATE_ADD&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">DateAdd</span><span class="p">),</span>
+</span><span id="L-164"><a href="#L-164"><span class="linenos">164</span></a> <span class="s2">&quot;DATETIME_ADD&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">DatetimeAdd</span><span class="p">),</span>
+</span><span id="L-165"><a href="#L-165"><span class="linenos">165</span></a> <span class="s2">&quot;DIV&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="n">args</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">IntDiv</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="n">expression</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">1</span><span class="p">)),</span>
+</span><span id="L-166"><a href="#L-166"><span class="linenos">166</span></a> <span class="s2">&quot;REGEXP_CONTAINS&quot;</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">RegexpLike</span><span class="o">.</span><span class="n">from_arg_list</span><span class="p">,</span>
+</span><span id="L-167"><a href="#L-167"><span class="linenos">167</span></a> <span class="s2">&quot;REGEXP_EXTRACT&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="n">args</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">RegexpExtract</span><span class="p">(</span>
+</span><span id="L-168"><a href="#L-168"><span class="linenos">168</span></a> <span class="n">this</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span>
+</span><span id="L-169"><a href="#L-169"><span class="linenos">169</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span>
+</span><span id="L-170"><a href="#L-170"><span class="linenos">170</span></a> <span class="n">position</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span>
+</span><span id="L-171"><a href="#L-171"><span class="linenos">171</span></a> <span class="n">occurrence</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span>
+</span><span id="L-172"><a href="#L-172"><span class="linenos">172</span></a> <span class="n">group</span><span class="o">=</span><span class="n">exp</span><span class="o">.</span><span class="n">Literal</span><span class="o">.</span><span class="n">number</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
+</span><span id="L-173"><a href="#L-173"><span class="linenos">173</span></a> <span class="k">if</span> <span class="n">re</span><span class="o">.</span><span class="n">compile</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">1</span><span class="p">)))</span><span class="o">.</span><span class="n">groups</span> <span class="o">==</span> <span class="mi">1</span>
+</span><span id="L-174"><a href="#L-174"><span class="linenos">174</span></a> <span class="k">else</span> <span class="kc">None</span><span class="p">,</span>
+</span><span id="L-175"><a href="#L-175"><span class="linenos">175</span></a> <span class="p">),</span>
+</span><span id="L-176"><a href="#L-176"><span class="linenos">176</span></a> <span class="s2">&quot;TIME_ADD&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">TimeAdd</span><span class="p">),</span>
+</span><span id="L-177"><a href="#L-177"><span class="linenos">177</span></a> <span class="s2">&quot;TIMESTAMP_ADD&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">TimestampAdd</span><span class="p">),</span>
+</span><span id="L-178"><a href="#L-178"><span class="linenos">178</span></a> <span class="s2">&quot;DATE_SUB&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">DateSub</span><span class="p">),</span>
+</span><span id="L-179"><a href="#L-179"><span class="linenos">179</span></a> <span class="s2">&quot;DATETIME_SUB&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">DatetimeSub</span><span class="p">),</span>
+</span><span id="L-180"><a href="#L-180"><span class="linenos">180</span></a> <span class="s2">&quot;TIME_SUB&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">TimeSub</span><span class="p">),</span>
+</span><span id="L-181"><a href="#L-181"><span class="linenos">181</span></a> <span class="s2">&quot;TIMESTAMP_SUB&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">TimestampSub</span><span class="p">),</span>
+</span><span id="L-182"><a href="#L-182"><span class="linenos">182</span></a> <span class="s2">&quot;PARSE_TIMESTAMP&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="n">args</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">StrToTime</span><span class="p">(</span>
+</span><span id="L-183"><a href="#L-183"><span class="linenos">183</span></a> <span class="n">this</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="nb">format</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
+</span><span id="L-184"><a href="#L-184"><span class="linenos">184</span></a> <span class="p">),</span>
+</span><span id="L-185"><a href="#L-185"><span class="linenos">185</span></a> <span class="p">}</span>
+</span><span id="L-186"><a href="#L-186"><span class="linenos">186</span></a>
+</span><span id="L-187"><a href="#L-187"><span class="linenos">187</span></a> <span class="n">FUNCTION_PARSERS</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="L-188"><a href="#L-188"><span class="linenos">188</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">FUNCTION_PARSERS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
+</span><span id="L-189"><a href="#L-189"><span class="linenos">189</span></a> <span class="s2">&quot;ARRAY&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">Array</span><span class="p">,</span> <span class="n">expressions</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">_parse_statement</span><span class="p">()]),</span>
+</span><span id="L-190"><a href="#L-190"><span class="linenos">190</span></a> <span class="p">}</span>
+</span><span id="L-191"><a href="#L-191"><span class="linenos">191</span></a> <span class="n">FUNCTION_PARSERS</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s2">&quot;TRIM&quot;</span><span class="p">)</span>
+</span><span id="L-192"><a href="#L-192"><span class="linenos">192</span></a>
+</span><span id="L-193"><a href="#L-193"><span class="linenos">193</span></a> <span class="n">NO_PAREN_FUNCTIONS</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="L-194"><a href="#L-194"><span class="linenos">194</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">NO_PAREN_FUNCTIONS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
+</span><span id="L-195"><a href="#L-195"><span class="linenos">195</span></a> <span class="n">TokenType</span><span class="o">.</span><span class="n">CURRENT_DATETIME</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">CurrentDatetime</span><span class="p">,</span>
+</span><span id="L-196"><a href="#L-196"><span class="linenos">196</span></a> <span class="p">}</span>
+</span><span id="L-197"><a href="#L-197"><span class="linenos">197</span></a>
+</span><span id="L-198"><a href="#L-198"><span class="linenos">198</span></a> <span class="n">NESTED_TYPE_TOKENS</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="L-199"><a href="#L-199"><span class="linenos">199</span></a> <span class="o">*</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">NESTED_TYPE_TOKENS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
+</span><span id="L-200"><a href="#L-200"><span class="linenos">200</span></a> <span class="n">TokenType</span><span class="o">.</span><span class="n">TABLE</span><span class="p">,</span>
+</span><span id="L-201"><a href="#L-201"><span class="linenos">201</span></a> <span class="p">}</span>
+</span><span id="L-202"><a href="#L-202"><span class="linenos">202</span></a>
+</span><span id="L-203"><a href="#L-203"><span class="linenos">203</span></a> <span class="n">ID_VAR_TOKENS</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="L-204"><a href="#L-204"><span class="linenos">204</span></a> <span class="o">*</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">ID_VAR_TOKENS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
+</span><span id="L-205"><a href="#L-205"><span class="linenos">205</span></a> <span class="n">TokenType</span><span class="o">.</span><span class="n">VALUES</span><span class="p">,</span>
+</span><span id="L-206"><a href="#L-206"><span class="linenos">206</span></a> <span class="p">}</span>
+</span><span id="L-207"><a href="#L-207"><span class="linenos">207</span></a>
+</span><span id="L-208"><a href="#L-208"><span class="linenos">208</span></a> <span class="n">PROPERTY_PARSERS</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="L-209"><a href="#L-209"><span class="linenos">209</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">PROPERTY_PARSERS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
+</span><span id="L-210"><a href="#L-210"><span class="linenos">210</span></a> <span class="s2">&quot;NOT DETERMINISTIC&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span>
+</span><span id="L-211"><a href="#L-211"><span class="linenos">211</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">StabilityProperty</span><span class="p">,</span> <span class="n">this</span><span class="o">=</span><span class="n">exp</span><span class="o">.</span><span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="s2">&quot;VOLATILE&quot;</span><span class="p">)</span>
+</span><span id="L-212"><a href="#L-212"><span class="linenos">212</span></a> <span class="p">),</span>
+</span><span id="L-213"><a href="#L-213"><span class="linenos">213</span></a> <span class="s2">&quot;OPTIONS&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_with_property</span><span class="p">(),</span>
+</span><span id="L-214"><a href="#L-214"><span class="linenos">214</span></a> <span class="p">}</span>
+</span><span id="L-215"><a href="#L-215"><span class="linenos">215</span></a>
+</span><span id="L-216"><a href="#L-216"><span class="linenos">216</span></a> <span class="n">CONSTRAINT_PARSERS</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="L-217"><a href="#L-217"><span class="linenos">217</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">CONSTRAINT_PARSERS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
+</span><span id="L-218"><a href="#L-218"><span class="linenos">218</span></a> <span class="s2">&quot;OPTIONS&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">_parse_with_property</span><span class="p">()),</span>
+</span><span id="L-219"><a href="#L-219"><span class="linenos">219</span></a> <span class="p">}</span>
+</span><span id="L-220"><a href="#L-220"><span class="linenos">220</span></a>
+</span><span id="L-221"><a href="#L-221"><span class="linenos">221</span></a> <span class="k">class</span> <span class="nc">Generator</span><span class="p">(</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="p">):</span>
+</span><span id="L-222"><a href="#L-222"><span class="linenos">222</span></a> <span class="n">EXPLICIT_UNION</span> <span class="o">=</span> <span class="kc">True</span>
+</span><span id="L-223"><a href="#L-223"><span class="linenos">223</span></a> <span class="n">INTERVAL_ALLOWS_PLURAL_FORM</span> <span class="o">=</span> <span class="kc">False</span>
+</span><span id="L-224"><a href="#L-224"><span class="linenos">224</span></a> <span class="n">JOIN_HINTS</span> <span class="o">=</span> <span class="kc">False</span>
+</span><span id="L-225"><a href="#L-225"><span class="linenos">225</span></a> <span class="n">TABLE_HINTS</span> <span class="o">=</span> <span class="kc">False</span>
+</span><span id="L-226"><a href="#L-226"><span class="linenos">226</span></a> <span class="n">LIMIT_FETCH</span> <span class="o">=</span> <span class="s2">&quot;LIMIT&quot;</span>
+</span><span id="L-227"><a href="#L-227"><span class="linenos">227</span></a>
+</span><span id="L-228"><a href="#L-228"><span class="linenos">228</span></a> <span class="n">TRANSFORMS</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="L-229"><a href="#L-229"><span class="linenos">229</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">TRANSFORMS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
+</span><span id="L-230"><a href="#L-230"><span class="linenos">230</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">ArraySize</span><span class="p">:</span> <span class="n">rename_func</span><span class="p">(</span><span class="s2">&quot;ARRAY_LENGTH&quot;</span><span class="p">),</span>
+</span><span id="L-231"><a href="#L-231"><span class="linenos">231</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">AtTimeZone</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">func</span><span class="p">(</span>
+</span><span id="L-232"><a href="#L-232"><span class="linenos">232</span></a> <span class="s2">&quot;TIMESTAMP&quot;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">func</span><span class="p">(</span><span class="s2">&quot;DATETIME&quot;</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;zone&quot;</span><span class="p">))</span>
+</span><span id="L-233"><a href="#L-233"><span class="linenos">233</span></a> <span class="p">),</span>
+</span><span id="L-234"><a href="#L-234"><span class="linenos">234</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Cast</span><span class="p">:</span> <span class="n">transforms</span><span class="o">.</span><span class="n">preprocess</span><span class="p">([</span><span class="n">transforms</span><span class="o">.</span><span class="n">remove_precision_parameterized_types</span><span class="p">]),</span>
+</span><span id="L-235"><a href="#L-235"><span class="linenos">235</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DateAdd</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;DATE&quot;</span><span class="p">,</span> <span class="s2">&quot;ADD&quot;</span><span class="p">),</span>
+</span><span id="L-236"><a href="#L-236"><span class="linenos">236</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DateSub</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;DATE&quot;</span><span class="p">,</span> <span class="s2">&quot;SUB&quot;</span><span class="p">),</span>
+</span><span id="L-237"><a href="#L-237"><span class="linenos">237</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DatetimeAdd</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;DATETIME&quot;</span><span class="p">,</span> <span class="s2">&quot;ADD&quot;</span><span class="p">),</span>
+</span><span id="L-238"><a href="#L-238"><span class="linenos">238</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DatetimeSub</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;DATETIME&quot;</span><span class="p">,</span> <span class="s2">&quot;SUB&quot;</span><span class="p">),</span>
+</span><span id="L-239"><a href="#L-239"><span class="linenos">239</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DateDiff</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">&quot;DATE_DIFF(</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">&#39;this&#39;</span><span class="p">)</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">&#39;expression&#39;</span><span class="p">)</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;unit&#39;</span><span class="p">,</span><span class="w"> </span><span class="s1">&#39;DAY&#39;</span><span class="p">))</span><span class="si">}</span><span class="s2">)&quot;</span><span class="p">,</span>
+</span><span id="L-240"><a href="#L-240"><span class="linenos">240</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DateStrToDate</span><span class="p">:</span> <span class="n">datestrtodate_sql</span><span class="p">,</span>
+</span><span id="L-241"><a href="#L-241"><span class="linenos">241</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DateTrunc</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">func</span><span class="p">(</span><span class="s2">&quot;DATE_TRUNC&quot;</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">&quot;unit&quot;</span><span class="p">)),</span>
+</span><span id="L-242"><a href="#L-242"><span class="linenos">242</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">GroupConcat</span><span class="p">:</span> <span class="n">rename_func</span><span class="p">(</span><span class="s2">&quot;STRING_AGG&quot;</span><span class="p">),</span>
+</span><span id="L-243"><a href="#L-243"><span class="linenos">243</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">ILike</span><span class="p">:</span> <span class="n">no_ilike_sql</span><span class="p">,</span>
+</span><span id="L-244"><a href="#L-244"><span class="linenos">244</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">IntDiv</span><span class="p">:</span> <span class="n">rename_func</span><span class="p">(</span><span class="s2">&quot;DIV&quot;</span><span class="p">),</span>
+</span><span id="L-245"><a href="#L-245"><span class="linenos">245</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Max</span><span class="p">:</span> <span class="n">max_or_greatest</span><span class="p">,</span>
+</span><span id="L-246"><a href="#L-246"><span class="linenos">246</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Min</span><span class="p">:</span> <span class="n">min_or_least</span><span class="p">,</span>
+</span><span id="L-247"><a href="#L-247"><span class="linenos">247</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Select</span><span class="p">:</span> <span class="n">transforms</span><span class="o">.</span><span class="n">preprocess</span><span class="p">(</span>
+</span><span id="L-248"><a href="#L-248"><span class="linenos">248</span></a> <span class="p">[</span><span class="n">_unqualify_unnest</span><span class="p">,</span> <span class="n">transforms</span><span class="o">.</span><span class="n">eliminate_distinct_on</span><span class="p">]</span>
+</span><span id="L-249"><a href="#L-249"><span class="linenos">249</span></a> <span class="p">),</span>
+</span><span id="L-250"><a href="#L-250"><span class="linenos">250</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">StrToTime</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">&quot;PARSE_TIMESTAMP(</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">format_time</span><span class="p">(</span><span class="n">e</span><span class="p">)</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">&#39;this&#39;</span><span class="p">)</span><span class="si">}</span><span class="s2">)&quot;</span><span class="p">,</span>
+</span><span id="L-251"><a href="#L-251"><span class="linenos">251</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TimeAdd</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;TIME&quot;</span><span class="p">,</span> <span class="s2">&quot;ADD&quot;</span><span class="p">),</span>
+</span><span id="L-252"><a href="#L-252"><span class="linenos">252</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TimeSub</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;TIME&quot;</span><span class="p">,</span> <span class="s2">&quot;SUB&quot;</span><span class="p">),</span>
+</span><span id="L-253"><a href="#L-253"><span class="linenos">253</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TimestampAdd</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;TIMESTAMP&quot;</span><span class="p">,</span> <span class="s2">&quot;ADD&quot;</span><span class="p">),</span>
+</span><span id="L-254"><a href="#L-254"><span class="linenos">254</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TimestampSub</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;TIMESTAMP&quot;</span><span class="p">,</span> <span class="s2">&quot;SUB&quot;</span><span class="p">),</span>
+</span><span id="L-255"><a href="#L-255"><span class="linenos">255</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TimeStrToTime</span><span class="p">:</span> <span class="n">timestrtotime_sql</span><span class="p">,</span>
+</span><span id="L-256"><a href="#L-256"><span class="linenos">256</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TsOrDsToDate</span><span class="p">:</span> <span class="n">ts_or_ds_to_date_sql</span><span class="p">(</span><span class="s2">&quot;bigquery&quot;</span><span class="p">),</span>
+</span><span id="L-257"><a href="#L-257"><span class="linenos">257</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TsOrDsAdd</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;DATE&quot;</span><span class="p">,</span> <span class="s2">&quot;ADD&quot;</span><span class="p">),</span>
+</span><span id="L-258"><a href="#L-258"><span class="linenos">258</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">PartitionedByProperty</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">&quot;PARTITION BY </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">&#39;this&#39;</span><span class="p">)</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">,</span>
+</span><span id="L-259"><a href="#L-259"><span class="linenos">259</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">VariancePop</span><span class="p">:</span> <span class="n">rename_func</span><span class="p">(</span><span class="s2">&quot;VAR_POP&quot;</span><span class="p">),</span>
+</span><span id="L-260"><a href="#L-260"><span class="linenos">260</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Values</span><span class="p">:</span> <span class="n">_derived_table_values_to_unnest</span><span class="p">,</span>
+</span><span id="L-261"><a href="#L-261"><span class="linenos">261</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">ReturnsProperty</span><span class="p">:</span> <span class="n">_returnsproperty_sql</span><span class="p">,</span>
+</span><span id="L-262"><a href="#L-262"><span class="linenos">262</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Create</span><span class="p">:</span> <span class="n">_create_sql</span><span class="p">,</span>
+</span><span id="L-263"><a href="#L-263"><span class="linenos">263</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Trim</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">func</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;TRIM&quot;</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">expression</span><span class="p">),</span>
+</span><span id="L-264"><a href="#L-264"><span class="linenos">264</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">StabilityProperty</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">&quot;DETERMINISTIC&quot;</span>
+</span><span id="L-265"><a href="#L-265"><span class="linenos">265</span></a> <span class="k">if</span> <span class="n">e</span><span class="o">.</span><span class="n">name</span> <span class="o">==</span> <span class="s2">&quot;IMMUTABLE&quot;</span>
+</span><span id="L-266"><a href="#L-266"><span class="linenos">266</span></a> <span class="k">else</span> <span class="s2">&quot;NOT DETERMINISTIC&quot;</span><span class="p">,</span>
+</span><span id="L-267"><a href="#L-267"><span class="linenos">267</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">RegexpLike</span><span class="p">:</span> <span class="n">rename_func</span><span class="p">(</span><span class="s2">&quot;REGEXP_CONTAINS&quot;</span><span class="p">),</span>
+</span><span id="L-268"><a href="#L-268"><span class="linenos">268</span></a> <span class="p">}</span>
+</span><span id="L-269"><a href="#L-269"><span class="linenos">269</span></a>
+</span><span id="L-270"><a href="#L-270"><span class="linenos">270</span></a> <span class="n">TYPE_MAPPING</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="L-271"><a href="#L-271"><span class="linenos">271</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">TYPE_MAPPING</span><span class="p">,</span> <span class="c1"># type: ignore</span>
+</span><span id="L-272"><a href="#L-272"><span class="linenos">272</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">BIGDECIMAL</span><span class="p">:</span> <span class="s2">&quot;BIGNUMERIC&quot;</span><span class="p">,</span>
+</span><span id="L-273"><a href="#L-273"><span class="linenos">273</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">BIGINT</span><span class="p">:</span> <span class="s2">&quot;INT64&quot;</span><span class="p">,</span>
+</span><span id="L-274"><a href="#L-274"><span class="linenos">274</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">BINARY</span><span class="p">:</span> <span class="s2">&quot;BYTES&quot;</span><span class="p">,</span>
+</span><span id="L-275"><a href="#L-275"><span class="linenos">275</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">BOOLEAN</span><span class="p">:</span> <span class="s2">&quot;BOOL&quot;</span><span class="p">,</span>
+</span><span id="L-276"><a href="#L-276"><span class="linenos">276</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">CHAR</span><span class="p">:</span> <span class="s2">&quot;STRING&quot;</span><span class="p">,</span>
+</span><span id="L-277"><a href="#L-277"><span class="linenos">277</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">DECIMAL</span><span class="p">:</span> <span class="s2">&quot;NUMERIC&quot;</span><span class="p">,</span>
+</span><span id="L-278"><a href="#L-278"><span class="linenos">278</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">DOUBLE</span><span class="p">:</span> <span class="s2">&quot;FLOAT64&quot;</span><span class="p">,</span>
+</span><span id="L-279"><a href="#L-279"><span class="linenos">279</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">FLOAT</span><span class="p">:</span> <span class="s2">&quot;FLOAT64&quot;</span><span class="p">,</span>
+</span><span id="L-280"><a href="#L-280"><span class="linenos">280</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">INT</span><span class="p">:</span> <span class="s2">&quot;INT64&quot;</span><span class="p">,</span>
+</span><span id="L-281"><a href="#L-281"><span class="linenos">281</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">NCHAR</span><span class="p">:</span> <span class="s2">&quot;STRING&quot;</span><span class="p">,</span>
+</span><span id="L-282"><a href="#L-282"><span class="linenos">282</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">NVARCHAR</span><span class="p">:</span> <span class="s2">&quot;STRING&quot;</span><span class="p">,</span>
+</span><span id="L-283"><a href="#L-283"><span class="linenos">283</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">SMALLINT</span><span class="p">:</span> <span class="s2">&quot;INT64&quot;</span><span class="p">,</span>
+</span><span id="L-284"><a href="#L-284"><span class="linenos">284</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">TEXT</span><span class="p">:</span> <span class="s2">&quot;STRING&quot;</span><span class="p">,</span>
+</span><span id="L-285"><a href="#L-285"><span class="linenos">285</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMP</span><span class="p">:</span> <span class="s2">&quot;DATETIME&quot;</span><span class="p">,</span>
+</span><span id="L-286"><a href="#L-286"><span class="linenos">286</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMPTZ</span><span class="p">:</span> <span class="s2">&quot;TIMESTAMP&quot;</span><span class="p">,</span>
+</span><span id="L-287"><a href="#L-287"><span class="linenos">287</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">TINYINT</span><span class="p">:</span> <span class="s2">&quot;INT64&quot;</span><span class="p">,</span>
+</span><span id="L-288"><a href="#L-288"><span class="linenos">288</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">VARBINARY</span><span class="p">:</span> <span class="s2">&quot;BYTES&quot;</span><span class="p">,</span>
+</span><span id="L-289"><a href="#L-289"><span class="linenos">289</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">VARCHAR</span><span class="p">:</span> <span class="s2">&quot;STRING&quot;</span><span class="p">,</span>
+</span><span id="L-290"><a href="#L-290"><span class="linenos">290</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">VARIANT</span><span class="p">:</span> <span class="s2">&quot;ANY TYPE&quot;</span><span class="p">,</span>
+</span><span id="L-291"><a href="#L-291"><span class="linenos">291</span></a> <span class="p">}</span>
+</span><span id="L-292"><a href="#L-292"><span class="linenos">292</span></a>
+</span><span id="L-293"><a href="#L-293"><span class="linenos">293</span></a> <span class="n">PROPERTIES_LOCATION</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="L-294"><a href="#L-294"><span class="linenos">294</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">PROPERTIES_LOCATION</span><span class="p">,</span> <span class="c1"># type: ignore</span>
+</span><span id="L-295"><a href="#L-295"><span class="linenos">295</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">PartitionedByProperty</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_SCHEMA</span><span class="p">,</span>
+</span><span id="L-296"><a href="#L-296"><span class="linenos">296</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">VolatileProperty</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">UNSUPPORTED</span><span class="p">,</span>
+</span><span id="L-297"><a href="#L-297"><span class="linenos">297</span></a> <span class="p">}</span>
+</span><span id="L-298"><a href="#L-298"><span class="linenos">298</span></a>
+</span><span id="L-299"><a href="#L-299"><span class="linenos">299</span></a> <span class="k">def</span> <span class="nf">array_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Array</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="L-300"><a href="#L-300"><span class="linenos">300</span></a> <span class="n">first_arg</span> <span class="o">=</span> <span class="n">seq_get</span><span class="p">(</span><span class="n">expression</span><span class="o">.</span><span class="n">expressions</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
+</span><span id="L-301"><a href="#L-301"><span class="linenos">301</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">first_arg</span><span class="p">,</span> <span class="n">exp</span><span class="o">.</span><span class="n">Subqueryable</span><span class="p">):</span>
+</span><span id="L-302"><a href="#L-302"><span class="linenos">302</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">&quot;ARRAY</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">wrap</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">first_arg</span><span class="p">))</span><span class="si">}</span><span class="s2">&quot;</span>
</span><span id="L-303"><a href="#L-303"><span class="linenos">303</span></a>
-</span><span id="L-304"><a href="#L-304"><span class="linenos">304</span></a> <span class="k">def</span> <span class="nf">except_op</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Except</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
-</span><span id="L-305"><a href="#L-305"><span class="linenos">305</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;distinct&quot;</span><span class="p">,</span> <span class="kc">False</span><span class="p">):</span>
-</span><span id="L-306"><a href="#L-306"><span class="linenos">306</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">unsupported</span><span class="p">(</span><span class="s2">&quot;EXCEPT without DISTINCT is not supported in BigQuery&quot;</span><span class="p">)</span>
-</span><span id="L-307"><a href="#L-307"><span class="linenos">307</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">&quot;EXCEPT</span><span class="si">{</span><span class="s1">&#39; DISTINCT&#39;</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;distinct&#39;</span><span class="p">)</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="s1">&#39; ALL&#39;</span><span class="si">}</span><span class="s2">&quot;</span>
+</span><span id="L-304"><a href="#L-304"><span class="linenos">304</span></a> <span class="k">return</span> <span class="n">inline_array_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">)</span>
+</span><span id="L-305"><a href="#L-305"><span class="linenos">305</span></a>
+</span><span id="L-306"><a href="#L-306"><span class="linenos">306</span></a> <span class="k">def</span> <span class="nf">transaction_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">_</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="L-307"><a href="#L-307"><span class="linenos">307</span></a> <span class="k">return</span> <span class="s2">&quot;BEGIN TRANSACTION&quot;</span>
</span><span id="L-308"><a href="#L-308"><span class="linenos">308</span></a>
-</span><span id="L-309"><a href="#L-309"><span class="linenos">309</span></a> <span class="k">def</span> <span class="nf">intersect_op</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Intersect</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
-</span><span id="L-310"><a href="#L-310"><span class="linenos">310</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;distinct&quot;</span><span class="p">,</span> <span class="kc">False</span><span class="p">):</span>
-</span><span id="L-311"><a href="#L-311"><span class="linenos">311</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">unsupported</span><span class="p">(</span><span class="s2">&quot;INTERSECT without DISTINCT is not supported in BigQuery&quot;</span><span class="p">)</span>
-</span><span id="L-312"><a href="#L-312"><span class="linenos">312</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">&quot;INTERSECT</span><span class="si">{</span><span class="s1">&#39; DISTINCT&#39;</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;distinct&#39;</span><span class="p">)</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="s1">&#39; ALL&#39;</span><span class="si">}</span><span class="s2">&quot;</span>
+</span><span id="L-309"><a href="#L-309"><span class="linenos">309</span></a> <span class="k">def</span> <span class="nf">commit_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">_</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="L-310"><a href="#L-310"><span class="linenos">310</span></a> <span class="k">return</span> <span class="s2">&quot;COMMIT TRANSACTION&quot;</span>
+</span><span id="L-311"><a href="#L-311"><span class="linenos">311</span></a>
+</span><span id="L-312"><a href="#L-312"><span class="linenos">312</span></a> <span class="k">def</span> <span class="nf">rollback_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">_</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="L-313"><a href="#L-313"><span class="linenos">313</span></a> <span class="k">return</span> <span class="s2">&quot;ROLLBACK TRANSACTION&quot;</span>
+</span><span id="L-314"><a href="#L-314"><span class="linenos">314</span></a>
+</span><span id="L-315"><a href="#L-315"><span class="linenos">315</span></a> <span class="k">def</span> <span class="nf">in_unnest_op</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Unnest</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="L-316"><a href="#L-316"><span class="linenos">316</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span>
+</span><span id="L-317"><a href="#L-317"><span class="linenos">317</span></a>
+</span><span id="L-318"><a href="#L-318"><span class="linenos">318</span></a> <span class="k">def</span> <span class="nf">except_op</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Except</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="L-319"><a href="#L-319"><span class="linenos">319</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;distinct&quot;</span><span class="p">,</span> <span class="kc">False</span><span class="p">):</span>
+</span><span id="L-320"><a href="#L-320"><span class="linenos">320</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">unsupported</span><span class="p">(</span><span class="s2">&quot;EXCEPT without DISTINCT is not supported in BigQuery&quot;</span><span class="p">)</span>
+</span><span id="L-321"><a href="#L-321"><span class="linenos">321</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">&quot;EXCEPT</span><span class="si">{</span><span class="s1">&#39; DISTINCT&#39;</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;distinct&#39;</span><span class="p">)</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="s1">&#39; ALL&#39;</span><span class="si">}</span><span class="s2">&quot;</span>
+</span><span id="L-322"><a href="#L-322"><span class="linenos">322</span></a>
+</span><span id="L-323"><a href="#L-323"><span class="linenos">323</span></a> <span class="k">def</span> <span class="nf">intersect_op</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Intersect</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="L-324"><a href="#L-324"><span class="linenos">324</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;distinct&quot;</span><span class="p">,</span> <span class="kc">False</span><span class="p">):</span>
+</span><span id="L-325"><a href="#L-325"><span class="linenos">325</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">unsupported</span><span class="p">(</span><span class="s2">&quot;INTERSECT without DISTINCT is not supported in BigQuery&quot;</span><span class="p">)</span>
+</span><span id="L-326"><a href="#L-326"><span class="linenos">326</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">&quot;INTERSECT</span><span class="si">{</span><span class="s1">&#39; DISTINCT&#39;</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;distinct&#39;</span><span class="p">)</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="s1">&#39; ALL&#39;</span><span class="si">}</span><span class="s2">&quot;</span>
+</span><span id="L-327"><a href="#L-327"><span class="linenos">327</span></a>
+</span><span id="L-328"><a href="#L-328"><span class="linenos">328</span></a> <span class="k">def</span> <span class="nf">with_properties</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">properties</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="L-329"><a href="#L-329"><span class="linenos">329</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">properties</span><span class="p">(</span><span class="n">properties</span><span class="p">,</span> <span class="n">prefix</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">seg</span><span class="p">(</span><span class="s2">&quot;OPTIONS&quot;</span><span class="p">))</span>
</span></pre></div>
@@ -425,211 +445,225 @@
</div>
<a class="headerlink" href="#BigQuery"></a>
- <div class="pdoc-code codehilite"><pre><span></span><span id="BigQuery-109"><a href="#BigQuery-109"><span class="linenos">109</span></a><span class="k">class</span> <span class="nc">BigQuery</span><span class="p">(</span><span class="n">Dialect</span><span class="p">):</span>
-</span><span id="BigQuery-110"><a href="#BigQuery-110"><span class="linenos">110</span></a> <span class="n">unnest_column_only</span> <span class="o">=</span> <span class="kc">True</span>
-</span><span id="BigQuery-111"><a href="#BigQuery-111"><span class="linenos">111</span></a> <span class="n">time_mapping</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="BigQuery-112"><a href="#BigQuery-112"><span class="linenos">112</span></a> <span class="s2">&quot;%M&quot;</span><span class="p">:</span> <span class="s2">&quot;%-M&quot;</span><span class="p">,</span>
-</span><span id="BigQuery-113"><a href="#BigQuery-113"><span class="linenos">113</span></a> <span class="s2">&quot;</span><span class="si">%d</span><span class="s2">&quot;</span><span class="p">:</span> <span class="s2">&quot;</span><span class="si">%-d</span><span class="s2">&quot;</span><span class="p">,</span>
-</span><span id="BigQuery-114"><a href="#BigQuery-114"><span class="linenos">114</span></a> <span class="s2">&quot;%m&quot;</span><span class="p">:</span> <span class="s2">&quot;%-m&quot;</span><span class="p">,</span>
-</span><span id="BigQuery-115"><a href="#BigQuery-115"><span class="linenos">115</span></a> <span class="s2">&quot;%y&quot;</span><span class="p">:</span> <span class="s2">&quot;%-y&quot;</span><span class="p">,</span>
-</span><span id="BigQuery-116"><a href="#BigQuery-116"><span class="linenos">116</span></a> <span class="s2">&quot;%H&quot;</span><span class="p">:</span> <span class="s2">&quot;%-H&quot;</span><span class="p">,</span>
-</span><span id="BigQuery-117"><a href="#BigQuery-117"><span class="linenos">117</span></a> <span class="s2">&quot;%I&quot;</span><span class="p">:</span> <span class="s2">&quot;%-I&quot;</span><span class="p">,</span>
-</span><span id="BigQuery-118"><a href="#BigQuery-118"><span class="linenos">118</span></a> <span class="s2">&quot;%S&quot;</span><span class="p">:</span> <span class="s2">&quot;%-S&quot;</span><span class="p">,</span>
-</span><span id="BigQuery-119"><a href="#BigQuery-119"><span class="linenos">119</span></a> <span class="s2">&quot;%j&quot;</span><span class="p">:</span> <span class="s2">&quot;%-j&quot;</span><span class="p">,</span>
-</span><span id="BigQuery-120"><a href="#BigQuery-120"><span class="linenos">120</span></a> <span class="p">}</span>
-</span><span id="BigQuery-121"><a href="#BigQuery-121"><span class="linenos">121</span></a>
-</span><span id="BigQuery-122"><a href="#BigQuery-122"><span class="linenos">122</span></a> <span class="k">class</span> <span class="nc">Tokenizer</span><span class="p">(</span><span class="n">tokens</span><span class="o">.</span><span class="n">Tokenizer</span><span class="p">):</span>
-</span><span id="BigQuery-123"><a href="#BigQuery-123"><span class="linenos">123</span></a> <span class="n">QUOTES</span> <span class="o">=</span> <span class="p">[</span>
-</span><span id="BigQuery-124"><a href="#BigQuery-124"><span class="linenos">124</span></a> <span class="p">(</span><span class="n">prefix</span> <span class="o">+</span> <span class="n">quote</span><span class="p">,</span> <span class="n">quote</span><span class="p">)</span> <span class="k">if</span> <span class="n">prefix</span> <span class="k">else</span> <span class="n">quote</span>
-</span><span id="BigQuery-125"><a href="#BigQuery-125"><span class="linenos">125</span></a> <span class="k">for</span> <span class="n">quote</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">&quot;&#39;&quot;</span><span class="p">,</span> <span class="s1">&#39;&quot;&#39;</span><span class="p">,</span> <span class="s1">&#39;&quot;&quot;&quot;&#39;</span><span class="p">,</span> <span class="s2">&quot;&#39;&#39;&#39;&quot;</span><span class="p">]</span>
-</span><span id="BigQuery-126"><a href="#BigQuery-126"><span class="linenos">126</span></a> <span class="k">for</span> <span class="n">prefix</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="s2">&quot;r&quot;</span><span class="p">,</span> <span class="s2">&quot;R&quot;</span><span class="p">]</span>
-</span><span id="BigQuery-127"><a href="#BigQuery-127"><span class="linenos">127</span></a> <span class="p">]</span>
-</span><span id="BigQuery-128"><a href="#BigQuery-128"><span class="linenos">128</span></a> <span class="n">COMMENTS</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;--&quot;</span><span class="p">,</span> <span class="s2">&quot;#&quot;</span><span class="p">,</span> <span class="p">(</span><span class="s2">&quot;/*&quot;</span><span class="p">,</span> <span class="s2">&quot;*/&quot;</span><span class="p">)]</span>
-</span><span id="BigQuery-129"><a href="#BigQuery-129"><span class="linenos">129</span></a> <span class="n">IDENTIFIERS</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;`&quot;</span><span class="p">]</span>
-</span><span id="BigQuery-130"><a href="#BigQuery-130"><span class="linenos">130</span></a> <span class="n">STRING_ESCAPES</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;</span><span class="se">\\</span><span class="s2">&quot;</span><span class="p">]</span>
-</span><span id="BigQuery-131"><a href="#BigQuery-131"><span class="linenos">131</span></a> <span class="n">HEX_STRINGS</span> <span class="o">=</span> <span class="p">[(</span><span class="s2">&quot;0x&quot;</span><span class="p">,</span> <span class="s2">&quot;&quot;</span><span class="p">),</span> <span class="p">(</span><span class="s2">&quot;0X&quot;</span><span class="p">,</span> <span class="s2">&quot;&quot;</span><span class="p">)]</span>
-</span><span id="BigQuery-132"><a href="#BigQuery-132"><span class="linenos">132</span></a>
-</span><span id="BigQuery-133"><a href="#BigQuery-133"><span class="linenos">133</span></a> <span class="n">KEYWORDS</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="BigQuery-134"><a href="#BigQuery-134"><span class="linenos">134</span></a> <span class="o">**</span><span class="n">tokens</span><span class="o">.</span><span class="n">Tokenizer</span><span class="o">.</span><span class="n">KEYWORDS</span><span class="p">,</span>
-</span><span id="BigQuery-135"><a href="#BigQuery-135"><span class="linenos">135</span></a> <span class="s2">&quot;ANY TYPE&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">VARIANT</span><span class="p">,</span>
-</span><span id="BigQuery-136"><a href="#BigQuery-136"><span class="linenos">136</span></a> <span class="s2">&quot;BEGIN&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">COMMAND</span><span class="p">,</span>
-</span><span id="BigQuery-137"><a href="#BigQuery-137"><span class="linenos">137</span></a> <span class="s2">&quot;BEGIN TRANSACTION&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">BEGIN</span><span class="p">,</span>
-</span><span id="BigQuery-138"><a href="#BigQuery-138"><span class="linenos">138</span></a> <span class="s2">&quot;CURRENT_DATETIME&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">CURRENT_DATETIME</span><span class="p">,</span>
-</span><span id="BigQuery-139"><a href="#BigQuery-139"><span class="linenos">139</span></a> <span class="s2">&quot;DECLARE&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">COMMAND</span><span class="p">,</span>
-</span><span id="BigQuery-140"><a href="#BigQuery-140"><span class="linenos">140</span></a> <span class="s2">&quot;GEOGRAPHY&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">GEOGRAPHY</span><span class="p">,</span>
-</span><span id="BigQuery-141"><a href="#BigQuery-141"><span class="linenos">141</span></a> <span class="s2">&quot;FLOAT64&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">DOUBLE</span><span class="p">,</span>
-</span><span id="BigQuery-142"><a href="#BigQuery-142"><span class="linenos">142</span></a> <span class="s2">&quot;INT64&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">BIGINT</span><span class="p">,</span>
-</span><span id="BigQuery-143"><a href="#BigQuery-143"><span class="linenos">143</span></a> <span class="s2">&quot;NOT DETERMINISTIC&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">VOLATILE</span><span class="p">,</span>
-</span><span id="BigQuery-144"><a href="#BigQuery-144"><span class="linenos">144</span></a> <span class="s2">&quot;UNKNOWN&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">NULL</span><span class="p">,</span>
-</span><span id="BigQuery-145"><a href="#BigQuery-145"><span class="linenos">145</span></a> <span class="p">}</span>
-</span><span id="BigQuery-146"><a href="#BigQuery-146"><span class="linenos">146</span></a> <span class="n">KEYWORDS</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s2">&quot;DIV&quot;</span><span class="p">)</span>
-</span><span id="BigQuery-147"><a href="#BigQuery-147"><span class="linenos">147</span></a>
-</span><span id="BigQuery-148"><a href="#BigQuery-148"><span class="linenos">148</span></a> <span class="k">class</span> <span class="nc">Parser</span><span class="p">(</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="p">):</span>
-</span><span id="BigQuery-149"><a href="#BigQuery-149"><span class="linenos">149</span></a> <span class="n">PREFIXED_PIVOT_COLUMNS</span> <span class="o">=</span> <span class="kc">True</span>
-</span><span id="BigQuery-150"><a href="#BigQuery-150"><span class="linenos">150</span></a>
-</span><span id="BigQuery-151"><a href="#BigQuery-151"><span class="linenos">151</span></a> <span class="n">LOG_BASE_FIRST</span> <span class="o">=</span> <span class="kc">False</span>
-</span><span id="BigQuery-152"><a href="#BigQuery-152"><span class="linenos">152</span></a> <span class="n">LOG_DEFAULTS_TO_LN</span> <span class="o">=</span> <span class="kc">True</span>
-</span><span id="BigQuery-153"><a href="#BigQuery-153"><span class="linenos">153</span></a>
-</span><span id="BigQuery-154"><a href="#BigQuery-154"><span class="linenos">154</span></a> <span class="n">FUNCTIONS</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="BigQuery-155"><a href="#BigQuery-155"><span class="linenos">155</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">FUNCTIONS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
-</span><span id="BigQuery-156"><a href="#BigQuery-156"><span class="linenos">156</span></a> <span class="s2">&quot;DATE_TRUNC&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="n">args</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">DateTrunc</span><span class="p">(</span>
-</span><span id="BigQuery-157"><a href="#BigQuery-157"><span class="linenos">157</span></a> <span class="n">unit</span><span class="o">=</span><span class="n">exp</span><span class="o">.</span><span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">name</span><span class="p">),</span> <span class="c1"># type: ignore</span>
-</span><span id="BigQuery-158"><a href="#BigQuery-158"><span class="linenos">158</span></a> <span class="n">this</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span>
-</span><span id="BigQuery-159"><a href="#BigQuery-159"><span class="linenos">159</span></a> <span class="p">),</span>
-</span><span id="BigQuery-160"><a href="#BigQuery-160"><span class="linenos">160</span></a> <span class="s2">&quot;DATE_ADD&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">DateAdd</span><span class="p">),</span>
-</span><span id="BigQuery-161"><a href="#BigQuery-161"><span class="linenos">161</span></a> <span class="s2">&quot;DATETIME_ADD&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">DatetimeAdd</span><span class="p">),</span>
-</span><span id="BigQuery-162"><a href="#BigQuery-162"><span class="linenos">162</span></a> <span class="s2">&quot;DIV&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="n">args</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">IntDiv</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="n">expression</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">1</span><span class="p">)),</span>
-</span><span id="BigQuery-163"><a href="#BigQuery-163"><span class="linenos">163</span></a> <span class="s2">&quot;REGEXP_CONTAINS&quot;</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">RegexpLike</span><span class="o">.</span><span class="n">from_arg_list</span><span class="p">,</span>
-</span><span id="BigQuery-164"><a href="#BigQuery-164"><span class="linenos">164</span></a> <span class="s2">&quot;REGEXP_EXTRACT&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="n">args</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">RegexpExtract</span><span class="p">(</span>
-</span><span id="BigQuery-165"><a href="#BigQuery-165"><span class="linenos">165</span></a> <span class="n">this</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span>
-</span><span id="BigQuery-166"><a href="#BigQuery-166"><span class="linenos">166</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span>
-</span><span id="BigQuery-167"><a href="#BigQuery-167"><span class="linenos">167</span></a> <span class="n">position</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span>
-</span><span id="BigQuery-168"><a href="#BigQuery-168"><span class="linenos">168</span></a> <span class="n">occurrence</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span>
-</span><span id="BigQuery-169"><a href="#BigQuery-169"><span class="linenos">169</span></a> <span class="n">group</span><span class="o">=</span><span class="n">exp</span><span class="o">.</span><span class="n">Literal</span><span class="o">.</span><span class="n">number</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
-</span><span id="BigQuery-170"><a href="#BigQuery-170"><span class="linenos">170</span></a> <span class="k">if</span> <span class="n">re</span><span class="o">.</span><span class="n">compile</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">1</span><span class="p">)))</span><span class="o">.</span><span class="n">groups</span> <span class="o">==</span> <span class="mi">1</span>
-</span><span id="BigQuery-171"><a href="#BigQuery-171"><span class="linenos">171</span></a> <span class="k">else</span> <span class="kc">None</span><span class="p">,</span>
-</span><span id="BigQuery-172"><a href="#BigQuery-172"><span class="linenos">172</span></a> <span class="p">),</span>
-</span><span id="BigQuery-173"><a href="#BigQuery-173"><span class="linenos">173</span></a> <span class="s2">&quot;TIME_ADD&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">TimeAdd</span><span class="p">),</span>
-</span><span id="BigQuery-174"><a href="#BigQuery-174"><span class="linenos">174</span></a> <span class="s2">&quot;TIMESTAMP_ADD&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">TimestampAdd</span><span class="p">),</span>
-</span><span id="BigQuery-175"><a href="#BigQuery-175"><span class="linenos">175</span></a> <span class="s2">&quot;DATE_SUB&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">DateSub</span><span class="p">),</span>
-</span><span id="BigQuery-176"><a href="#BigQuery-176"><span class="linenos">176</span></a> <span class="s2">&quot;DATETIME_SUB&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">DatetimeSub</span><span class="p">),</span>
-</span><span id="BigQuery-177"><a href="#BigQuery-177"><span class="linenos">177</span></a> <span class="s2">&quot;TIME_SUB&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">TimeSub</span><span class="p">),</span>
-</span><span id="BigQuery-178"><a href="#BigQuery-178"><span class="linenos">178</span></a> <span class="s2">&quot;TIMESTAMP_SUB&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">TimestampSub</span><span class="p">),</span>
-</span><span id="BigQuery-179"><a href="#BigQuery-179"><span class="linenos">179</span></a> <span class="s2">&quot;PARSE_TIMESTAMP&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="n">args</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">StrToTime</span><span class="p">(</span>
-</span><span id="BigQuery-180"><a href="#BigQuery-180"><span class="linenos">180</span></a> <span class="n">this</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="nb">format</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
-</span><span id="BigQuery-181"><a href="#BigQuery-181"><span class="linenos">181</span></a> <span class="p">),</span>
-</span><span id="BigQuery-182"><a href="#BigQuery-182"><span class="linenos">182</span></a> <span class="p">}</span>
-</span><span id="BigQuery-183"><a href="#BigQuery-183"><span class="linenos">183</span></a>
-</span><span id="BigQuery-184"><a href="#BigQuery-184"><span class="linenos">184</span></a> <span class="n">FUNCTION_PARSERS</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="BigQuery-185"><a href="#BigQuery-185"><span class="linenos">185</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">FUNCTION_PARSERS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
-</span><span id="BigQuery-186"><a href="#BigQuery-186"><span class="linenos">186</span></a> <span class="s2">&quot;ARRAY&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">Array</span><span class="p">,</span> <span class="n">expressions</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">_parse_statement</span><span class="p">()]),</span>
-</span><span id="BigQuery-187"><a href="#BigQuery-187"><span class="linenos">187</span></a> <span class="p">}</span>
-</span><span id="BigQuery-188"><a href="#BigQuery-188"><span class="linenos">188</span></a> <span class="n">FUNCTION_PARSERS</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s2">&quot;TRIM&quot;</span><span class="p">)</span>
-</span><span id="BigQuery-189"><a href="#BigQuery-189"><span class="linenos">189</span></a>
-</span><span id="BigQuery-190"><a href="#BigQuery-190"><span class="linenos">190</span></a> <span class="n">NO_PAREN_FUNCTIONS</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="BigQuery-191"><a href="#BigQuery-191"><span class="linenos">191</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">NO_PAREN_FUNCTIONS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
-</span><span id="BigQuery-192"><a href="#BigQuery-192"><span class="linenos">192</span></a> <span class="n">TokenType</span><span class="o">.</span><span class="n">CURRENT_DATETIME</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">CurrentDatetime</span><span class="p">,</span>
-</span><span id="BigQuery-193"><a href="#BigQuery-193"><span class="linenos">193</span></a> <span class="p">}</span>
-</span><span id="BigQuery-194"><a href="#BigQuery-194"><span class="linenos">194</span></a>
-</span><span id="BigQuery-195"><a href="#BigQuery-195"><span class="linenos">195</span></a> <span class="n">NESTED_TYPE_TOKENS</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="BigQuery-196"><a href="#BigQuery-196"><span class="linenos">196</span></a> <span class="o">*</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">NESTED_TYPE_TOKENS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
-</span><span id="BigQuery-197"><a href="#BigQuery-197"><span class="linenos">197</span></a> <span class="n">TokenType</span><span class="o">.</span><span class="n">TABLE</span><span class="p">,</span>
-</span><span id="BigQuery-198"><a href="#BigQuery-198"><span class="linenos">198</span></a> <span class="p">}</span>
-</span><span id="BigQuery-199"><a href="#BigQuery-199"><span class="linenos">199</span></a>
-</span><span id="BigQuery-200"><a href="#BigQuery-200"><span class="linenos">200</span></a> <span class="n">ID_VAR_TOKENS</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="BigQuery-201"><a href="#BigQuery-201"><span class="linenos">201</span></a> <span class="o">*</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">ID_VAR_TOKENS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
-</span><span id="BigQuery-202"><a href="#BigQuery-202"><span class="linenos">202</span></a> <span class="n">TokenType</span><span class="o">.</span><span class="n">VALUES</span><span class="p">,</span>
-</span><span id="BigQuery-203"><a href="#BigQuery-203"><span class="linenos">203</span></a> <span class="p">}</span>
-</span><span id="BigQuery-204"><a href="#BigQuery-204"><span class="linenos">204</span></a>
-</span><span id="BigQuery-205"><a href="#BigQuery-205"><span class="linenos">205</span></a> <span class="n">PROPERTY_PARSERS</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="BigQuery-206"><a href="#BigQuery-206"><span class="linenos">206</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">PROPERTY_PARSERS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
-</span><span id="BigQuery-207"><a href="#BigQuery-207"><span class="linenos">207</span></a> <span class="s2">&quot;NOT DETERMINISTIC&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span>
-</span><span id="BigQuery-208"><a href="#BigQuery-208"><span class="linenos">208</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">StabilityProperty</span><span class="p">,</span> <span class="n">this</span><span class="o">=</span><span class="n">exp</span><span class="o">.</span><span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="s2">&quot;VOLATILE&quot;</span><span class="p">)</span>
-</span><span id="BigQuery-209"><a href="#BigQuery-209"><span class="linenos">209</span></a> <span class="p">),</span>
-</span><span id="BigQuery-210"><a href="#BigQuery-210"><span class="linenos">210</span></a> <span class="p">}</span>
-</span><span id="BigQuery-211"><a href="#BigQuery-211"><span class="linenos">211</span></a>
-</span><span id="BigQuery-212"><a href="#BigQuery-212"><span class="linenos">212</span></a> <span class="k">class</span> <span class="nc">Generator</span><span class="p">(</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="p">):</span>
-</span><span id="BigQuery-213"><a href="#BigQuery-213"><span class="linenos">213</span></a> <span class="n">EXPLICIT_UNION</span> <span class="o">=</span> <span class="kc">True</span>
-</span><span id="BigQuery-214"><a href="#BigQuery-214"><span class="linenos">214</span></a> <span class="n">INTERVAL_ALLOWS_PLURAL_FORM</span> <span class="o">=</span> <span class="kc">False</span>
-</span><span id="BigQuery-215"><a href="#BigQuery-215"><span class="linenos">215</span></a> <span class="n">JOIN_HINTS</span> <span class="o">=</span> <span class="kc">False</span>
-</span><span id="BigQuery-216"><a href="#BigQuery-216"><span class="linenos">216</span></a> <span class="n">TABLE_HINTS</span> <span class="o">=</span> <span class="kc">False</span>
-</span><span id="BigQuery-217"><a href="#BigQuery-217"><span class="linenos">217</span></a> <span class="n">LIMIT_FETCH</span> <span class="o">=</span> <span class="s2">&quot;LIMIT&quot;</span>
-</span><span id="BigQuery-218"><a href="#BigQuery-218"><span class="linenos">218</span></a>
-</span><span id="BigQuery-219"><a href="#BigQuery-219"><span class="linenos">219</span></a> <span class="n">TRANSFORMS</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="BigQuery-220"><a href="#BigQuery-220"><span class="linenos">220</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">TRANSFORMS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
-</span><span id="BigQuery-221"><a href="#BigQuery-221"><span class="linenos">221</span></a> <span class="o">**</span><span class="n">transforms</span><span class="o">.</span><span class="n">REMOVE_PRECISION_PARAMETERIZED_TYPES</span><span class="p">,</span> <span class="c1"># type: ignore</span>
-</span><span id="BigQuery-222"><a href="#BigQuery-222"><span class="linenos">222</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">ArraySize</span><span class="p">:</span> <span class="n">rename_func</span><span class="p">(</span><span class="s2">&quot;ARRAY_LENGTH&quot;</span><span class="p">),</span>
-</span><span id="BigQuery-223"><a href="#BigQuery-223"><span class="linenos">223</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">AtTimeZone</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">func</span><span class="p">(</span>
-</span><span id="BigQuery-224"><a href="#BigQuery-224"><span class="linenos">224</span></a> <span class="s2">&quot;TIMESTAMP&quot;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">func</span><span class="p">(</span><span class="s2">&quot;DATETIME&quot;</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;zone&quot;</span><span class="p">))</span>
-</span><span id="BigQuery-225"><a href="#BigQuery-225"><span class="linenos">225</span></a> <span class="p">),</span>
-</span><span id="BigQuery-226"><a href="#BigQuery-226"><span class="linenos">226</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DateAdd</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;DATE&quot;</span><span class="p">,</span> <span class="s2">&quot;ADD&quot;</span><span class="p">),</span>
-</span><span id="BigQuery-227"><a href="#BigQuery-227"><span class="linenos">227</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DateSub</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;DATE&quot;</span><span class="p">,</span> <span class="s2">&quot;SUB&quot;</span><span class="p">),</span>
-</span><span id="BigQuery-228"><a href="#BigQuery-228"><span class="linenos">228</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DatetimeAdd</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;DATETIME&quot;</span><span class="p">,</span> <span class="s2">&quot;ADD&quot;</span><span class="p">),</span>
-</span><span id="BigQuery-229"><a href="#BigQuery-229"><span class="linenos">229</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DatetimeSub</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;DATETIME&quot;</span><span class="p">,</span> <span class="s2">&quot;SUB&quot;</span><span class="p">),</span>
-</span><span id="BigQuery-230"><a href="#BigQuery-230"><span class="linenos">230</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DateDiff</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">&quot;DATE_DIFF(</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">&#39;this&#39;</span><span class="p">)</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">&#39;expression&#39;</span><span class="p">)</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;unit&#39;</span><span class="p">,</span><span class="w"> </span><span class="s1">&#39;DAY&#39;</span><span class="p">))</span><span class="si">}</span><span class="s2">)&quot;</span><span class="p">,</span>
-</span><span id="BigQuery-231"><a href="#BigQuery-231"><span class="linenos">231</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DateStrToDate</span><span class="p">:</span> <span class="n">datestrtodate_sql</span><span class="p">,</span>
-</span><span id="BigQuery-232"><a href="#BigQuery-232"><span class="linenos">232</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DateTrunc</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">func</span><span class="p">(</span><span class="s2">&quot;DATE_TRUNC&quot;</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">&quot;unit&quot;</span><span class="p">)),</span>
-</span><span id="BigQuery-233"><a href="#BigQuery-233"><span class="linenos">233</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">GroupConcat</span><span class="p">:</span> <span class="n">rename_func</span><span class="p">(</span><span class="s2">&quot;STRING_AGG&quot;</span><span class="p">),</span>
-</span><span id="BigQuery-234"><a href="#BigQuery-234"><span class="linenos">234</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">ILike</span><span class="p">:</span> <span class="n">no_ilike_sql</span><span class="p">,</span>
-</span><span id="BigQuery-235"><a href="#BigQuery-235"><span class="linenos">235</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">IntDiv</span><span class="p">:</span> <span class="n">rename_func</span><span class="p">(</span><span class="s2">&quot;DIV&quot;</span><span class="p">),</span>
-</span><span id="BigQuery-236"><a href="#BigQuery-236"><span class="linenos">236</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Max</span><span class="p">:</span> <span class="n">max_or_greatest</span><span class="p">,</span>
-</span><span id="BigQuery-237"><a href="#BigQuery-237"><span class="linenos">237</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Min</span><span class="p">:</span> <span class="n">min_or_least</span><span class="p">,</span>
-</span><span id="BigQuery-238"><a href="#BigQuery-238"><span class="linenos">238</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Select</span><span class="p">:</span> <span class="n">transforms</span><span class="o">.</span><span class="n">preprocess</span><span class="p">([</span><span class="n">_unqualify_unnest</span><span class="p">]),</span>
-</span><span id="BigQuery-239"><a href="#BigQuery-239"><span class="linenos">239</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">StrToTime</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">&quot;PARSE_TIMESTAMP(</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">format_time</span><span class="p">(</span><span class="n">e</span><span class="p">)</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">&#39;this&#39;</span><span class="p">)</span><span class="si">}</span><span class="s2">)&quot;</span><span class="p">,</span>
-</span><span id="BigQuery-240"><a href="#BigQuery-240"><span class="linenos">240</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TimeAdd</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;TIME&quot;</span><span class="p">,</span> <span class="s2">&quot;ADD&quot;</span><span class="p">),</span>
-</span><span id="BigQuery-241"><a href="#BigQuery-241"><span class="linenos">241</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TimeSub</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;TIME&quot;</span><span class="p">,</span> <span class="s2">&quot;SUB&quot;</span><span class="p">),</span>
-</span><span id="BigQuery-242"><a href="#BigQuery-242"><span class="linenos">242</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TimestampAdd</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;TIMESTAMP&quot;</span><span class="p">,</span> <span class="s2">&quot;ADD&quot;</span><span class="p">),</span>
-</span><span id="BigQuery-243"><a href="#BigQuery-243"><span class="linenos">243</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TimestampSub</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;TIMESTAMP&quot;</span><span class="p">,</span> <span class="s2">&quot;SUB&quot;</span><span class="p">),</span>
-</span><span id="BigQuery-244"><a href="#BigQuery-244"><span class="linenos">244</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TimeStrToTime</span><span class="p">:</span> <span class="n">timestrtotime_sql</span><span class="p">,</span>
-</span><span id="BigQuery-245"><a href="#BigQuery-245"><span class="linenos">245</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TsOrDsToDate</span><span class="p">:</span> <span class="n">ts_or_ds_to_date_sql</span><span class="p">(</span><span class="s2">&quot;bigquery&quot;</span><span class="p">),</span>
-</span><span id="BigQuery-246"><a href="#BigQuery-246"><span class="linenos">246</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TsOrDsAdd</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;DATE&quot;</span><span class="p">,</span> <span class="s2">&quot;ADD&quot;</span><span class="p">),</span>
-</span><span id="BigQuery-247"><a href="#BigQuery-247"><span class="linenos">247</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">PartitionedByProperty</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">&quot;PARTITION BY </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">&#39;this&#39;</span><span class="p">)</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">,</span>
-</span><span id="BigQuery-248"><a href="#BigQuery-248"><span class="linenos">248</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">VariancePop</span><span class="p">:</span> <span class="n">rename_func</span><span class="p">(</span><span class="s2">&quot;VAR_POP&quot;</span><span class="p">),</span>
-</span><span id="BigQuery-249"><a href="#BigQuery-249"><span class="linenos">249</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Values</span><span class="p">:</span> <span class="n">_derived_table_values_to_unnest</span><span class="p">,</span>
-</span><span id="BigQuery-250"><a href="#BigQuery-250"><span class="linenos">250</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">ReturnsProperty</span><span class="p">:</span> <span class="n">_returnsproperty_sql</span><span class="p">,</span>
-</span><span id="BigQuery-251"><a href="#BigQuery-251"><span class="linenos">251</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Create</span><span class="p">:</span> <span class="n">_create_sql</span><span class="p">,</span>
-</span><span id="BigQuery-252"><a href="#BigQuery-252"><span class="linenos">252</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Trim</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">func</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;TRIM&quot;</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">expression</span><span class="p">),</span>
-</span><span id="BigQuery-253"><a href="#BigQuery-253"><span class="linenos">253</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">StabilityProperty</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">&quot;DETERMINISTIC&quot;</span>
-</span><span id="BigQuery-254"><a href="#BigQuery-254"><span class="linenos">254</span></a> <span class="k">if</span> <span class="n">e</span><span class="o">.</span><span class="n">name</span> <span class="o">==</span> <span class="s2">&quot;IMMUTABLE&quot;</span>
-</span><span id="BigQuery-255"><a href="#BigQuery-255"><span class="linenos">255</span></a> <span class="k">else</span> <span class="s2">&quot;NOT DETERMINISTIC&quot;</span><span class="p">,</span>
-</span><span id="BigQuery-256"><a href="#BigQuery-256"><span class="linenos">256</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">RegexpLike</span><span class="p">:</span> <span class="n">rename_func</span><span class="p">(</span><span class="s2">&quot;REGEXP_CONTAINS&quot;</span><span class="p">),</span>
-</span><span id="BigQuery-257"><a href="#BigQuery-257"><span class="linenos">257</span></a> <span class="p">}</span>
-</span><span id="BigQuery-258"><a href="#BigQuery-258"><span class="linenos">258</span></a>
-</span><span id="BigQuery-259"><a href="#BigQuery-259"><span class="linenos">259</span></a> <span class="n">TYPE_MAPPING</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="BigQuery-260"><a href="#BigQuery-260"><span class="linenos">260</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">TYPE_MAPPING</span><span class="p">,</span> <span class="c1"># type: ignore</span>
-</span><span id="BigQuery-261"><a href="#BigQuery-261"><span class="linenos">261</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">BIGDECIMAL</span><span class="p">:</span> <span class="s2">&quot;BIGNUMERIC&quot;</span><span class="p">,</span>
-</span><span id="BigQuery-262"><a href="#BigQuery-262"><span class="linenos">262</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">BIGINT</span><span class="p">:</span> <span class="s2">&quot;INT64&quot;</span><span class="p">,</span>
-</span><span id="BigQuery-263"><a href="#BigQuery-263"><span class="linenos">263</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">BOOLEAN</span><span class="p">:</span> <span class="s2">&quot;BOOL&quot;</span><span class="p">,</span>
-</span><span id="BigQuery-264"><a href="#BigQuery-264"><span class="linenos">264</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">CHAR</span><span class="p">:</span> <span class="s2">&quot;STRING&quot;</span><span class="p">,</span>
-</span><span id="BigQuery-265"><a href="#BigQuery-265"><span class="linenos">265</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">DECIMAL</span><span class="p">:</span> <span class="s2">&quot;NUMERIC&quot;</span><span class="p">,</span>
-</span><span id="BigQuery-266"><a href="#BigQuery-266"><span class="linenos">266</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">DOUBLE</span><span class="p">:</span> <span class="s2">&quot;FLOAT64&quot;</span><span class="p">,</span>
-</span><span id="BigQuery-267"><a href="#BigQuery-267"><span class="linenos">267</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">FLOAT</span><span class="p">:</span> <span class="s2">&quot;FLOAT64&quot;</span><span class="p">,</span>
-</span><span id="BigQuery-268"><a href="#BigQuery-268"><span class="linenos">268</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">INT</span><span class="p">:</span> <span class="s2">&quot;INT64&quot;</span><span class="p">,</span>
-</span><span id="BigQuery-269"><a href="#BigQuery-269"><span class="linenos">269</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">NCHAR</span><span class="p">:</span> <span class="s2">&quot;STRING&quot;</span><span class="p">,</span>
-</span><span id="BigQuery-270"><a href="#BigQuery-270"><span class="linenos">270</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">NVARCHAR</span><span class="p">:</span> <span class="s2">&quot;STRING&quot;</span><span class="p">,</span>
-</span><span id="BigQuery-271"><a href="#BigQuery-271"><span class="linenos">271</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">SMALLINT</span><span class="p">:</span> <span class="s2">&quot;INT64&quot;</span><span class="p">,</span>
-</span><span id="BigQuery-272"><a href="#BigQuery-272"><span class="linenos">272</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">TEXT</span><span class="p">:</span> <span class="s2">&quot;STRING&quot;</span><span class="p">,</span>
-</span><span id="BigQuery-273"><a href="#BigQuery-273"><span class="linenos">273</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMP</span><span class="p">:</span> <span class="s2">&quot;DATETIME&quot;</span><span class="p">,</span>
-</span><span id="BigQuery-274"><a href="#BigQuery-274"><span class="linenos">274</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMPTZ</span><span class="p">:</span> <span class="s2">&quot;TIMESTAMP&quot;</span><span class="p">,</span>
-</span><span id="BigQuery-275"><a href="#BigQuery-275"><span class="linenos">275</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">TINYINT</span><span class="p">:</span> <span class="s2">&quot;INT64&quot;</span><span class="p">,</span>
-</span><span id="BigQuery-276"><a href="#BigQuery-276"><span class="linenos">276</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">VARCHAR</span><span class="p">:</span> <span class="s2">&quot;STRING&quot;</span><span class="p">,</span>
-</span><span id="BigQuery-277"><a href="#BigQuery-277"><span class="linenos">277</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">VARIANT</span><span class="p">:</span> <span class="s2">&quot;ANY TYPE&quot;</span><span class="p">,</span>
-</span><span id="BigQuery-278"><a href="#BigQuery-278"><span class="linenos">278</span></a> <span class="p">}</span>
-</span><span id="BigQuery-279"><a href="#BigQuery-279"><span class="linenos">279</span></a>
-</span><span id="BigQuery-280"><a href="#BigQuery-280"><span class="linenos">280</span></a> <span class="n">PROPERTIES_LOCATION</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="BigQuery-281"><a href="#BigQuery-281"><span class="linenos">281</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">PROPERTIES_LOCATION</span><span class="p">,</span> <span class="c1"># type: ignore</span>
-</span><span id="BigQuery-282"><a href="#BigQuery-282"><span class="linenos">282</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">PartitionedByProperty</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_SCHEMA</span><span class="p">,</span>
-</span><span id="BigQuery-283"><a href="#BigQuery-283"><span class="linenos">283</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">VolatileProperty</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">UNSUPPORTED</span><span class="p">,</span>
-</span><span id="BigQuery-284"><a href="#BigQuery-284"><span class="linenos">284</span></a> <span class="p">}</span>
-</span><span id="BigQuery-285"><a href="#BigQuery-285"><span class="linenos">285</span></a>
-</span><span id="BigQuery-286"><a href="#BigQuery-286"><span class="linenos">286</span></a> <span class="k">def</span> <span class="nf">array_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Array</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
-</span><span id="BigQuery-287"><a href="#BigQuery-287"><span class="linenos">287</span></a> <span class="n">first_arg</span> <span class="o">=</span> <span class="n">seq_get</span><span class="p">(</span><span class="n">expression</span><span class="o">.</span><span class="n">expressions</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
-</span><span id="BigQuery-288"><a href="#BigQuery-288"><span class="linenos">288</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">first_arg</span><span class="p">,</span> <span class="n">exp</span><span class="o">.</span><span class="n">Subqueryable</span><span class="p">):</span>
-</span><span id="BigQuery-289"><a href="#BigQuery-289"><span class="linenos">289</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">&quot;ARRAY</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">wrap</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">first_arg</span><span class="p">))</span><span class="si">}</span><span class="s2">&quot;</span>
-</span><span id="BigQuery-290"><a href="#BigQuery-290"><span class="linenos">290</span></a>
-</span><span id="BigQuery-291"><a href="#BigQuery-291"><span class="linenos">291</span></a> <span class="k">return</span> <span class="n">inline_array_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">)</span>
-</span><span id="BigQuery-292"><a href="#BigQuery-292"><span class="linenos">292</span></a>
-</span><span id="BigQuery-293"><a href="#BigQuery-293"><span class="linenos">293</span></a> <span class="k">def</span> <span class="nf">transaction_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">_</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
-</span><span id="BigQuery-294"><a href="#BigQuery-294"><span class="linenos">294</span></a> <span class="k">return</span> <span class="s2">&quot;BEGIN TRANSACTION&quot;</span>
-</span><span id="BigQuery-295"><a href="#BigQuery-295"><span class="linenos">295</span></a>
-</span><span id="BigQuery-296"><a href="#BigQuery-296"><span class="linenos">296</span></a> <span class="k">def</span> <span class="nf">commit_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">_</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
-</span><span id="BigQuery-297"><a href="#BigQuery-297"><span class="linenos">297</span></a> <span class="k">return</span> <span class="s2">&quot;COMMIT TRANSACTION&quot;</span>
-</span><span id="BigQuery-298"><a href="#BigQuery-298"><span class="linenos">298</span></a>
-</span><span id="BigQuery-299"><a href="#BigQuery-299"><span class="linenos">299</span></a> <span class="k">def</span> <span class="nf">rollback_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">_</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
-</span><span id="BigQuery-300"><a href="#BigQuery-300"><span class="linenos">300</span></a> <span class="k">return</span> <span class="s2">&quot;ROLLBACK TRANSACTION&quot;</span>
-</span><span id="BigQuery-301"><a href="#BigQuery-301"><span class="linenos">301</span></a>
-</span><span id="BigQuery-302"><a href="#BigQuery-302"><span class="linenos">302</span></a> <span class="k">def</span> <span class="nf">in_unnest_op</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Unnest</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
-</span><span id="BigQuery-303"><a href="#BigQuery-303"><span class="linenos">303</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span>
+ <div class="pdoc-code codehilite"><pre><span></span><span id="BigQuery-112"><a href="#BigQuery-112"><span class="linenos">112</span></a><span class="k">class</span> <span class="nc">BigQuery</span><span class="p">(</span><span class="n">Dialect</span><span class="p">):</span>
+</span><span id="BigQuery-113"><a href="#BigQuery-113"><span class="linenos">113</span></a> <span class="n">unnest_column_only</span> <span class="o">=</span> <span class="kc">True</span>
+</span><span id="BigQuery-114"><a href="#BigQuery-114"><span class="linenos">114</span></a> <span class="n">time_mapping</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="BigQuery-115"><a href="#BigQuery-115"><span class="linenos">115</span></a> <span class="s2">&quot;%M&quot;</span><span class="p">:</span> <span class="s2">&quot;%-M&quot;</span><span class="p">,</span>
+</span><span id="BigQuery-116"><a href="#BigQuery-116"><span class="linenos">116</span></a> <span class="s2">&quot;</span><span class="si">%d</span><span class="s2">&quot;</span><span class="p">:</span> <span class="s2">&quot;</span><span class="si">%-d</span><span class="s2">&quot;</span><span class="p">,</span>
+</span><span id="BigQuery-117"><a href="#BigQuery-117"><span class="linenos">117</span></a> <span class="s2">&quot;%m&quot;</span><span class="p">:</span> <span class="s2">&quot;%-m&quot;</span><span class="p">,</span>
+</span><span id="BigQuery-118"><a href="#BigQuery-118"><span class="linenos">118</span></a> <span class="s2">&quot;%y&quot;</span><span class="p">:</span> <span class="s2">&quot;%-y&quot;</span><span class="p">,</span>
+</span><span id="BigQuery-119"><a href="#BigQuery-119"><span class="linenos">119</span></a> <span class="s2">&quot;%H&quot;</span><span class="p">:</span> <span class="s2">&quot;%-H&quot;</span><span class="p">,</span>
+</span><span id="BigQuery-120"><a href="#BigQuery-120"><span class="linenos">120</span></a> <span class="s2">&quot;%I&quot;</span><span class="p">:</span> <span class="s2">&quot;%-I&quot;</span><span class="p">,</span>
+</span><span id="BigQuery-121"><a href="#BigQuery-121"><span class="linenos">121</span></a> <span class="s2">&quot;%S&quot;</span><span class="p">:</span> <span class="s2">&quot;%-S&quot;</span><span class="p">,</span>
+</span><span id="BigQuery-122"><a href="#BigQuery-122"><span class="linenos">122</span></a> <span class="s2">&quot;%j&quot;</span><span class="p">:</span> <span class="s2">&quot;%-j&quot;</span><span class="p">,</span>
+</span><span id="BigQuery-123"><a href="#BigQuery-123"><span class="linenos">123</span></a> <span class="p">}</span>
+</span><span id="BigQuery-124"><a href="#BigQuery-124"><span class="linenos">124</span></a>
+</span><span id="BigQuery-125"><a href="#BigQuery-125"><span class="linenos">125</span></a> <span class="k">class</span> <span class="nc">Tokenizer</span><span class="p">(</span><span class="n">tokens</span><span class="o">.</span><span class="n">Tokenizer</span><span class="p">):</span>
+</span><span id="BigQuery-126"><a href="#BigQuery-126"><span class="linenos">126</span></a> <span class="n">QUOTES</span> <span class="o">=</span> <span class="p">[</span>
+</span><span id="BigQuery-127"><a href="#BigQuery-127"><span class="linenos">127</span></a> <span class="p">(</span><span class="n">prefix</span> <span class="o">+</span> <span class="n">quote</span><span class="p">,</span> <span class="n">quote</span><span class="p">)</span> <span class="k">if</span> <span class="n">prefix</span> <span class="k">else</span> <span class="n">quote</span>
+</span><span id="BigQuery-128"><a href="#BigQuery-128"><span class="linenos">128</span></a> <span class="k">for</span> <span class="n">quote</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">&quot;&#39;&quot;</span><span class="p">,</span> <span class="s1">&#39;&quot;&#39;</span><span class="p">,</span> <span class="s1">&#39;&quot;&quot;&quot;&#39;</span><span class="p">,</span> <span class="s2">&quot;&#39;&#39;&#39;&quot;</span><span class="p">]</span>
+</span><span id="BigQuery-129"><a href="#BigQuery-129"><span class="linenos">129</span></a> <span class="k">for</span> <span class="n">prefix</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="s2">&quot;r&quot;</span><span class="p">,</span> <span class="s2">&quot;R&quot;</span><span class="p">]</span>
+</span><span id="BigQuery-130"><a href="#BigQuery-130"><span class="linenos">130</span></a> <span class="p">]</span>
+</span><span id="BigQuery-131"><a href="#BigQuery-131"><span class="linenos">131</span></a> <span class="n">COMMENTS</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;--&quot;</span><span class="p">,</span> <span class="s2">&quot;#&quot;</span><span class="p">,</span> <span class="p">(</span><span class="s2">&quot;/*&quot;</span><span class="p">,</span> <span class="s2">&quot;*/&quot;</span><span class="p">)]</span>
+</span><span id="BigQuery-132"><a href="#BigQuery-132"><span class="linenos">132</span></a> <span class="n">IDENTIFIERS</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;`&quot;</span><span class="p">]</span>
+</span><span id="BigQuery-133"><a href="#BigQuery-133"><span class="linenos">133</span></a> <span class="n">STRING_ESCAPES</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;</span><span class="se">\\</span><span class="s2">&quot;</span><span class="p">]</span>
+</span><span id="BigQuery-134"><a href="#BigQuery-134"><span class="linenos">134</span></a> <span class="n">HEX_STRINGS</span> <span class="o">=</span> <span class="p">[(</span><span class="s2">&quot;0x&quot;</span><span class="p">,</span> <span class="s2">&quot;&quot;</span><span class="p">),</span> <span class="p">(</span><span class="s2">&quot;0X&quot;</span><span class="p">,</span> <span class="s2">&quot;&quot;</span><span class="p">)]</span>
+</span><span id="BigQuery-135"><a href="#BigQuery-135"><span class="linenos">135</span></a>
+</span><span id="BigQuery-136"><a href="#BigQuery-136"><span class="linenos">136</span></a> <span class="n">KEYWORDS</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="BigQuery-137"><a href="#BigQuery-137"><span class="linenos">137</span></a> <span class="o">**</span><span class="n">tokens</span><span class="o">.</span><span class="n">Tokenizer</span><span class="o">.</span><span class="n">KEYWORDS</span><span class="p">,</span>
+</span><span id="BigQuery-138"><a href="#BigQuery-138"><span class="linenos">138</span></a> <span class="s2">&quot;ANY TYPE&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">VARIANT</span><span class="p">,</span>
+</span><span id="BigQuery-139"><a href="#BigQuery-139"><span class="linenos">139</span></a> <span class="s2">&quot;BEGIN&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">COMMAND</span><span class="p">,</span>
+</span><span id="BigQuery-140"><a href="#BigQuery-140"><span class="linenos">140</span></a> <span class="s2">&quot;BEGIN TRANSACTION&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">BEGIN</span><span class="p">,</span>
+</span><span id="BigQuery-141"><a href="#BigQuery-141"><span class="linenos">141</span></a> <span class="s2">&quot;CURRENT_DATETIME&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">CURRENT_DATETIME</span><span class="p">,</span>
+</span><span id="BigQuery-142"><a href="#BigQuery-142"><span class="linenos">142</span></a> <span class="s2">&quot;DECLARE&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">COMMAND</span><span class="p">,</span>
+</span><span id="BigQuery-143"><a href="#BigQuery-143"><span class="linenos">143</span></a> <span class="s2">&quot;GEOGRAPHY&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">GEOGRAPHY</span><span class="p">,</span>
+</span><span id="BigQuery-144"><a href="#BigQuery-144"><span class="linenos">144</span></a> <span class="s2">&quot;FLOAT64&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">DOUBLE</span><span class="p">,</span>
+</span><span id="BigQuery-145"><a href="#BigQuery-145"><span class="linenos">145</span></a> <span class="s2">&quot;INT64&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">BIGINT</span><span class="p">,</span>
+</span><span id="BigQuery-146"><a href="#BigQuery-146"><span class="linenos">146</span></a> <span class="s2">&quot;BYTES&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">BINARY</span><span class="p">,</span>
+</span><span id="BigQuery-147"><a href="#BigQuery-147"><span class="linenos">147</span></a> <span class="s2">&quot;NOT DETERMINISTIC&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">VOLATILE</span><span class="p">,</span>
+</span><span id="BigQuery-148"><a href="#BigQuery-148"><span class="linenos">148</span></a> <span class="s2">&quot;UNKNOWN&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">NULL</span><span class="p">,</span>
+</span><span id="BigQuery-149"><a href="#BigQuery-149"><span class="linenos">149</span></a> <span class="p">}</span>
+</span><span id="BigQuery-150"><a href="#BigQuery-150"><span class="linenos">150</span></a> <span class="n">KEYWORDS</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s2">&quot;DIV&quot;</span><span class="p">)</span>
+</span><span id="BigQuery-151"><a href="#BigQuery-151"><span class="linenos">151</span></a>
+</span><span id="BigQuery-152"><a href="#BigQuery-152"><span class="linenos">152</span></a> <span class="k">class</span> <span class="nc">Parser</span><span class="p">(</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="p">):</span>
+</span><span id="BigQuery-153"><a href="#BigQuery-153"><span class="linenos">153</span></a> <span class="n">PREFIXED_PIVOT_COLUMNS</span> <span class="o">=</span> <span class="kc">True</span>
+</span><span id="BigQuery-154"><a href="#BigQuery-154"><span class="linenos">154</span></a>
+</span><span id="BigQuery-155"><a href="#BigQuery-155"><span class="linenos">155</span></a> <span class="n">LOG_BASE_FIRST</span> <span class="o">=</span> <span class="kc">False</span>
+</span><span id="BigQuery-156"><a href="#BigQuery-156"><span class="linenos">156</span></a> <span class="n">LOG_DEFAULTS_TO_LN</span> <span class="o">=</span> <span class="kc">True</span>
+</span><span id="BigQuery-157"><a href="#BigQuery-157"><span class="linenos">157</span></a>
+</span><span id="BigQuery-158"><a href="#BigQuery-158"><span class="linenos">158</span></a> <span class="n">FUNCTIONS</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="BigQuery-159"><a href="#BigQuery-159"><span class="linenos">159</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">FUNCTIONS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
+</span><span id="BigQuery-160"><a href="#BigQuery-160"><span class="linenos">160</span></a> <span class="s2">&quot;DATE_TRUNC&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="n">args</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">DateTrunc</span><span class="p">(</span>
+</span><span id="BigQuery-161"><a href="#BigQuery-161"><span class="linenos">161</span></a> <span class="n">unit</span><span class="o">=</span><span class="n">exp</span><span class="o">.</span><span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">name</span><span class="p">),</span> <span class="c1"># type: ignore</span>
+</span><span id="BigQuery-162"><a href="#BigQuery-162"><span class="linenos">162</span></a> <span class="n">this</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span>
+</span><span id="BigQuery-163"><a href="#BigQuery-163"><span class="linenos">163</span></a> <span class="p">),</span>
+</span><span id="BigQuery-164"><a href="#BigQuery-164"><span class="linenos">164</span></a> <span class="s2">&quot;DATE_ADD&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">DateAdd</span><span class="p">),</span>
+</span><span id="BigQuery-165"><a href="#BigQuery-165"><span class="linenos">165</span></a> <span class="s2">&quot;DATETIME_ADD&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">DatetimeAdd</span><span class="p">),</span>
+</span><span id="BigQuery-166"><a href="#BigQuery-166"><span class="linenos">166</span></a> <span class="s2">&quot;DIV&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="n">args</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">IntDiv</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="n">expression</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">1</span><span class="p">)),</span>
+</span><span id="BigQuery-167"><a href="#BigQuery-167"><span class="linenos">167</span></a> <span class="s2">&quot;REGEXP_CONTAINS&quot;</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">RegexpLike</span><span class="o">.</span><span class="n">from_arg_list</span><span class="p">,</span>
+</span><span id="BigQuery-168"><a href="#BigQuery-168"><span class="linenos">168</span></a> <span class="s2">&quot;REGEXP_EXTRACT&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="n">args</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">RegexpExtract</span><span class="p">(</span>
+</span><span id="BigQuery-169"><a href="#BigQuery-169"><span class="linenos">169</span></a> <span class="n">this</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span>
+</span><span id="BigQuery-170"><a href="#BigQuery-170"><span class="linenos">170</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span>
+</span><span id="BigQuery-171"><a href="#BigQuery-171"><span class="linenos">171</span></a> <span class="n">position</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span>
+</span><span id="BigQuery-172"><a href="#BigQuery-172"><span class="linenos">172</span></a> <span class="n">occurrence</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span>
+</span><span id="BigQuery-173"><a href="#BigQuery-173"><span class="linenos">173</span></a> <span class="n">group</span><span class="o">=</span><span class="n">exp</span><span class="o">.</span><span class="n">Literal</span><span class="o">.</span><span class="n">number</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
+</span><span id="BigQuery-174"><a href="#BigQuery-174"><span class="linenos">174</span></a> <span class="k">if</span> <span class="n">re</span><span class="o">.</span><span class="n">compile</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">1</span><span class="p">)))</span><span class="o">.</span><span class="n">groups</span> <span class="o">==</span> <span class="mi">1</span>
+</span><span id="BigQuery-175"><a href="#BigQuery-175"><span class="linenos">175</span></a> <span class="k">else</span> <span class="kc">None</span><span class="p">,</span>
+</span><span id="BigQuery-176"><a href="#BigQuery-176"><span class="linenos">176</span></a> <span class="p">),</span>
+</span><span id="BigQuery-177"><a href="#BigQuery-177"><span class="linenos">177</span></a> <span class="s2">&quot;TIME_ADD&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">TimeAdd</span><span class="p">),</span>
+</span><span id="BigQuery-178"><a href="#BigQuery-178"><span class="linenos">178</span></a> <span class="s2">&quot;TIMESTAMP_ADD&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">TimestampAdd</span><span class="p">),</span>
+</span><span id="BigQuery-179"><a href="#BigQuery-179"><span class="linenos">179</span></a> <span class="s2">&quot;DATE_SUB&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">DateSub</span><span class="p">),</span>
+</span><span id="BigQuery-180"><a href="#BigQuery-180"><span class="linenos">180</span></a> <span class="s2">&quot;DATETIME_SUB&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">DatetimeSub</span><span class="p">),</span>
+</span><span id="BigQuery-181"><a href="#BigQuery-181"><span class="linenos">181</span></a> <span class="s2">&quot;TIME_SUB&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">TimeSub</span><span class="p">),</span>
+</span><span id="BigQuery-182"><a href="#BigQuery-182"><span class="linenos">182</span></a> <span class="s2">&quot;TIMESTAMP_SUB&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">TimestampSub</span><span class="p">),</span>
+</span><span id="BigQuery-183"><a href="#BigQuery-183"><span class="linenos">183</span></a> <span class="s2">&quot;PARSE_TIMESTAMP&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="n">args</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">StrToTime</span><span class="p">(</span>
+</span><span id="BigQuery-184"><a href="#BigQuery-184"><span class="linenos">184</span></a> <span class="n">this</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="nb">format</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
+</span><span id="BigQuery-185"><a href="#BigQuery-185"><span class="linenos">185</span></a> <span class="p">),</span>
+</span><span id="BigQuery-186"><a href="#BigQuery-186"><span class="linenos">186</span></a> <span class="p">}</span>
+</span><span id="BigQuery-187"><a href="#BigQuery-187"><span class="linenos">187</span></a>
+</span><span id="BigQuery-188"><a href="#BigQuery-188"><span class="linenos">188</span></a> <span class="n">FUNCTION_PARSERS</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="BigQuery-189"><a href="#BigQuery-189"><span class="linenos">189</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">FUNCTION_PARSERS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
+</span><span id="BigQuery-190"><a href="#BigQuery-190"><span class="linenos">190</span></a> <span class="s2">&quot;ARRAY&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">Array</span><span class="p">,</span> <span class="n">expressions</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">_parse_statement</span><span class="p">()]),</span>
+</span><span id="BigQuery-191"><a href="#BigQuery-191"><span class="linenos">191</span></a> <span class="p">}</span>
+</span><span id="BigQuery-192"><a href="#BigQuery-192"><span class="linenos">192</span></a> <span class="n">FUNCTION_PARSERS</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s2">&quot;TRIM&quot;</span><span class="p">)</span>
+</span><span id="BigQuery-193"><a href="#BigQuery-193"><span class="linenos">193</span></a>
+</span><span id="BigQuery-194"><a href="#BigQuery-194"><span class="linenos">194</span></a> <span class="n">NO_PAREN_FUNCTIONS</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="BigQuery-195"><a href="#BigQuery-195"><span class="linenos">195</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">NO_PAREN_FUNCTIONS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
+</span><span id="BigQuery-196"><a href="#BigQuery-196"><span class="linenos">196</span></a> <span class="n">TokenType</span><span class="o">.</span><span class="n">CURRENT_DATETIME</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">CurrentDatetime</span><span class="p">,</span>
+</span><span id="BigQuery-197"><a href="#BigQuery-197"><span class="linenos">197</span></a> <span class="p">}</span>
+</span><span id="BigQuery-198"><a href="#BigQuery-198"><span class="linenos">198</span></a>
+</span><span id="BigQuery-199"><a href="#BigQuery-199"><span class="linenos">199</span></a> <span class="n">NESTED_TYPE_TOKENS</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="BigQuery-200"><a href="#BigQuery-200"><span class="linenos">200</span></a> <span class="o">*</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">NESTED_TYPE_TOKENS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
+</span><span id="BigQuery-201"><a href="#BigQuery-201"><span class="linenos">201</span></a> <span class="n">TokenType</span><span class="o">.</span><span class="n">TABLE</span><span class="p">,</span>
+</span><span id="BigQuery-202"><a href="#BigQuery-202"><span class="linenos">202</span></a> <span class="p">}</span>
+</span><span id="BigQuery-203"><a href="#BigQuery-203"><span class="linenos">203</span></a>
+</span><span id="BigQuery-204"><a href="#BigQuery-204"><span class="linenos">204</span></a> <span class="n">ID_VAR_TOKENS</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="BigQuery-205"><a href="#BigQuery-205"><span class="linenos">205</span></a> <span class="o">*</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">ID_VAR_TOKENS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
+</span><span id="BigQuery-206"><a href="#BigQuery-206"><span class="linenos">206</span></a> <span class="n">TokenType</span><span class="o">.</span><span class="n">VALUES</span><span class="p">,</span>
+</span><span id="BigQuery-207"><a href="#BigQuery-207"><span class="linenos">207</span></a> <span class="p">}</span>
+</span><span id="BigQuery-208"><a href="#BigQuery-208"><span class="linenos">208</span></a>
+</span><span id="BigQuery-209"><a href="#BigQuery-209"><span class="linenos">209</span></a> <span class="n">PROPERTY_PARSERS</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="BigQuery-210"><a href="#BigQuery-210"><span class="linenos">210</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">PROPERTY_PARSERS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
+</span><span id="BigQuery-211"><a href="#BigQuery-211"><span class="linenos">211</span></a> <span class="s2">&quot;NOT DETERMINISTIC&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span>
+</span><span id="BigQuery-212"><a href="#BigQuery-212"><span class="linenos">212</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">StabilityProperty</span><span class="p">,</span> <span class="n">this</span><span class="o">=</span><span class="n">exp</span><span class="o">.</span><span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="s2">&quot;VOLATILE&quot;</span><span class="p">)</span>
+</span><span id="BigQuery-213"><a href="#BigQuery-213"><span class="linenos">213</span></a> <span class="p">),</span>
+</span><span id="BigQuery-214"><a href="#BigQuery-214"><span class="linenos">214</span></a> <span class="s2">&quot;OPTIONS&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_with_property</span><span class="p">(),</span>
+</span><span id="BigQuery-215"><a href="#BigQuery-215"><span class="linenos">215</span></a> <span class="p">}</span>
+</span><span id="BigQuery-216"><a href="#BigQuery-216"><span class="linenos">216</span></a>
+</span><span id="BigQuery-217"><a href="#BigQuery-217"><span class="linenos">217</span></a> <span class="n">CONSTRAINT_PARSERS</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="BigQuery-218"><a href="#BigQuery-218"><span class="linenos">218</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">CONSTRAINT_PARSERS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
+</span><span id="BigQuery-219"><a href="#BigQuery-219"><span class="linenos">219</span></a> <span class="s2">&quot;OPTIONS&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">_parse_with_property</span><span class="p">()),</span>
+</span><span id="BigQuery-220"><a href="#BigQuery-220"><span class="linenos">220</span></a> <span class="p">}</span>
+</span><span id="BigQuery-221"><a href="#BigQuery-221"><span class="linenos">221</span></a>
+</span><span id="BigQuery-222"><a href="#BigQuery-222"><span class="linenos">222</span></a> <span class="k">class</span> <span class="nc">Generator</span><span class="p">(</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="p">):</span>
+</span><span id="BigQuery-223"><a href="#BigQuery-223"><span class="linenos">223</span></a> <span class="n">EXPLICIT_UNION</span> <span class="o">=</span> <span class="kc">True</span>
+</span><span id="BigQuery-224"><a href="#BigQuery-224"><span class="linenos">224</span></a> <span class="n">INTERVAL_ALLOWS_PLURAL_FORM</span> <span class="o">=</span> <span class="kc">False</span>
+</span><span id="BigQuery-225"><a href="#BigQuery-225"><span class="linenos">225</span></a> <span class="n">JOIN_HINTS</span> <span class="o">=</span> <span class="kc">False</span>
+</span><span id="BigQuery-226"><a href="#BigQuery-226"><span class="linenos">226</span></a> <span class="n">TABLE_HINTS</span> <span class="o">=</span> <span class="kc">False</span>
+</span><span id="BigQuery-227"><a href="#BigQuery-227"><span class="linenos">227</span></a> <span class="n">LIMIT_FETCH</span> <span class="o">=</span> <span class="s2">&quot;LIMIT&quot;</span>
+</span><span id="BigQuery-228"><a href="#BigQuery-228"><span class="linenos">228</span></a>
+</span><span id="BigQuery-229"><a href="#BigQuery-229"><span class="linenos">229</span></a> <span class="n">TRANSFORMS</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="BigQuery-230"><a href="#BigQuery-230"><span class="linenos">230</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">TRANSFORMS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
+</span><span id="BigQuery-231"><a href="#BigQuery-231"><span class="linenos">231</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">ArraySize</span><span class="p">:</span> <span class="n">rename_func</span><span class="p">(</span><span class="s2">&quot;ARRAY_LENGTH&quot;</span><span class="p">),</span>
+</span><span id="BigQuery-232"><a href="#BigQuery-232"><span class="linenos">232</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">AtTimeZone</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">func</span><span class="p">(</span>
+</span><span id="BigQuery-233"><a href="#BigQuery-233"><span class="linenos">233</span></a> <span class="s2">&quot;TIMESTAMP&quot;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">func</span><span class="p">(</span><span class="s2">&quot;DATETIME&quot;</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;zone&quot;</span><span class="p">))</span>
+</span><span id="BigQuery-234"><a href="#BigQuery-234"><span class="linenos">234</span></a> <span class="p">),</span>
+</span><span id="BigQuery-235"><a href="#BigQuery-235"><span class="linenos">235</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Cast</span><span class="p">:</span> <span class="n">transforms</span><span class="o">.</span><span class="n">preprocess</span><span class="p">([</span><span class="n">transforms</span><span class="o">.</span><span class="n">remove_precision_parameterized_types</span><span class="p">]),</span>
+</span><span id="BigQuery-236"><a href="#BigQuery-236"><span class="linenos">236</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DateAdd</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;DATE&quot;</span><span class="p">,</span> <span class="s2">&quot;ADD&quot;</span><span class="p">),</span>
+</span><span id="BigQuery-237"><a href="#BigQuery-237"><span class="linenos">237</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DateSub</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;DATE&quot;</span><span class="p">,</span> <span class="s2">&quot;SUB&quot;</span><span class="p">),</span>
+</span><span id="BigQuery-238"><a href="#BigQuery-238"><span class="linenos">238</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DatetimeAdd</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;DATETIME&quot;</span><span class="p">,</span> <span class="s2">&quot;ADD&quot;</span><span class="p">),</span>
+</span><span id="BigQuery-239"><a href="#BigQuery-239"><span class="linenos">239</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DatetimeSub</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;DATETIME&quot;</span><span class="p">,</span> <span class="s2">&quot;SUB&quot;</span><span class="p">),</span>
+</span><span id="BigQuery-240"><a href="#BigQuery-240"><span class="linenos">240</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DateDiff</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">&quot;DATE_DIFF(</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">&#39;this&#39;</span><span class="p">)</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">&#39;expression&#39;</span><span class="p">)</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;unit&#39;</span><span class="p">,</span><span class="w"> </span><span class="s1">&#39;DAY&#39;</span><span class="p">))</span><span class="si">}</span><span class="s2">)&quot;</span><span class="p">,</span>
+</span><span id="BigQuery-241"><a href="#BigQuery-241"><span class="linenos">241</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DateStrToDate</span><span class="p">:</span> <span class="n">datestrtodate_sql</span><span class="p">,</span>
+</span><span id="BigQuery-242"><a href="#BigQuery-242"><span class="linenos">242</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DateTrunc</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">func</span><span class="p">(</span><span class="s2">&quot;DATE_TRUNC&quot;</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">&quot;unit&quot;</span><span class="p">)),</span>
+</span><span id="BigQuery-243"><a href="#BigQuery-243"><span class="linenos">243</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">GroupConcat</span><span class="p">:</span> <span class="n">rename_func</span><span class="p">(</span><span class="s2">&quot;STRING_AGG&quot;</span><span class="p">),</span>
+</span><span id="BigQuery-244"><a href="#BigQuery-244"><span class="linenos">244</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">ILike</span><span class="p">:</span> <span class="n">no_ilike_sql</span><span class="p">,</span>
+</span><span id="BigQuery-245"><a href="#BigQuery-245"><span class="linenos">245</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">IntDiv</span><span class="p">:</span> <span class="n">rename_func</span><span class="p">(</span><span class="s2">&quot;DIV&quot;</span><span class="p">),</span>
+</span><span id="BigQuery-246"><a href="#BigQuery-246"><span class="linenos">246</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Max</span><span class="p">:</span> <span class="n">max_or_greatest</span><span class="p">,</span>
+</span><span id="BigQuery-247"><a href="#BigQuery-247"><span class="linenos">247</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Min</span><span class="p">:</span> <span class="n">min_or_least</span><span class="p">,</span>
+</span><span id="BigQuery-248"><a href="#BigQuery-248"><span class="linenos">248</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Select</span><span class="p">:</span> <span class="n">transforms</span><span class="o">.</span><span class="n">preprocess</span><span class="p">(</span>
+</span><span id="BigQuery-249"><a href="#BigQuery-249"><span class="linenos">249</span></a> <span class="p">[</span><span class="n">_unqualify_unnest</span><span class="p">,</span> <span class="n">transforms</span><span class="o">.</span><span class="n">eliminate_distinct_on</span><span class="p">]</span>
+</span><span id="BigQuery-250"><a href="#BigQuery-250"><span class="linenos">250</span></a> <span class="p">),</span>
+</span><span id="BigQuery-251"><a href="#BigQuery-251"><span class="linenos">251</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">StrToTime</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">&quot;PARSE_TIMESTAMP(</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">format_time</span><span class="p">(</span><span class="n">e</span><span class="p">)</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">&#39;this&#39;</span><span class="p">)</span><span class="si">}</span><span class="s2">)&quot;</span><span class="p">,</span>
+</span><span id="BigQuery-252"><a href="#BigQuery-252"><span class="linenos">252</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TimeAdd</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;TIME&quot;</span><span class="p">,</span> <span class="s2">&quot;ADD&quot;</span><span class="p">),</span>
+</span><span id="BigQuery-253"><a href="#BigQuery-253"><span class="linenos">253</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TimeSub</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;TIME&quot;</span><span class="p">,</span> <span class="s2">&quot;SUB&quot;</span><span class="p">),</span>
+</span><span id="BigQuery-254"><a href="#BigQuery-254"><span class="linenos">254</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TimestampAdd</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;TIMESTAMP&quot;</span><span class="p">,</span> <span class="s2">&quot;ADD&quot;</span><span class="p">),</span>
+</span><span id="BigQuery-255"><a href="#BigQuery-255"><span class="linenos">255</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TimestampSub</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;TIMESTAMP&quot;</span><span class="p">,</span> <span class="s2">&quot;SUB&quot;</span><span class="p">),</span>
+</span><span id="BigQuery-256"><a href="#BigQuery-256"><span class="linenos">256</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TimeStrToTime</span><span class="p">:</span> <span class="n">timestrtotime_sql</span><span class="p">,</span>
+</span><span id="BigQuery-257"><a href="#BigQuery-257"><span class="linenos">257</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TsOrDsToDate</span><span class="p">:</span> <span class="n">ts_or_ds_to_date_sql</span><span class="p">(</span><span class="s2">&quot;bigquery&quot;</span><span class="p">),</span>
+</span><span id="BigQuery-258"><a href="#BigQuery-258"><span class="linenos">258</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TsOrDsAdd</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;DATE&quot;</span><span class="p">,</span> <span class="s2">&quot;ADD&quot;</span><span class="p">),</span>
+</span><span id="BigQuery-259"><a href="#BigQuery-259"><span class="linenos">259</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">PartitionedByProperty</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">&quot;PARTITION BY </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">&#39;this&#39;</span><span class="p">)</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">,</span>
+</span><span id="BigQuery-260"><a href="#BigQuery-260"><span class="linenos">260</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">VariancePop</span><span class="p">:</span> <span class="n">rename_func</span><span class="p">(</span><span class="s2">&quot;VAR_POP&quot;</span><span class="p">),</span>
+</span><span id="BigQuery-261"><a href="#BigQuery-261"><span class="linenos">261</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Values</span><span class="p">:</span> <span class="n">_derived_table_values_to_unnest</span><span class="p">,</span>
+</span><span id="BigQuery-262"><a href="#BigQuery-262"><span class="linenos">262</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">ReturnsProperty</span><span class="p">:</span> <span class="n">_returnsproperty_sql</span><span class="p">,</span>
+</span><span id="BigQuery-263"><a href="#BigQuery-263"><span class="linenos">263</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Create</span><span class="p">:</span> <span class="n">_create_sql</span><span class="p">,</span>
+</span><span id="BigQuery-264"><a href="#BigQuery-264"><span class="linenos">264</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Trim</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">func</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;TRIM&quot;</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">expression</span><span class="p">),</span>
+</span><span id="BigQuery-265"><a href="#BigQuery-265"><span class="linenos">265</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">StabilityProperty</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">&quot;DETERMINISTIC&quot;</span>
+</span><span id="BigQuery-266"><a href="#BigQuery-266"><span class="linenos">266</span></a> <span class="k">if</span> <span class="n">e</span><span class="o">.</span><span class="n">name</span> <span class="o">==</span> <span class="s2">&quot;IMMUTABLE&quot;</span>
+</span><span id="BigQuery-267"><a href="#BigQuery-267"><span class="linenos">267</span></a> <span class="k">else</span> <span class="s2">&quot;NOT DETERMINISTIC&quot;</span><span class="p">,</span>
+</span><span id="BigQuery-268"><a href="#BigQuery-268"><span class="linenos">268</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">RegexpLike</span><span class="p">:</span> <span class="n">rename_func</span><span class="p">(</span><span class="s2">&quot;REGEXP_CONTAINS&quot;</span><span class="p">),</span>
+</span><span id="BigQuery-269"><a href="#BigQuery-269"><span class="linenos">269</span></a> <span class="p">}</span>
+</span><span id="BigQuery-270"><a href="#BigQuery-270"><span class="linenos">270</span></a>
+</span><span id="BigQuery-271"><a href="#BigQuery-271"><span class="linenos">271</span></a> <span class="n">TYPE_MAPPING</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="BigQuery-272"><a href="#BigQuery-272"><span class="linenos">272</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">TYPE_MAPPING</span><span class="p">,</span> <span class="c1"># type: ignore</span>
+</span><span id="BigQuery-273"><a href="#BigQuery-273"><span class="linenos">273</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">BIGDECIMAL</span><span class="p">:</span> <span class="s2">&quot;BIGNUMERIC&quot;</span><span class="p">,</span>
+</span><span id="BigQuery-274"><a href="#BigQuery-274"><span class="linenos">274</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">BIGINT</span><span class="p">:</span> <span class="s2">&quot;INT64&quot;</span><span class="p">,</span>
+</span><span id="BigQuery-275"><a href="#BigQuery-275"><span class="linenos">275</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">BINARY</span><span class="p">:</span> <span class="s2">&quot;BYTES&quot;</span><span class="p">,</span>
+</span><span id="BigQuery-276"><a href="#BigQuery-276"><span class="linenos">276</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">BOOLEAN</span><span class="p">:</span> <span class="s2">&quot;BOOL&quot;</span><span class="p">,</span>
+</span><span id="BigQuery-277"><a href="#BigQuery-277"><span class="linenos">277</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">CHAR</span><span class="p">:</span> <span class="s2">&quot;STRING&quot;</span><span class="p">,</span>
+</span><span id="BigQuery-278"><a href="#BigQuery-278"><span class="linenos">278</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">DECIMAL</span><span class="p">:</span> <span class="s2">&quot;NUMERIC&quot;</span><span class="p">,</span>
+</span><span id="BigQuery-279"><a href="#BigQuery-279"><span class="linenos">279</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">DOUBLE</span><span class="p">:</span> <span class="s2">&quot;FLOAT64&quot;</span><span class="p">,</span>
+</span><span id="BigQuery-280"><a href="#BigQuery-280"><span class="linenos">280</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">FLOAT</span><span class="p">:</span> <span class="s2">&quot;FLOAT64&quot;</span><span class="p">,</span>
+</span><span id="BigQuery-281"><a href="#BigQuery-281"><span class="linenos">281</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">INT</span><span class="p">:</span> <span class="s2">&quot;INT64&quot;</span><span class="p">,</span>
+</span><span id="BigQuery-282"><a href="#BigQuery-282"><span class="linenos">282</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">NCHAR</span><span class="p">:</span> <span class="s2">&quot;STRING&quot;</span><span class="p">,</span>
+</span><span id="BigQuery-283"><a href="#BigQuery-283"><span class="linenos">283</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">NVARCHAR</span><span class="p">:</span> <span class="s2">&quot;STRING&quot;</span><span class="p">,</span>
+</span><span id="BigQuery-284"><a href="#BigQuery-284"><span class="linenos">284</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">SMALLINT</span><span class="p">:</span> <span class="s2">&quot;INT64&quot;</span><span class="p">,</span>
+</span><span id="BigQuery-285"><a href="#BigQuery-285"><span class="linenos">285</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">TEXT</span><span class="p">:</span> <span class="s2">&quot;STRING&quot;</span><span class="p">,</span>
+</span><span id="BigQuery-286"><a href="#BigQuery-286"><span class="linenos">286</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMP</span><span class="p">:</span> <span class="s2">&quot;DATETIME&quot;</span><span class="p">,</span>
+</span><span id="BigQuery-287"><a href="#BigQuery-287"><span class="linenos">287</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMPTZ</span><span class="p">:</span> <span class="s2">&quot;TIMESTAMP&quot;</span><span class="p">,</span>
+</span><span id="BigQuery-288"><a href="#BigQuery-288"><span class="linenos">288</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">TINYINT</span><span class="p">:</span> <span class="s2">&quot;INT64&quot;</span><span class="p">,</span>
+</span><span id="BigQuery-289"><a href="#BigQuery-289"><span class="linenos">289</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">VARBINARY</span><span class="p">:</span> <span class="s2">&quot;BYTES&quot;</span><span class="p">,</span>
+</span><span id="BigQuery-290"><a href="#BigQuery-290"><span class="linenos">290</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">VARCHAR</span><span class="p">:</span> <span class="s2">&quot;STRING&quot;</span><span class="p">,</span>
+</span><span id="BigQuery-291"><a href="#BigQuery-291"><span class="linenos">291</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">VARIANT</span><span class="p">:</span> <span class="s2">&quot;ANY TYPE&quot;</span><span class="p">,</span>
+</span><span id="BigQuery-292"><a href="#BigQuery-292"><span class="linenos">292</span></a> <span class="p">}</span>
+</span><span id="BigQuery-293"><a href="#BigQuery-293"><span class="linenos">293</span></a>
+</span><span id="BigQuery-294"><a href="#BigQuery-294"><span class="linenos">294</span></a> <span class="n">PROPERTIES_LOCATION</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="BigQuery-295"><a href="#BigQuery-295"><span class="linenos">295</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">PROPERTIES_LOCATION</span><span class="p">,</span> <span class="c1"># type: ignore</span>
+</span><span id="BigQuery-296"><a href="#BigQuery-296"><span class="linenos">296</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">PartitionedByProperty</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_SCHEMA</span><span class="p">,</span>
+</span><span id="BigQuery-297"><a href="#BigQuery-297"><span class="linenos">297</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">VolatileProperty</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">UNSUPPORTED</span><span class="p">,</span>
+</span><span id="BigQuery-298"><a href="#BigQuery-298"><span class="linenos">298</span></a> <span class="p">}</span>
+</span><span id="BigQuery-299"><a href="#BigQuery-299"><span class="linenos">299</span></a>
+</span><span id="BigQuery-300"><a href="#BigQuery-300"><span class="linenos">300</span></a> <span class="k">def</span> <span class="nf">array_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Array</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="BigQuery-301"><a href="#BigQuery-301"><span class="linenos">301</span></a> <span class="n">first_arg</span> <span class="o">=</span> <span class="n">seq_get</span><span class="p">(</span><span class="n">expression</span><span class="o">.</span><span class="n">expressions</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
+</span><span id="BigQuery-302"><a href="#BigQuery-302"><span class="linenos">302</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">first_arg</span><span class="p">,</span> <span class="n">exp</span><span class="o">.</span><span class="n">Subqueryable</span><span class="p">):</span>
+</span><span id="BigQuery-303"><a href="#BigQuery-303"><span class="linenos">303</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">&quot;ARRAY</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">wrap</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">first_arg</span><span class="p">))</span><span class="si">}</span><span class="s2">&quot;</span>
</span><span id="BigQuery-304"><a href="#BigQuery-304"><span class="linenos">304</span></a>
-</span><span id="BigQuery-305"><a href="#BigQuery-305"><span class="linenos">305</span></a> <span class="k">def</span> <span class="nf">except_op</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Except</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
-</span><span id="BigQuery-306"><a href="#BigQuery-306"><span class="linenos">306</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;distinct&quot;</span><span class="p">,</span> <span class="kc">False</span><span class="p">):</span>
-</span><span id="BigQuery-307"><a href="#BigQuery-307"><span class="linenos">307</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">unsupported</span><span class="p">(</span><span class="s2">&quot;EXCEPT without DISTINCT is not supported in BigQuery&quot;</span><span class="p">)</span>
-</span><span id="BigQuery-308"><a href="#BigQuery-308"><span class="linenos">308</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">&quot;EXCEPT</span><span class="si">{</span><span class="s1">&#39; DISTINCT&#39;</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;distinct&#39;</span><span class="p">)</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="s1">&#39; ALL&#39;</span><span class="si">}</span><span class="s2">&quot;</span>
+</span><span id="BigQuery-305"><a href="#BigQuery-305"><span class="linenos">305</span></a> <span class="k">return</span> <span class="n">inline_array_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">)</span>
+</span><span id="BigQuery-306"><a href="#BigQuery-306"><span class="linenos">306</span></a>
+</span><span id="BigQuery-307"><a href="#BigQuery-307"><span class="linenos">307</span></a> <span class="k">def</span> <span class="nf">transaction_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">_</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="BigQuery-308"><a href="#BigQuery-308"><span class="linenos">308</span></a> <span class="k">return</span> <span class="s2">&quot;BEGIN TRANSACTION&quot;</span>
</span><span id="BigQuery-309"><a href="#BigQuery-309"><span class="linenos">309</span></a>
-</span><span id="BigQuery-310"><a href="#BigQuery-310"><span class="linenos">310</span></a> <span class="k">def</span> <span class="nf">intersect_op</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Intersect</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
-</span><span id="BigQuery-311"><a href="#BigQuery-311"><span class="linenos">311</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;distinct&quot;</span><span class="p">,</span> <span class="kc">False</span><span class="p">):</span>
-</span><span id="BigQuery-312"><a href="#BigQuery-312"><span class="linenos">312</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">unsupported</span><span class="p">(</span><span class="s2">&quot;INTERSECT without DISTINCT is not supported in BigQuery&quot;</span><span class="p">)</span>
-</span><span id="BigQuery-313"><a href="#BigQuery-313"><span class="linenos">313</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">&quot;INTERSECT</span><span class="si">{</span><span class="s1">&#39; DISTINCT&#39;</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;distinct&#39;</span><span class="p">)</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="s1">&#39; ALL&#39;</span><span class="si">}</span><span class="s2">&quot;</span>
+</span><span id="BigQuery-310"><a href="#BigQuery-310"><span class="linenos">310</span></a> <span class="k">def</span> <span class="nf">commit_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">_</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="BigQuery-311"><a href="#BigQuery-311"><span class="linenos">311</span></a> <span class="k">return</span> <span class="s2">&quot;COMMIT TRANSACTION&quot;</span>
+</span><span id="BigQuery-312"><a href="#BigQuery-312"><span class="linenos">312</span></a>
+</span><span id="BigQuery-313"><a href="#BigQuery-313"><span class="linenos">313</span></a> <span class="k">def</span> <span class="nf">rollback_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">_</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="BigQuery-314"><a href="#BigQuery-314"><span class="linenos">314</span></a> <span class="k">return</span> <span class="s2">&quot;ROLLBACK TRANSACTION&quot;</span>
+</span><span id="BigQuery-315"><a href="#BigQuery-315"><span class="linenos">315</span></a>
+</span><span id="BigQuery-316"><a href="#BigQuery-316"><span class="linenos">316</span></a> <span class="k">def</span> <span class="nf">in_unnest_op</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Unnest</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="BigQuery-317"><a href="#BigQuery-317"><span class="linenos">317</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span>
+</span><span id="BigQuery-318"><a href="#BigQuery-318"><span class="linenos">318</span></a>
+</span><span id="BigQuery-319"><a href="#BigQuery-319"><span class="linenos">319</span></a> <span class="k">def</span> <span class="nf">except_op</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Except</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="BigQuery-320"><a href="#BigQuery-320"><span class="linenos">320</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;distinct&quot;</span><span class="p">,</span> <span class="kc">False</span><span class="p">):</span>
+</span><span id="BigQuery-321"><a href="#BigQuery-321"><span class="linenos">321</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">unsupported</span><span class="p">(</span><span class="s2">&quot;EXCEPT without DISTINCT is not supported in BigQuery&quot;</span><span class="p">)</span>
+</span><span id="BigQuery-322"><a href="#BigQuery-322"><span class="linenos">322</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">&quot;EXCEPT</span><span class="si">{</span><span class="s1">&#39; DISTINCT&#39;</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;distinct&#39;</span><span class="p">)</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="s1">&#39; ALL&#39;</span><span class="si">}</span><span class="s2">&quot;</span>
+</span><span id="BigQuery-323"><a href="#BigQuery-323"><span class="linenos">323</span></a>
+</span><span id="BigQuery-324"><a href="#BigQuery-324"><span class="linenos">324</span></a> <span class="k">def</span> <span class="nf">intersect_op</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Intersect</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="BigQuery-325"><a href="#BigQuery-325"><span class="linenos">325</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;distinct&quot;</span><span class="p">,</span> <span class="kc">False</span><span class="p">):</span>
+</span><span id="BigQuery-326"><a href="#BigQuery-326"><span class="linenos">326</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">unsupported</span><span class="p">(</span><span class="s2">&quot;INTERSECT without DISTINCT is not supported in BigQuery&quot;</span><span class="p">)</span>
+</span><span id="BigQuery-327"><a href="#BigQuery-327"><span class="linenos">327</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">&quot;INTERSECT</span><span class="si">{</span><span class="s1">&#39; DISTINCT&#39;</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;distinct&#39;</span><span class="p">)</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="s1">&#39; ALL&#39;</span><span class="si">}</span><span class="s2">&quot;</span>
+</span><span id="BigQuery-328"><a href="#BigQuery-328"><span class="linenos">328</span></a>
+</span><span id="BigQuery-329"><a href="#BigQuery-329"><span class="linenos">329</span></a> <span class="k">def</span> <span class="nf">with_properties</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">properties</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="BigQuery-330"><a href="#BigQuery-330"><span class="linenos">330</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">properties</span><span class="p">(</span><span class="n">properties</span><span class="p">,</span> <span class="n">prefix</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">seg</span><span class="p">(</span><span class="s2">&quot;OPTIONS&quot;</span><span class="p">))</span>
</span></pre></div>
@@ -664,31 +698,32 @@
</div>
<a class="headerlink" href="#BigQuery.Tokenizer"></a>
- <div class="pdoc-code codehilite"><pre><span></span><span id="BigQuery.Tokenizer-122"><a href="#BigQuery.Tokenizer-122"><span class="linenos">122</span></a> <span class="k">class</span> <span class="nc">Tokenizer</span><span class="p">(</span><span class="n">tokens</span><span class="o">.</span><span class="n">Tokenizer</span><span class="p">):</span>
-</span><span id="BigQuery.Tokenizer-123"><a href="#BigQuery.Tokenizer-123"><span class="linenos">123</span></a> <span class="n">QUOTES</span> <span class="o">=</span> <span class="p">[</span>
-</span><span id="BigQuery.Tokenizer-124"><a href="#BigQuery.Tokenizer-124"><span class="linenos">124</span></a> <span class="p">(</span><span class="n">prefix</span> <span class="o">+</span> <span class="n">quote</span><span class="p">,</span> <span class="n">quote</span><span class="p">)</span> <span class="k">if</span> <span class="n">prefix</span> <span class="k">else</span> <span class="n">quote</span>
-</span><span id="BigQuery.Tokenizer-125"><a href="#BigQuery.Tokenizer-125"><span class="linenos">125</span></a> <span class="k">for</span> <span class="n">quote</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">&quot;&#39;&quot;</span><span class="p">,</span> <span class="s1">&#39;&quot;&#39;</span><span class="p">,</span> <span class="s1">&#39;&quot;&quot;&quot;&#39;</span><span class="p">,</span> <span class="s2">&quot;&#39;&#39;&#39;&quot;</span><span class="p">]</span>
-</span><span id="BigQuery.Tokenizer-126"><a href="#BigQuery.Tokenizer-126"><span class="linenos">126</span></a> <span class="k">for</span> <span class="n">prefix</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="s2">&quot;r&quot;</span><span class="p">,</span> <span class="s2">&quot;R&quot;</span><span class="p">]</span>
-</span><span id="BigQuery.Tokenizer-127"><a href="#BigQuery.Tokenizer-127"><span class="linenos">127</span></a> <span class="p">]</span>
-</span><span id="BigQuery.Tokenizer-128"><a href="#BigQuery.Tokenizer-128"><span class="linenos">128</span></a> <span class="n">COMMENTS</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;--&quot;</span><span class="p">,</span> <span class="s2">&quot;#&quot;</span><span class="p">,</span> <span class="p">(</span><span class="s2">&quot;/*&quot;</span><span class="p">,</span> <span class="s2">&quot;*/&quot;</span><span class="p">)]</span>
-</span><span id="BigQuery.Tokenizer-129"><a href="#BigQuery.Tokenizer-129"><span class="linenos">129</span></a> <span class="n">IDENTIFIERS</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;`&quot;</span><span class="p">]</span>
-</span><span id="BigQuery.Tokenizer-130"><a href="#BigQuery.Tokenizer-130"><span class="linenos">130</span></a> <span class="n">STRING_ESCAPES</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;</span><span class="se">\\</span><span class="s2">&quot;</span><span class="p">]</span>
-</span><span id="BigQuery.Tokenizer-131"><a href="#BigQuery.Tokenizer-131"><span class="linenos">131</span></a> <span class="n">HEX_STRINGS</span> <span class="o">=</span> <span class="p">[(</span><span class="s2">&quot;0x&quot;</span><span class="p">,</span> <span class="s2">&quot;&quot;</span><span class="p">),</span> <span class="p">(</span><span class="s2">&quot;0X&quot;</span><span class="p">,</span> <span class="s2">&quot;&quot;</span><span class="p">)]</span>
-</span><span id="BigQuery.Tokenizer-132"><a href="#BigQuery.Tokenizer-132"><span class="linenos">132</span></a>
-</span><span id="BigQuery.Tokenizer-133"><a href="#BigQuery.Tokenizer-133"><span class="linenos">133</span></a> <span class="n">KEYWORDS</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="BigQuery.Tokenizer-134"><a href="#BigQuery.Tokenizer-134"><span class="linenos">134</span></a> <span class="o">**</span><span class="n">tokens</span><span class="o">.</span><span class="n">Tokenizer</span><span class="o">.</span><span class="n">KEYWORDS</span><span class="p">,</span>
-</span><span id="BigQuery.Tokenizer-135"><a href="#BigQuery.Tokenizer-135"><span class="linenos">135</span></a> <span class="s2">&quot;ANY TYPE&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">VARIANT</span><span class="p">,</span>
-</span><span id="BigQuery.Tokenizer-136"><a href="#BigQuery.Tokenizer-136"><span class="linenos">136</span></a> <span class="s2">&quot;BEGIN&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">COMMAND</span><span class="p">,</span>
-</span><span id="BigQuery.Tokenizer-137"><a href="#BigQuery.Tokenizer-137"><span class="linenos">137</span></a> <span class="s2">&quot;BEGIN TRANSACTION&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">BEGIN</span><span class="p">,</span>
-</span><span id="BigQuery.Tokenizer-138"><a href="#BigQuery.Tokenizer-138"><span class="linenos">138</span></a> <span class="s2">&quot;CURRENT_DATETIME&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">CURRENT_DATETIME</span><span class="p">,</span>
-</span><span id="BigQuery.Tokenizer-139"><a href="#BigQuery.Tokenizer-139"><span class="linenos">139</span></a> <span class="s2">&quot;DECLARE&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">COMMAND</span><span class="p">,</span>
-</span><span id="BigQuery.Tokenizer-140"><a href="#BigQuery.Tokenizer-140"><span class="linenos">140</span></a> <span class="s2">&quot;GEOGRAPHY&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">GEOGRAPHY</span><span class="p">,</span>
-</span><span id="BigQuery.Tokenizer-141"><a href="#BigQuery.Tokenizer-141"><span class="linenos">141</span></a> <span class="s2">&quot;FLOAT64&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">DOUBLE</span><span class="p">,</span>
-</span><span id="BigQuery.Tokenizer-142"><a href="#BigQuery.Tokenizer-142"><span class="linenos">142</span></a> <span class="s2">&quot;INT64&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">BIGINT</span><span class="p">,</span>
-</span><span id="BigQuery.Tokenizer-143"><a href="#BigQuery.Tokenizer-143"><span class="linenos">143</span></a> <span class="s2">&quot;NOT DETERMINISTIC&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">VOLATILE</span><span class="p">,</span>
-</span><span id="BigQuery.Tokenizer-144"><a href="#BigQuery.Tokenizer-144"><span class="linenos">144</span></a> <span class="s2">&quot;UNKNOWN&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">NULL</span><span class="p">,</span>
-</span><span id="BigQuery.Tokenizer-145"><a href="#BigQuery.Tokenizer-145"><span class="linenos">145</span></a> <span class="p">}</span>
-</span><span id="BigQuery.Tokenizer-146"><a href="#BigQuery.Tokenizer-146"><span class="linenos">146</span></a> <span class="n">KEYWORDS</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s2">&quot;DIV&quot;</span><span class="p">)</span>
+ <div class="pdoc-code codehilite"><pre><span></span><span id="BigQuery.Tokenizer-125"><a href="#BigQuery.Tokenizer-125"><span class="linenos">125</span></a> <span class="k">class</span> <span class="nc">Tokenizer</span><span class="p">(</span><span class="n">tokens</span><span class="o">.</span><span class="n">Tokenizer</span><span class="p">):</span>
+</span><span id="BigQuery.Tokenizer-126"><a href="#BigQuery.Tokenizer-126"><span class="linenos">126</span></a> <span class="n">QUOTES</span> <span class="o">=</span> <span class="p">[</span>
+</span><span id="BigQuery.Tokenizer-127"><a href="#BigQuery.Tokenizer-127"><span class="linenos">127</span></a> <span class="p">(</span><span class="n">prefix</span> <span class="o">+</span> <span class="n">quote</span><span class="p">,</span> <span class="n">quote</span><span class="p">)</span> <span class="k">if</span> <span class="n">prefix</span> <span class="k">else</span> <span class="n">quote</span>
+</span><span id="BigQuery.Tokenizer-128"><a href="#BigQuery.Tokenizer-128"><span class="linenos">128</span></a> <span class="k">for</span> <span class="n">quote</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">&quot;&#39;&quot;</span><span class="p">,</span> <span class="s1">&#39;&quot;&#39;</span><span class="p">,</span> <span class="s1">&#39;&quot;&quot;&quot;&#39;</span><span class="p">,</span> <span class="s2">&quot;&#39;&#39;&#39;&quot;</span><span class="p">]</span>
+</span><span id="BigQuery.Tokenizer-129"><a href="#BigQuery.Tokenizer-129"><span class="linenos">129</span></a> <span class="k">for</span> <span class="n">prefix</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="s2">&quot;r&quot;</span><span class="p">,</span> <span class="s2">&quot;R&quot;</span><span class="p">]</span>
+</span><span id="BigQuery.Tokenizer-130"><a href="#BigQuery.Tokenizer-130"><span class="linenos">130</span></a> <span class="p">]</span>
+</span><span id="BigQuery.Tokenizer-131"><a href="#BigQuery.Tokenizer-131"><span class="linenos">131</span></a> <span class="n">COMMENTS</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;--&quot;</span><span class="p">,</span> <span class="s2">&quot;#&quot;</span><span class="p">,</span> <span class="p">(</span><span class="s2">&quot;/*&quot;</span><span class="p">,</span> <span class="s2">&quot;*/&quot;</span><span class="p">)]</span>
+</span><span id="BigQuery.Tokenizer-132"><a href="#BigQuery.Tokenizer-132"><span class="linenos">132</span></a> <span class="n">IDENTIFIERS</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;`&quot;</span><span class="p">]</span>
+</span><span id="BigQuery.Tokenizer-133"><a href="#BigQuery.Tokenizer-133"><span class="linenos">133</span></a> <span class="n">STRING_ESCAPES</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;</span><span class="se">\\</span><span class="s2">&quot;</span><span class="p">]</span>
+</span><span id="BigQuery.Tokenizer-134"><a href="#BigQuery.Tokenizer-134"><span class="linenos">134</span></a> <span class="n">HEX_STRINGS</span> <span class="o">=</span> <span class="p">[(</span><span class="s2">&quot;0x&quot;</span><span class="p">,</span> <span class="s2">&quot;&quot;</span><span class="p">),</span> <span class="p">(</span><span class="s2">&quot;0X&quot;</span><span class="p">,</span> <span class="s2">&quot;&quot;</span><span class="p">)]</span>
+</span><span id="BigQuery.Tokenizer-135"><a href="#BigQuery.Tokenizer-135"><span class="linenos">135</span></a>
+</span><span id="BigQuery.Tokenizer-136"><a href="#BigQuery.Tokenizer-136"><span class="linenos">136</span></a> <span class="n">KEYWORDS</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="BigQuery.Tokenizer-137"><a href="#BigQuery.Tokenizer-137"><span class="linenos">137</span></a> <span class="o">**</span><span class="n">tokens</span><span class="o">.</span><span class="n">Tokenizer</span><span class="o">.</span><span class="n">KEYWORDS</span><span class="p">,</span>
+</span><span id="BigQuery.Tokenizer-138"><a href="#BigQuery.Tokenizer-138"><span class="linenos">138</span></a> <span class="s2">&quot;ANY TYPE&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">VARIANT</span><span class="p">,</span>
+</span><span id="BigQuery.Tokenizer-139"><a href="#BigQuery.Tokenizer-139"><span class="linenos">139</span></a> <span class="s2">&quot;BEGIN&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">COMMAND</span><span class="p">,</span>
+</span><span id="BigQuery.Tokenizer-140"><a href="#BigQuery.Tokenizer-140"><span class="linenos">140</span></a> <span class="s2">&quot;BEGIN TRANSACTION&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">BEGIN</span><span class="p">,</span>
+</span><span id="BigQuery.Tokenizer-141"><a href="#BigQuery.Tokenizer-141"><span class="linenos">141</span></a> <span class="s2">&quot;CURRENT_DATETIME&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">CURRENT_DATETIME</span><span class="p">,</span>
+</span><span id="BigQuery.Tokenizer-142"><a href="#BigQuery.Tokenizer-142"><span class="linenos">142</span></a> <span class="s2">&quot;DECLARE&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">COMMAND</span><span class="p">,</span>
+</span><span id="BigQuery.Tokenizer-143"><a href="#BigQuery.Tokenizer-143"><span class="linenos">143</span></a> <span class="s2">&quot;GEOGRAPHY&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">GEOGRAPHY</span><span class="p">,</span>
+</span><span id="BigQuery.Tokenizer-144"><a href="#BigQuery.Tokenizer-144"><span class="linenos">144</span></a> <span class="s2">&quot;FLOAT64&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">DOUBLE</span><span class="p">,</span>
+</span><span id="BigQuery.Tokenizer-145"><a href="#BigQuery.Tokenizer-145"><span class="linenos">145</span></a> <span class="s2">&quot;INT64&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">BIGINT</span><span class="p">,</span>
+</span><span id="BigQuery.Tokenizer-146"><a href="#BigQuery.Tokenizer-146"><span class="linenos">146</span></a> <span class="s2">&quot;BYTES&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">BINARY</span><span class="p">,</span>
+</span><span id="BigQuery.Tokenizer-147"><a href="#BigQuery.Tokenizer-147"><span class="linenos">147</span></a> <span class="s2">&quot;NOT DETERMINISTIC&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">VOLATILE</span><span class="p">,</span>
+</span><span id="BigQuery.Tokenizer-148"><a href="#BigQuery.Tokenizer-148"><span class="linenos">148</span></a> <span class="s2">&quot;UNKNOWN&quot;</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">NULL</span><span class="p">,</span>
+</span><span id="BigQuery.Tokenizer-149"><a href="#BigQuery.Tokenizer-149"><span class="linenos">149</span></a> <span class="p">}</span>
+</span><span id="BigQuery.Tokenizer-150"><a href="#BigQuery.Tokenizer-150"><span class="linenos">150</span></a> <span class="n">KEYWORDS</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s2">&quot;DIV&quot;</span><span class="p">)</span>
</span></pre></div>
@@ -716,69 +751,75 @@
</div>
<a class="headerlink" href="#BigQuery.Parser"></a>
- <div class="pdoc-code codehilite"><pre><span></span><span id="BigQuery.Parser-148"><a href="#BigQuery.Parser-148"><span class="linenos">148</span></a> <span class="k">class</span> <span class="nc">Parser</span><span class="p">(</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="p">):</span>
-</span><span id="BigQuery.Parser-149"><a href="#BigQuery.Parser-149"><span class="linenos">149</span></a> <span class="n">PREFIXED_PIVOT_COLUMNS</span> <span class="o">=</span> <span class="kc">True</span>
-</span><span id="BigQuery.Parser-150"><a href="#BigQuery.Parser-150"><span class="linenos">150</span></a>
-</span><span id="BigQuery.Parser-151"><a href="#BigQuery.Parser-151"><span class="linenos">151</span></a> <span class="n">LOG_BASE_FIRST</span> <span class="o">=</span> <span class="kc">False</span>
-</span><span id="BigQuery.Parser-152"><a href="#BigQuery.Parser-152"><span class="linenos">152</span></a> <span class="n">LOG_DEFAULTS_TO_LN</span> <span class="o">=</span> <span class="kc">True</span>
-</span><span id="BigQuery.Parser-153"><a href="#BigQuery.Parser-153"><span class="linenos">153</span></a>
-</span><span id="BigQuery.Parser-154"><a href="#BigQuery.Parser-154"><span class="linenos">154</span></a> <span class="n">FUNCTIONS</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="BigQuery.Parser-155"><a href="#BigQuery.Parser-155"><span class="linenos">155</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">FUNCTIONS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
-</span><span id="BigQuery.Parser-156"><a href="#BigQuery.Parser-156"><span class="linenos">156</span></a> <span class="s2">&quot;DATE_TRUNC&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="n">args</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">DateTrunc</span><span class="p">(</span>
-</span><span id="BigQuery.Parser-157"><a href="#BigQuery.Parser-157"><span class="linenos">157</span></a> <span class="n">unit</span><span class="o">=</span><span class="n">exp</span><span class="o">.</span><span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">name</span><span class="p">),</span> <span class="c1"># type: ignore</span>
-</span><span id="BigQuery.Parser-158"><a href="#BigQuery.Parser-158"><span class="linenos">158</span></a> <span class="n">this</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span>
-</span><span id="BigQuery.Parser-159"><a href="#BigQuery.Parser-159"><span class="linenos">159</span></a> <span class="p">),</span>
-</span><span id="BigQuery.Parser-160"><a href="#BigQuery.Parser-160"><span class="linenos">160</span></a> <span class="s2">&quot;DATE_ADD&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">DateAdd</span><span class="p">),</span>
-</span><span id="BigQuery.Parser-161"><a href="#BigQuery.Parser-161"><span class="linenos">161</span></a> <span class="s2">&quot;DATETIME_ADD&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">DatetimeAdd</span><span class="p">),</span>
-</span><span id="BigQuery.Parser-162"><a href="#BigQuery.Parser-162"><span class="linenos">162</span></a> <span class="s2">&quot;DIV&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="n">args</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">IntDiv</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="n">expression</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">1</span><span class="p">)),</span>
-</span><span id="BigQuery.Parser-163"><a href="#BigQuery.Parser-163"><span class="linenos">163</span></a> <span class="s2">&quot;REGEXP_CONTAINS&quot;</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">RegexpLike</span><span class="o">.</span><span class="n">from_arg_list</span><span class="p">,</span>
-</span><span id="BigQuery.Parser-164"><a href="#BigQuery.Parser-164"><span class="linenos">164</span></a> <span class="s2">&quot;REGEXP_EXTRACT&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="n">args</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">RegexpExtract</span><span class="p">(</span>
-</span><span id="BigQuery.Parser-165"><a href="#BigQuery.Parser-165"><span class="linenos">165</span></a> <span class="n">this</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span>
-</span><span id="BigQuery.Parser-166"><a href="#BigQuery.Parser-166"><span class="linenos">166</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span>
-</span><span id="BigQuery.Parser-167"><a href="#BigQuery.Parser-167"><span class="linenos">167</span></a> <span class="n">position</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span>
-</span><span id="BigQuery.Parser-168"><a href="#BigQuery.Parser-168"><span class="linenos">168</span></a> <span class="n">occurrence</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span>
-</span><span id="BigQuery.Parser-169"><a href="#BigQuery.Parser-169"><span class="linenos">169</span></a> <span class="n">group</span><span class="o">=</span><span class="n">exp</span><span class="o">.</span><span class="n">Literal</span><span class="o">.</span><span class="n">number</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
-</span><span id="BigQuery.Parser-170"><a href="#BigQuery.Parser-170"><span class="linenos">170</span></a> <span class="k">if</span> <span class="n">re</span><span class="o">.</span><span class="n">compile</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">1</span><span class="p">)))</span><span class="o">.</span><span class="n">groups</span> <span class="o">==</span> <span class="mi">1</span>
-</span><span id="BigQuery.Parser-171"><a href="#BigQuery.Parser-171"><span class="linenos">171</span></a> <span class="k">else</span> <span class="kc">None</span><span class="p">,</span>
-</span><span id="BigQuery.Parser-172"><a href="#BigQuery.Parser-172"><span class="linenos">172</span></a> <span class="p">),</span>
-</span><span id="BigQuery.Parser-173"><a href="#BigQuery.Parser-173"><span class="linenos">173</span></a> <span class="s2">&quot;TIME_ADD&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">TimeAdd</span><span class="p">),</span>
-</span><span id="BigQuery.Parser-174"><a href="#BigQuery.Parser-174"><span class="linenos">174</span></a> <span class="s2">&quot;TIMESTAMP_ADD&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">TimestampAdd</span><span class="p">),</span>
-</span><span id="BigQuery.Parser-175"><a href="#BigQuery.Parser-175"><span class="linenos">175</span></a> <span class="s2">&quot;DATE_SUB&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">DateSub</span><span class="p">),</span>
-</span><span id="BigQuery.Parser-176"><a href="#BigQuery.Parser-176"><span class="linenos">176</span></a> <span class="s2">&quot;DATETIME_SUB&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">DatetimeSub</span><span class="p">),</span>
-</span><span id="BigQuery.Parser-177"><a href="#BigQuery.Parser-177"><span class="linenos">177</span></a> <span class="s2">&quot;TIME_SUB&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">TimeSub</span><span class="p">),</span>
-</span><span id="BigQuery.Parser-178"><a href="#BigQuery.Parser-178"><span class="linenos">178</span></a> <span class="s2">&quot;TIMESTAMP_SUB&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">TimestampSub</span><span class="p">),</span>
-</span><span id="BigQuery.Parser-179"><a href="#BigQuery.Parser-179"><span class="linenos">179</span></a> <span class="s2">&quot;PARSE_TIMESTAMP&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="n">args</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">StrToTime</span><span class="p">(</span>
-</span><span id="BigQuery.Parser-180"><a href="#BigQuery.Parser-180"><span class="linenos">180</span></a> <span class="n">this</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="nb">format</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
-</span><span id="BigQuery.Parser-181"><a href="#BigQuery.Parser-181"><span class="linenos">181</span></a> <span class="p">),</span>
-</span><span id="BigQuery.Parser-182"><a href="#BigQuery.Parser-182"><span class="linenos">182</span></a> <span class="p">}</span>
-</span><span id="BigQuery.Parser-183"><a href="#BigQuery.Parser-183"><span class="linenos">183</span></a>
-</span><span id="BigQuery.Parser-184"><a href="#BigQuery.Parser-184"><span class="linenos">184</span></a> <span class="n">FUNCTION_PARSERS</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="BigQuery.Parser-185"><a href="#BigQuery.Parser-185"><span class="linenos">185</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">FUNCTION_PARSERS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
-</span><span id="BigQuery.Parser-186"><a href="#BigQuery.Parser-186"><span class="linenos">186</span></a> <span class="s2">&quot;ARRAY&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">Array</span><span class="p">,</span> <span class="n">expressions</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">_parse_statement</span><span class="p">()]),</span>
-</span><span id="BigQuery.Parser-187"><a href="#BigQuery.Parser-187"><span class="linenos">187</span></a> <span class="p">}</span>
-</span><span id="BigQuery.Parser-188"><a href="#BigQuery.Parser-188"><span class="linenos">188</span></a> <span class="n">FUNCTION_PARSERS</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s2">&quot;TRIM&quot;</span><span class="p">)</span>
-</span><span id="BigQuery.Parser-189"><a href="#BigQuery.Parser-189"><span class="linenos">189</span></a>
-</span><span id="BigQuery.Parser-190"><a href="#BigQuery.Parser-190"><span class="linenos">190</span></a> <span class="n">NO_PAREN_FUNCTIONS</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="BigQuery.Parser-191"><a href="#BigQuery.Parser-191"><span class="linenos">191</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">NO_PAREN_FUNCTIONS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
-</span><span id="BigQuery.Parser-192"><a href="#BigQuery.Parser-192"><span class="linenos">192</span></a> <span class="n">TokenType</span><span class="o">.</span><span class="n">CURRENT_DATETIME</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">CurrentDatetime</span><span class="p">,</span>
-</span><span id="BigQuery.Parser-193"><a href="#BigQuery.Parser-193"><span class="linenos">193</span></a> <span class="p">}</span>
-</span><span id="BigQuery.Parser-194"><a href="#BigQuery.Parser-194"><span class="linenos">194</span></a>
-</span><span id="BigQuery.Parser-195"><a href="#BigQuery.Parser-195"><span class="linenos">195</span></a> <span class="n">NESTED_TYPE_TOKENS</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="BigQuery.Parser-196"><a href="#BigQuery.Parser-196"><span class="linenos">196</span></a> <span class="o">*</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">NESTED_TYPE_TOKENS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
-</span><span id="BigQuery.Parser-197"><a href="#BigQuery.Parser-197"><span class="linenos">197</span></a> <span class="n">TokenType</span><span class="o">.</span><span class="n">TABLE</span><span class="p">,</span>
-</span><span id="BigQuery.Parser-198"><a href="#BigQuery.Parser-198"><span class="linenos">198</span></a> <span class="p">}</span>
-</span><span id="BigQuery.Parser-199"><a href="#BigQuery.Parser-199"><span class="linenos">199</span></a>
-</span><span id="BigQuery.Parser-200"><a href="#BigQuery.Parser-200"><span class="linenos">200</span></a> <span class="n">ID_VAR_TOKENS</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="BigQuery.Parser-201"><a href="#BigQuery.Parser-201"><span class="linenos">201</span></a> <span class="o">*</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">ID_VAR_TOKENS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
-</span><span id="BigQuery.Parser-202"><a href="#BigQuery.Parser-202"><span class="linenos">202</span></a> <span class="n">TokenType</span><span class="o">.</span><span class="n">VALUES</span><span class="p">,</span>
-</span><span id="BigQuery.Parser-203"><a href="#BigQuery.Parser-203"><span class="linenos">203</span></a> <span class="p">}</span>
-</span><span id="BigQuery.Parser-204"><a href="#BigQuery.Parser-204"><span class="linenos">204</span></a>
-</span><span id="BigQuery.Parser-205"><a href="#BigQuery.Parser-205"><span class="linenos">205</span></a> <span class="n">PROPERTY_PARSERS</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="BigQuery.Parser-206"><a href="#BigQuery.Parser-206"><span class="linenos">206</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">PROPERTY_PARSERS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
-</span><span id="BigQuery.Parser-207"><a href="#BigQuery.Parser-207"><span class="linenos">207</span></a> <span class="s2">&quot;NOT DETERMINISTIC&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span>
-</span><span id="BigQuery.Parser-208"><a href="#BigQuery.Parser-208"><span class="linenos">208</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">StabilityProperty</span><span class="p">,</span> <span class="n">this</span><span class="o">=</span><span class="n">exp</span><span class="o">.</span><span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="s2">&quot;VOLATILE&quot;</span><span class="p">)</span>
-</span><span id="BigQuery.Parser-209"><a href="#BigQuery.Parser-209"><span class="linenos">209</span></a> <span class="p">),</span>
-</span><span id="BigQuery.Parser-210"><a href="#BigQuery.Parser-210"><span class="linenos">210</span></a> <span class="p">}</span>
+ <div class="pdoc-code codehilite"><pre><span></span><span id="BigQuery.Parser-152"><a href="#BigQuery.Parser-152"><span class="linenos">152</span></a> <span class="k">class</span> <span class="nc">Parser</span><span class="p">(</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="p">):</span>
+</span><span id="BigQuery.Parser-153"><a href="#BigQuery.Parser-153"><span class="linenos">153</span></a> <span class="n">PREFIXED_PIVOT_COLUMNS</span> <span class="o">=</span> <span class="kc">True</span>
+</span><span id="BigQuery.Parser-154"><a href="#BigQuery.Parser-154"><span class="linenos">154</span></a>
+</span><span id="BigQuery.Parser-155"><a href="#BigQuery.Parser-155"><span class="linenos">155</span></a> <span class="n">LOG_BASE_FIRST</span> <span class="o">=</span> <span class="kc">False</span>
+</span><span id="BigQuery.Parser-156"><a href="#BigQuery.Parser-156"><span class="linenos">156</span></a> <span class="n">LOG_DEFAULTS_TO_LN</span> <span class="o">=</span> <span class="kc">True</span>
+</span><span id="BigQuery.Parser-157"><a href="#BigQuery.Parser-157"><span class="linenos">157</span></a>
+</span><span id="BigQuery.Parser-158"><a href="#BigQuery.Parser-158"><span class="linenos">158</span></a> <span class="n">FUNCTIONS</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="BigQuery.Parser-159"><a href="#BigQuery.Parser-159"><span class="linenos">159</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">FUNCTIONS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
+</span><span id="BigQuery.Parser-160"><a href="#BigQuery.Parser-160"><span class="linenos">160</span></a> <span class="s2">&quot;DATE_TRUNC&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="n">args</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">DateTrunc</span><span class="p">(</span>
+</span><span id="BigQuery.Parser-161"><a href="#BigQuery.Parser-161"><span class="linenos">161</span></a> <span class="n">unit</span><span class="o">=</span><span class="n">exp</span><span class="o">.</span><span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">name</span><span class="p">),</span> <span class="c1"># type: ignore</span>
+</span><span id="BigQuery.Parser-162"><a href="#BigQuery.Parser-162"><span class="linenos">162</span></a> <span class="n">this</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span>
+</span><span id="BigQuery.Parser-163"><a href="#BigQuery.Parser-163"><span class="linenos">163</span></a> <span class="p">),</span>
+</span><span id="BigQuery.Parser-164"><a href="#BigQuery.Parser-164"><span class="linenos">164</span></a> <span class="s2">&quot;DATE_ADD&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">DateAdd</span><span class="p">),</span>
+</span><span id="BigQuery.Parser-165"><a href="#BigQuery.Parser-165"><span class="linenos">165</span></a> <span class="s2">&quot;DATETIME_ADD&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">DatetimeAdd</span><span class="p">),</span>
+</span><span id="BigQuery.Parser-166"><a href="#BigQuery.Parser-166"><span class="linenos">166</span></a> <span class="s2">&quot;DIV&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="n">args</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">IntDiv</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="n">expression</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">1</span><span class="p">)),</span>
+</span><span id="BigQuery.Parser-167"><a href="#BigQuery.Parser-167"><span class="linenos">167</span></a> <span class="s2">&quot;REGEXP_CONTAINS&quot;</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">RegexpLike</span><span class="o">.</span><span class="n">from_arg_list</span><span class="p">,</span>
+</span><span id="BigQuery.Parser-168"><a href="#BigQuery.Parser-168"><span class="linenos">168</span></a> <span class="s2">&quot;REGEXP_EXTRACT&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="n">args</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">RegexpExtract</span><span class="p">(</span>
+</span><span id="BigQuery.Parser-169"><a href="#BigQuery.Parser-169"><span class="linenos">169</span></a> <span class="n">this</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span>
+</span><span id="BigQuery.Parser-170"><a href="#BigQuery.Parser-170"><span class="linenos">170</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span>
+</span><span id="BigQuery.Parser-171"><a href="#BigQuery.Parser-171"><span class="linenos">171</span></a> <span class="n">position</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span>
+</span><span id="BigQuery.Parser-172"><a href="#BigQuery.Parser-172"><span class="linenos">172</span></a> <span class="n">occurrence</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span>
+</span><span id="BigQuery.Parser-173"><a href="#BigQuery.Parser-173"><span class="linenos">173</span></a> <span class="n">group</span><span class="o">=</span><span class="n">exp</span><span class="o">.</span><span class="n">Literal</span><span class="o">.</span><span class="n">number</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
+</span><span id="BigQuery.Parser-174"><a href="#BigQuery.Parser-174"><span class="linenos">174</span></a> <span class="k">if</span> <span class="n">re</span><span class="o">.</span><span class="n">compile</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">1</span><span class="p">)))</span><span class="o">.</span><span class="n">groups</span> <span class="o">==</span> <span class="mi">1</span>
+</span><span id="BigQuery.Parser-175"><a href="#BigQuery.Parser-175"><span class="linenos">175</span></a> <span class="k">else</span> <span class="kc">None</span><span class="p">,</span>
+</span><span id="BigQuery.Parser-176"><a href="#BigQuery.Parser-176"><span class="linenos">176</span></a> <span class="p">),</span>
+</span><span id="BigQuery.Parser-177"><a href="#BigQuery.Parser-177"><span class="linenos">177</span></a> <span class="s2">&quot;TIME_ADD&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">TimeAdd</span><span class="p">),</span>
+</span><span id="BigQuery.Parser-178"><a href="#BigQuery.Parser-178"><span class="linenos">178</span></a> <span class="s2">&quot;TIMESTAMP_ADD&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">TimestampAdd</span><span class="p">),</span>
+</span><span id="BigQuery.Parser-179"><a href="#BigQuery.Parser-179"><span class="linenos">179</span></a> <span class="s2">&quot;DATE_SUB&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">DateSub</span><span class="p">),</span>
+</span><span id="BigQuery.Parser-180"><a href="#BigQuery.Parser-180"><span class="linenos">180</span></a> <span class="s2">&quot;DATETIME_SUB&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">DatetimeSub</span><span class="p">),</span>
+</span><span id="BigQuery.Parser-181"><a href="#BigQuery.Parser-181"><span class="linenos">181</span></a> <span class="s2">&quot;TIME_SUB&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">TimeSub</span><span class="p">),</span>
+</span><span id="BigQuery.Parser-182"><a href="#BigQuery.Parser-182"><span class="linenos">182</span></a> <span class="s2">&quot;TIMESTAMP_SUB&quot;</span><span class="p">:</span> <span class="n">parse_date_delta_with_interval</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">TimestampSub</span><span class="p">),</span>
+</span><span id="BigQuery.Parser-183"><a href="#BigQuery.Parser-183"><span class="linenos">183</span></a> <span class="s2">&quot;PARSE_TIMESTAMP&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="n">args</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">StrToTime</span><span class="p">(</span>
+</span><span id="BigQuery.Parser-184"><a href="#BigQuery.Parser-184"><span class="linenos">184</span></a> <span class="n">this</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="nb">format</span><span class="o">=</span><span class="n">seq_get</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
+</span><span id="BigQuery.Parser-185"><a href="#BigQuery.Parser-185"><span class="linenos">185</span></a> <span class="p">),</span>
+</span><span id="BigQuery.Parser-186"><a href="#BigQuery.Parser-186"><span class="linenos">186</span></a> <span class="p">}</span>
+</span><span id="BigQuery.Parser-187"><a href="#BigQuery.Parser-187"><span class="linenos">187</span></a>
+</span><span id="BigQuery.Parser-188"><a href="#BigQuery.Parser-188"><span class="linenos">188</span></a> <span class="n">FUNCTION_PARSERS</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="BigQuery.Parser-189"><a href="#BigQuery.Parser-189"><span class="linenos">189</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">FUNCTION_PARSERS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
+</span><span id="BigQuery.Parser-190"><a href="#BigQuery.Parser-190"><span class="linenos">190</span></a> <span class="s2">&quot;ARRAY&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">Array</span><span class="p">,</span> <span class="n">expressions</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">_parse_statement</span><span class="p">()]),</span>
+</span><span id="BigQuery.Parser-191"><a href="#BigQuery.Parser-191"><span class="linenos">191</span></a> <span class="p">}</span>
+</span><span id="BigQuery.Parser-192"><a href="#BigQuery.Parser-192"><span class="linenos">192</span></a> <span class="n">FUNCTION_PARSERS</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s2">&quot;TRIM&quot;</span><span class="p">)</span>
+</span><span id="BigQuery.Parser-193"><a href="#BigQuery.Parser-193"><span class="linenos">193</span></a>
+</span><span id="BigQuery.Parser-194"><a href="#BigQuery.Parser-194"><span class="linenos">194</span></a> <span class="n">NO_PAREN_FUNCTIONS</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="BigQuery.Parser-195"><a href="#BigQuery.Parser-195"><span class="linenos">195</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">NO_PAREN_FUNCTIONS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
+</span><span id="BigQuery.Parser-196"><a href="#BigQuery.Parser-196"><span class="linenos">196</span></a> <span class="n">TokenType</span><span class="o">.</span><span class="n">CURRENT_DATETIME</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">CurrentDatetime</span><span class="p">,</span>
+</span><span id="BigQuery.Parser-197"><a href="#BigQuery.Parser-197"><span class="linenos">197</span></a> <span class="p">}</span>
+</span><span id="BigQuery.Parser-198"><a href="#BigQuery.Parser-198"><span class="linenos">198</span></a>
+</span><span id="BigQuery.Parser-199"><a href="#BigQuery.Parser-199"><span class="linenos">199</span></a> <span class="n">NESTED_TYPE_TOKENS</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="BigQuery.Parser-200"><a href="#BigQuery.Parser-200"><span class="linenos">200</span></a> <span class="o">*</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">NESTED_TYPE_TOKENS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
+</span><span id="BigQuery.Parser-201"><a href="#BigQuery.Parser-201"><span class="linenos">201</span></a> <span class="n">TokenType</span><span class="o">.</span><span class="n">TABLE</span><span class="p">,</span>
+</span><span id="BigQuery.Parser-202"><a href="#BigQuery.Parser-202"><span class="linenos">202</span></a> <span class="p">}</span>
+</span><span id="BigQuery.Parser-203"><a href="#BigQuery.Parser-203"><span class="linenos">203</span></a>
+</span><span id="BigQuery.Parser-204"><a href="#BigQuery.Parser-204"><span class="linenos">204</span></a> <span class="n">ID_VAR_TOKENS</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="BigQuery.Parser-205"><a href="#BigQuery.Parser-205"><span class="linenos">205</span></a> <span class="o">*</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">ID_VAR_TOKENS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
+</span><span id="BigQuery.Parser-206"><a href="#BigQuery.Parser-206"><span class="linenos">206</span></a> <span class="n">TokenType</span><span class="o">.</span><span class="n">VALUES</span><span class="p">,</span>
+</span><span id="BigQuery.Parser-207"><a href="#BigQuery.Parser-207"><span class="linenos">207</span></a> <span class="p">}</span>
+</span><span id="BigQuery.Parser-208"><a href="#BigQuery.Parser-208"><span class="linenos">208</span></a>
+</span><span id="BigQuery.Parser-209"><a href="#BigQuery.Parser-209"><span class="linenos">209</span></a> <span class="n">PROPERTY_PARSERS</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="BigQuery.Parser-210"><a href="#BigQuery.Parser-210"><span class="linenos">210</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">PROPERTY_PARSERS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
+</span><span id="BigQuery.Parser-211"><a href="#BigQuery.Parser-211"><span class="linenos">211</span></a> <span class="s2">&quot;NOT DETERMINISTIC&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span>
+</span><span id="BigQuery.Parser-212"><a href="#BigQuery.Parser-212"><span class="linenos">212</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">StabilityProperty</span><span class="p">,</span> <span class="n">this</span><span class="o">=</span><span class="n">exp</span><span class="o">.</span><span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="s2">&quot;VOLATILE&quot;</span><span class="p">)</span>
+</span><span id="BigQuery.Parser-213"><a href="#BigQuery.Parser-213"><span class="linenos">213</span></a> <span class="p">),</span>
+</span><span id="BigQuery.Parser-214"><a href="#BigQuery.Parser-214"><span class="linenos">214</span></a> <span class="s2">&quot;OPTIONS&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_with_property</span><span class="p">(),</span>
+</span><span id="BigQuery.Parser-215"><a href="#BigQuery.Parser-215"><span class="linenos">215</span></a> <span class="p">}</span>
+</span><span id="BigQuery.Parser-216"><a href="#BigQuery.Parser-216"><span class="linenos">216</span></a>
+</span><span id="BigQuery.Parser-217"><a href="#BigQuery.Parser-217"><span class="linenos">217</span></a> <span class="n">CONSTRAINT_PARSERS</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="BigQuery.Parser-218"><a href="#BigQuery.Parser-218"><span class="linenos">218</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">CONSTRAINT_PARSERS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
+</span><span id="BigQuery.Parser-219"><a href="#BigQuery.Parser-219"><span class="linenos">219</span></a> <span class="s2">&quot;OPTIONS&quot;</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">_parse_with_property</span><span class="p">()),</span>
+</span><span id="BigQuery.Parser-220"><a href="#BigQuery.Parser-220"><span class="linenos">220</span></a> <span class="p">}</span>
</span></pre></div>
@@ -835,108 +876,115 @@ Default: "nulls_are_small"</li>
</div>
<a class="headerlink" href="#BigQuery.Generator"></a>
- <div class="pdoc-code codehilite"><pre><span></span><span id="BigQuery.Generator-212"><a href="#BigQuery.Generator-212"><span class="linenos">212</span></a> <span class="k">class</span> <span class="nc">Generator</span><span class="p">(</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="p">):</span>
-</span><span id="BigQuery.Generator-213"><a href="#BigQuery.Generator-213"><span class="linenos">213</span></a> <span class="n">EXPLICIT_UNION</span> <span class="o">=</span> <span class="kc">True</span>
-</span><span id="BigQuery.Generator-214"><a href="#BigQuery.Generator-214"><span class="linenos">214</span></a> <span class="n">INTERVAL_ALLOWS_PLURAL_FORM</span> <span class="o">=</span> <span class="kc">False</span>
-</span><span id="BigQuery.Generator-215"><a href="#BigQuery.Generator-215"><span class="linenos">215</span></a> <span class="n">JOIN_HINTS</span> <span class="o">=</span> <span class="kc">False</span>
-</span><span id="BigQuery.Generator-216"><a href="#BigQuery.Generator-216"><span class="linenos">216</span></a> <span class="n">TABLE_HINTS</span> <span class="o">=</span> <span class="kc">False</span>
-</span><span id="BigQuery.Generator-217"><a href="#BigQuery.Generator-217"><span class="linenos">217</span></a> <span class="n">LIMIT_FETCH</span> <span class="o">=</span> <span class="s2">&quot;LIMIT&quot;</span>
-</span><span id="BigQuery.Generator-218"><a href="#BigQuery.Generator-218"><span class="linenos">218</span></a>
-</span><span id="BigQuery.Generator-219"><a href="#BigQuery.Generator-219"><span class="linenos">219</span></a> <span class="n">TRANSFORMS</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="BigQuery.Generator-220"><a href="#BigQuery.Generator-220"><span class="linenos">220</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">TRANSFORMS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
-</span><span id="BigQuery.Generator-221"><a href="#BigQuery.Generator-221"><span class="linenos">221</span></a> <span class="o">**</span><span class="n">transforms</span><span class="o">.</span><span class="n">REMOVE_PRECISION_PARAMETERIZED_TYPES</span><span class="p">,</span> <span class="c1"># type: ignore</span>
-</span><span id="BigQuery.Generator-222"><a href="#BigQuery.Generator-222"><span class="linenos">222</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">ArraySize</span><span class="p">:</span> <span class="n">rename_func</span><span class="p">(</span><span class="s2">&quot;ARRAY_LENGTH&quot;</span><span class="p">),</span>
-</span><span id="BigQuery.Generator-223"><a href="#BigQuery.Generator-223"><span class="linenos">223</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">AtTimeZone</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">func</span><span class="p">(</span>
-</span><span id="BigQuery.Generator-224"><a href="#BigQuery.Generator-224"><span class="linenos">224</span></a> <span class="s2">&quot;TIMESTAMP&quot;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">func</span><span class="p">(</span><span class="s2">&quot;DATETIME&quot;</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;zone&quot;</span><span class="p">))</span>
-</span><span id="BigQuery.Generator-225"><a href="#BigQuery.Generator-225"><span class="linenos">225</span></a> <span class="p">),</span>
-</span><span id="BigQuery.Generator-226"><a href="#BigQuery.Generator-226"><span class="linenos">226</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DateAdd</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;DATE&quot;</span><span class="p">,</span> <span class="s2">&quot;ADD&quot;</span><span class="p">),</span>
-</span><span id="BigQuery.Generator-227"><a href="#BigQuery.Generator-227"><span class="linenos">227</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DateSub</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;DATE&quot;</span><span class="p">,</span> <span class="s2">&quot;SUB&quot;</span><span class="p">),</span>
-</span><span id="BigQuery.Generator-228"><a href="#BigQuery.Generator-228"><span class="linenos">228</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DatetimeAdd</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;DATETIME&quot;</span><span class="p">,</span> <span class="s2">&quot;ADD&quot;</span><span class="p">),</span>
-</span><span id="BigQuery.Generator-229"><a href="#BigQuery.Generator-229"><span class="linenos">229</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DatetimeSub</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;DATETIME&quot;</span><span class="p">,</span> <span class="s2">&quot;SUB&quot;</span><span class="p">),</span>
-</span><span id="BigQuery.Generator-230"><a href="#BigQuery.Generator-230"><span class="linenos">230</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DateDiff</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">&quot;DATE_DIFF(</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">&#39;this&#39;</span><span class="p">)</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">&#39;expression&#39;</span><span class="p">)</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;unit&#39;</span><span class="p">,</span><span class="w"> </span><span class="s1">&#39;DAY&#39;</span><span class="p">))</span><span class="si">}</span><span class="s2">)&quot;</span><span class="p">,</span>
-</span><span id="BigQuery.Generator-231"><a href="#BigQuery.Generator-231"><span class="linenos">231</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DateStrToDate</span><span class="p">:</span> <span class="n">datestrtodate_sql</span><span class="p">,</span>
-</span><span id="BigQuery.Generator-232"><a href="#BigQuery.Generator-232"><span class="linenos">232</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DateTrunc</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">func</span><span class="p">(</span><span class="s2">&quot;DATE_TRUNC&quot;</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">&quot;unit&quot;</span><span class="p">)),</span>
-</span><span id="BigQuery.Generator-233"><a href="#BigQuery.Generator-233"><span class="linenos">233</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">GroupConcat</span><span class="p">:</span> <span class="n">rename_func</span><span class="p">(</span><span class="s2">&quot;STRING_AGG&quot;</span><span class="p">),</span>
-</span><span id="BigQuery.Generator-234"><a href="#BigQuery.Generator-234"><span class="linenos">234</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">ILike</span><span class="p">:</span> <span class="n">no_ilike_sql</span><span class="p">,</span>
-</span><span id="BigQuery.Generator-235"><a href="#BigQuery.Generator-235"><span class="linenos">235</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">IntDiv</span><span class="p">:</span> <span class="n">rename_func</span><span class="p">(</span><span class="s2">&quot;DIV&quot;</span><span class="p">),</span>
-</span><span id="BigQuery.Generator-236"><a href="#BigQuery.Generator-236"><span class="linenos">236</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Max</span><span class="p">:</span> <span class="n">max_or_greatest</span><span class="p">,</span>
-</span><span id="BigQuery.Generator-237"><a href="#BigQuery.Generator-237"><span class="linenos">237</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Min</span><span class="p">:</span> <span class="n">min_or_least</span><span class="p">,</span>
-</span><span id="BigQuery.Generator-238"><a href="#BigQuery.Generator-238"><span class="linenos">238</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Select</span><span class="p">:</span> <span class="n">transforms</span><span class="o">.</span><span class="n">preprocess</span><span class="p">([</span><span class="n">_unqualify_unnest</span><span class="p">]),</span>
-</span><span id="BigQuery.Generator-239"><a href="#BigQuery.Generator-239"><span class="linenos">239</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">StrToTime</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">&quot;PARSE_TIMESTAMP(</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">format_time</span><span class="p">(</span><span class="n">e</span><span class="p">)</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">&#39;this&#39;</span><span class="p">)</span><span class="si">}</span><span class="s2">)&quot;</span><span class="p">,</span>
-</span><span id="BigQuery.Generator-240"><a href="#BigQuery.Generator-240"><span class="linenos">240</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TimeAdd</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;TIME&quot;</span><span class="p">,</span> <span class="s2">&quot;ADD&quot;</span><span class="p">),</span>
-</span><span id="BigQuery.Generator-241"><a href="#BigQuery.Generator-241"><span class="linenos">241</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TimeSub</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;TIME&quot;</span><span class="p">,</span> <span class="s2">&quot;SUB&quot;</span><span class="p">),</span>
-</span><span id="BigQuery.Generator-242"><a href="#BigQuery.Generator-242"><span class="linenos">242</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TimestampAdd</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;TIMESTAMP&quot;</span><span class="p">,</span> <span class="s2">&quot;ADD&quot;</span><span class="p">),</span>
-</span><span id="BigQuery.Generator-243"><a href="#BigQuery.Generator-243"><span class="linenos">243</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TimestampSub</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;TIMESTAMP&quot;</span><span class="p">,</span> <span class="s2">&quot;SUB&quot;</span><span class="p">),</span>
-</span><span id="BigQuery.Generator-244"><a href="#BigQuery.Generator-244"><span class="linenos">244</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TimeStrToTime</span><span class="p">:</span> <span class="n">timestrtotime_sql</span><span class="p">,</span>
-</span><span id="BigQuery.Generator-245"><a href="#BigQuery.Generator-245"><span class="linenos">245</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TsOrDsToDate</span><span class="p">:</span> <span class="n">ts_or_ds_to_date_sql</span><span class="p">(</span><span class="s2">&quot;bigquery&quot;</span><span class="p">),</span>
-</span><span id="BigQuery.Generator-246"><a href="#BigQuery.Generator-246"><span class="linenos">246</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TsOrDsAdd</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;DATE&quot;</span><span class="p">,</span> <span class="s2">&quot;ADD&quot;</span><span class="p">),</span>
-</span><span id="BigQuery.Generator-247"><a href="#BigQuery.Generator-247"><span class="linenos">247</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">PartitionedByProperty</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">&quot;PARTITION BY </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">&#39;this&#39;</span><span class="p">)</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">,</span>
-</span><span id="BigQuery.Generator-248"><a href="#BigQuery.Generator-248"><span class="linenos">248</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">VariancePop</span><span class="p">:</span> <span class="n">rename_func</span><span class="p">(</span><span class="s2">&quot;VAR_POP&quot;</span><span class="p">),</span>
-</span><span id="BigQuery.Generator-249"><a href="#BigQuery.Generator-249"><span class="linenos">249</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Values</span><span class="p">:</span> <span class="n">_derived_table_values_to_unnest</span><span class="p">,</span>
-</span><span id="BigQuery.Generator-250"><a href="#BigQuery.Generator-250"><span class="linenos">250</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">ReturnsProperty</span><span class="p">:</span> <span class="n">_returnsproperty_sql</span><span class="p">,</span>
-</span><span id="BigQuery.Generator-251"><a href="#BigQuery.Generator-251"><span class="linenos">251</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Create</span><span class="p">:</span> <span class="n">_create_sql</span><span class="p">,</span>
-</span><span id="BigQuery.Generator-252"><a href="#BigQuery.Generator-252"><span class="linenos">252</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Trim</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">func</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;TRIM&quot;</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">expression</span><span class="p">),</span>
-</span><span id="BigQuery.Generator-253"><a href="#BigQuery.Generator-253"><span class="linenos">253</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">StabilityProperty</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">&quot;DETERMINISTIC&quot;</span>
-</span><span id="BigQuery.Generator-254"><a href="#BigQuery.Generator-254"><span class="linenos">254</span></a> <span class="k">if</span> <span class="n">e</span><span class="o">.</span><span class="n">name</span> <span class="o">==</span> <span class="s2">&quot;IMMUTABLE&quot;</span>
-</span><span id="BigQuery.Generator-255"><a href="#BigQuery.Generator-255"><span class="linenos">255</span></a> <span class="k">else</span> <span class="s2">&quot;NOT DETERMINISTIC&quot;</span><span class="p">,</span>
-</span><span id="BigQuery.Generator-256"><a href="#BigQuery.Generator-256"><span class="linenos">256</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">RegexpLike</span><span class="p">:</span> <span class="n">rename_func</span><span class="p">(</span><span class="s2">&quot;REGEXP_CONTAINS&quot;</span><span class="p">),</span>
-</span><span id="BigQuery.Generator-257"><a href="#BigQuery.Generator-257"><span class="linenos">257</span></a> <span class="p">}</span>
-</span><span id="BigQuery.Generator-258"><a href="#BigQuery.Generator-258"><span class="linenos">258</span></a>
-</span><span id="BigQuery.Generator-259"><a href="#BigQuery.Generator-259"><span class="linenos">259</span></a> <span class="n">TYPE_MAPPING</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="BigQuery.Generator-260"><a href="#BigQuery.Generator-260"><span class="linenos">260</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">TYPE_MAPPING</span><span class="p">,</span> <span class="c1"># type: ignore</span>
-</span><span id="BigQuery.Generator-261"><a href="#BigQuery.Generator-261"><span class="linenos">261</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">BIGDECIMAL</span><span class="p">:</span> <span class="s2">&quot;BIGNUMERIC&quot;</span><span class="p">,</span>
-</span><span id="BigQuery.Generator-262"><a href="#BigQuery.Generator-262"><span class="linenos">262</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">BIGINT</span><span class="p">:</span> <span class="s2">&quot;INT64&quot;</span><span class="p">,</span>
-</span><span id="BigQuery.Generator-263"><a href="#BigQuery.Generator-263"><span class="linenos">263</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">BOOLEAN</span><span class="p">:</span> <span class="s2">&quot;BOOL&quot;</span><span class="p">,</span>
-</span><span id="BigQuery.Generator-264"><a href="#BigQuery.Generator-264"><span class="linenos">264</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">CHAR</span><span class="p">:</span> <span class="s2">&quot;STRING&quot;</span><span class="p">,</span>
-</span><span id="BigQuery.Generator-265"><a href="#BigQuery.Generator-265"><span class="linenos">265</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">DECIMAL</span><span class="p">:</span> <span class="s2">&quot;NUMERIC&quot;</span><span class="p">,</span>
-</span><span id="BigQuery.Generator-266"><a href="#BigQuery.Generator-266"><span class="linenos">266</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">DOUBLE</span><span class="p">:</span> <span class="s2">&quot;FLOAT64&quot;</span><span class="p">,</span>
-</span><span id="BigQuery.Generator-267"><a href="#BigQuery.Generator-267"><span class="linenos">267</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">FLOAT</span><span class="p">:</span> <span class="s2">&quot;FLOAT64&quot;</span><span class="p">,</span>
-</span><span id="BigQuery.Generator-268"><a href="#BigQuery.Generator-268"><span class="linenos">268</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">INT</span><span class="p">:</span> <span class="s2">&quot;INT64&quot;</span><span class="p">,</span>
-</span><span id="BigQuery.Generator-269"><a href="#BigQuery.Generator-269"><span class="linenos">269</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">NCHAR</span><span class="p">:</span> <span class="s2">&quot;STRING&quot;</span><span class="p">,</span>
-</span><span id="BigQuery.Generator-270"><a href="#BigQuery.Generator-270"><span class="linenos">270</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">NVARCHAR</span><span class="p">:</span> <span class="s2">&quot;STRING&quot;</span><span class="p">,</span>
-</span><span id="BigQuery.Generator-271"><a href="#BigQuery.Generator-271"><span class="linenos">271</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">SMALLINT</span><span class="p">:</span> <span class="s2">&quot;INT64&quot;</span><span class="p">,</span>
-</span><span id="BigQuery.Generator-272"><a href="#BigQuery.Generator-272"><span class="linenos">272</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">TEXT</span><span class="p">:</span> <span class="s2">&quot;STRING&quot;</span><span class="p">,</span>
-</span><span id="BigQuery.Generator-273"><a href="#BigQuery.Generator-273"><span class="linenos">273</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMP</span><span class="p">:</span> <span class="s2">&quot;DATETIME&quot;</span><span class="p">,</span>
-</span><span id="BigQuery.Generator-274"><a href="#BigQuery.Generator-274"><span class="linenos">274</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMPTZ</span><span class="p">:</span> <span class="s2">&quot;TIMESTAMP&quot;</span><span class="p">,</span>
-</span><span id="BigQuery.Generator-275"><a href="#BigQuery.Generator-275"><span class="linenos">275</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">TINYINT</span><span class="p">:</span> <span class="s2">&quot;INT64&quot;</span><span class="p">,</span>
-</span><span id="BigQuery.Generator-276"><a href="#BigQuery.Generator-276"><span class="linenos">276</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">VARCHAR</span><span class="p">:</span> <span class="s2">&quot;STRING&quot;</span><span class="p">,</span>
-</span><span id="BigQuery.Generator-277"><a href="#BigQuery.Generator-277"><span class="linenos">277</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">VARIANT</span><span class="p">:</span> <span class="s2">&quot;ANY TYPE&quot;</span><span class="p">,</span>
-</span><span id="BigQuery.Generator-278"><a href="#BigQuery.Generator-278"><span class="linenos">278</span></a> <span class="p">}</span>
-</span><span id="BigQuery.Generator-279"><a href="#BigQuery.Generator-279"><span class="linenos">279</span></a>
-</span><span id="BigQuery.Generator-280"><a href="#BigQuery.Generator-280"><span class="linenos">280</span></a> <span class="n">PROPERTIES_LOCATION</span> <span class="o">=</span> <span class="p">{</span>
-</span><span id="BigQuery.Generator-281"><a href="#BigQuery.Generator-281"><span class="linenos">281</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">PROPERTIES_LOCATION</span><span class="p">,</span> <span class="c1"># type: ignore</span>
-</span><span id="BigQuery.Generator-282"><a href="#BigQuery.Generator-282"><span class="linenos">282</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">PartitionedByProperty</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_SCHEMA</span><span class="p">,</span>
-</span><span id="BigQuery.Generator-283"><a href="#BigQuery.Generator-283"><span class="linenos">283</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">VolatileProperty</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">UNSUPPORTED</span><span class="p">,</span>
-</span><span id="BigQuery.Generator-284"><a href="#BigQuery.Generator-284"><span class="linenos">284</span></a> <span class="p">}</span>
-</span><span id="BigQuery.Generator-285"><a href="#BigQuery.Generator-285"><span class="linenos">285</span></a>
-</span><span id="BigQuery.Generator-286"><a href="#BigQuery.Generator-286"><span class="linenos">286</span></a> <span class="k">def</span> <span class="nf">array_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Array</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
-</span><span id="BigQuery.Generator-287"><a href="#BigQuery.Generator-287"><span class="linenos">287</span></a> <span class="n">first_arg</span> <span class="o">=</span> <span class="n">seq_get</span><span class="p">(</span><span class="n">expression</span><span class="o">.</span><span class="n">expressions</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
-</span><span id="BigQuery.Generator-288"><a href="#BigQuery.Generator-288"><span class="linenos">288</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">first_arg</span><span class="p">,</span> <span class="n">exp</span><span class="o">.</span><span class="n">Subqueryable</span><span class="p">):</span>
-</span><span id="BigQuery.Generator-289"><a href="#BigQuery.Generator-289"><span class="linenos">289</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">&quot;ARRAY</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">wrap</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">first_arg</span><span class="p">))</span><span class="si">}</span><span class="s2">&quot;</span>
-</span><span id="BigQuery.Generator-290"><a href="#BigQuery.Generator-290"><span class="linenos">290</span></a>
-</span><span id="BigQuery.Generator-291"><a href="#BigQuery.Generator-291"><span class="linenos">291</span></a> <span class="k">return</span> <span class="n">inline_array_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">)</span>
-</span><span id="BigQuery.Generator-292"><a href="#BigQuery.Generator-292"><span class="linenos">292</span></a>
-</span><span id="BigQuery.Generator-293"><a href="#BigQuery.Generator-293"><span class="linenos">293</span></a> <span class="k">def</span> <span class="nf">transaction_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">_</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
-</span><span id="BigQuery.Generator-294"><a href="#BigQuery.Generator-294"><span class="linenos">294</span></a> <span class="k">return</span> <span class="s2">&quot;BEGIN TRANSACTION&quot;</span>
-</span><span id="BigQuery.Generator-295"><a href="#BigQuery.Generator-295"><span class="linenos">295</span></a>
-</span><span id="BigQuery.Generator-296"><a href="#BigQuery.Generator-296"><span class="linenos">296</span></a> <span class="k">def</span> <span class="nf">commit_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">_</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
-</span><span id="BigQuery.Generator-297"><a href="#BigQuery.Generator-297"><span class="linenos">297</span></a> <span class="k">return</span> <span class="s2">&quot;COMMIT TRANSACTION&quot;</span>
-</span><span id="BigQuery.Generator-298"><a href="#BigQuery.Generator-298"><span class="linenos">298</span></a>
-</span><span id="BigQuery.Generator-299"><a href="#BigQuery.Generator-299"><span class="linenos">299</span></a> <span class="k">def</span> <span class="nf">rollback_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">_</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
-</span><span id="BigQuery.Generator-300"><a href="#BigQuery.Generator-300"><span class="linenos">300</span></a> <span class="k">return</span> <span class="s2">&quot;ROLLBACK TRANSACTION&quot;</span>
-</span><span id="BigQuery.Generator-301"><a href="#BigQuery.Generator-301"><span class="linenos">301</span></a>
-</span><span id="BigQuery.Generator-302"><a href="#BigQuery.Generator-302"><span class="linenos">302</span></a> <span class="k">def</span> <span class="nf">in_unnest_op</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Unnest</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
-</span><span id="BigQuery.Generator-303"><a href="#BigQuery.Generator-303"><span class="linenos">303</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span>
+ <div class="pdoc-code codehilite"><pre><span></span><span id="BigQuery.Generator-222"><a href="#BigQuery.Generator-222"><span class="linenos">222</span></a> <span class="k">class</span> <span class="nc">Generator</span><span class="p">(</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="p">):</span>
+</span><span id="BigQuery.Generator-223"><a href="#BigQuery.Generator-223"><span class="linenos">223</span></a> <span class="n">EXPLICIT_UNION</span> <span class="o">=</span> <span class="kc">True</span>
+</span><span id="BigQuery.Generator-224"><a href="#BigQuery.Generator-224"><span class="linenos">224</span></a> <span class="n">INTERVAL_ALLOWS_PLURAL_FORM</span> <span class="o">=</span> <span class="kc">False</span>
+</span><span id="BigQuery.Generator-225"><a href="#BigQuery.Generator-225"><span class="linenos">225</span></a> <span class="n">JOIN_HINTS</span> <span class="o">=</span> <span class="kc">False</span>
+</span><span id="BigQuery.Generator-226"><a href="#BigQuery.Generator-226"><span class="linenos">226</span></a> <span class="n">TABLE_HINTS</span> <span class="o">=</span> <span class="kc">False</span>
+</span><span id="BigQuery.Generator-227"><a href="#BigQuery.Generator-227"><span class="linenos">227</span></a> <span class="n">LIMIT_FETCH</span> <span class="o">=</span> <span class="s2">&quot;LIMIT&quot;</span>
+</span><span id="BigQuery.Generator-228"><a href="#BigQuery.Generator-228"><span class="linenos">228</span></a>
+</span><span id="BigQuery.Generator-229"><a href="#BigQuery.Generator-229"><span class="linenos">229</span></a> <span class="n">TRANSFORMS</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="BigQuery.Generator-230"><a href="#BigQuery.Generator-230"><span class="linenos">230</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">TRANSFORMS</span><span class="p">,</span> <span class="c1"># type: ignore</span>
+</span><span id="BigQuery.Generator-231"><a href="#BigQuery.Generator-231"><span class="linenos">231</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">ArraySize</span><span class="p">:</span> <span class="n">rename_func</span><span class="p">(</span><span class="s2">&quot;ARRAY_LENGTH&quot;</span><span class="p">),</span>
+</span><span id="BigQuery.Generator-232"><a href="#BigQuery.Generator-232"><span class="linenos">232</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">AtTimeZone</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">func</span><span class="p">(</span>
+</span><span id="BigQuery.Generator-233"><a href="#BigQuery.Generator-233"><span class="linenos">233</span></a> <span class="s2">&quot;TIMESTAMP&quot;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">func</span><span class="p">(</span><span class="s2">&quot;DATETIME&quot;</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;zone&quot;</span><span class="p">))</span>
+</span><span id="BigQuery.Generator-234"><a href="#BigQuery.Generator-234"><span class="linenos">234</span></a> <span class="p">),</span>
+</span><span id="BigQuery.Generator-235"><a href="#BigQuery.Generator-235"><span class="linenos">235</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Cast</span><span class="p">:</span> <span class="n">transforms</span><span class="o">.</span><span class="n">preprocess</span><span class="p">([</span><span class="n">transforms</span><span class="o">.</span><span class="n">remove_precision_parameterized_types</span><span class="p">]),</span>
+</span><span id="BigQuery.Generator-236"><a href="#BigQuery.Generator-236"><span class="linenos">236</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DateAdd</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;DATE&quot;</span><span class="p">,</span> <span class="s2">&quot;ADD&quot;</span><span class="p">),</span>
+</span><span id="BigQuery.Generator-237"><a href="#BigQuery.Generator-237"><span class="linenos">237</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DateSub</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;DATE&quot;</span><span class="p">,</span> <span class="s2">&quot;SUB&quot;</span><span class="p">),</span>
+</span><span id="BigQuery.Generator-238"><a href="#BigQuery.Generator-238"><span class="linenos">238</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DatetimeAdd</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;DATETIME&quot;</span><span class="p">,</span> <span class="s2">&quot;ADD&quot;</span><span class="p">),</span>
+</span><span id="BigQuery.Generator-239"><a href="#BigQuery.Generator-239"><span class="linenos">239</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DatetimeSub</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;DATETIME&quot;</span><span class="p">,</span> <span class="s2">&quot;SUB&quot;</span><span class="p">),</span>
+</span><span id="BigQuery.Generator-240"><a href="#BigQuery.Generator-240"><span class="linenos">240</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DateDiff</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">&quot;DATE_DIFF(</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">&#39;this&#39;</span><span class="p">)</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">&#39;expression&#39;</span><span class="p">)</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;unit&#39;</span><span class="p">,</span><span class="w"> </span><span class="s1">&#39;DAY&#39;</span><span class="p">))</span><span class="si">}</span><span class="s2">)&quot;</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-241"><a href="#BigQuery.Generator-241"><span class="linenos">241</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DateStrToDate</span><span class="p">:</span> <span class="n">datestrtodate_sql</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-242"><a href="#BigQuery.Generator-242"><span class="linenos">242</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DateTrunc</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">func</span><span class="p">(</span><span class="s2">&quot;DATE_TRUNC&quot;</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">&quot;unit&quot;</span><span class="p">)),</span>
+</span><span id="BigQuery.Generator-243"><a href="#BigQuery.Generator-243"><span class="linenos">243</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">GroupConcat</span><span class="p">:</span> <span class="n">rename_func</span><span class="p">(</span><span class="s2">&quot;STRING_AGG&quot;</span><span class="p">),</span>
+</span><span id="BigQuery.Generator-244"><a href="#BigQuery.Generator-244"><span class="linenos">244</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">ILike</span><span class="p">:</span> <span class="n">no_ilike_sql</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-245"><a href="#BigQuery.Generator-245"><span class="linenos">245</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">IntDiv</span><span class="p">:</span> <span class="n">rename_func</span><span class="p">(</span><span class="s2">&quot;DIV&quot;</span><span class="p">),</span>
+</span><span id="BigQuery.Generator-246"><a href="#BigQuery.Generator-246"><span class="linenos">246</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Max</span><span class="p">:</span> <span class="n">max_or_greatest</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-247"><a href="#BigQuery.Generator-247"><span class="linenos">247</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Min</span><span class="p">:</span> <span class="n">min_or_least</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-248"><a href="#BigQuery.Generator-248"><span class="linenos">248</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Select</span><span class="p">:</span> <span class="n">transforms</span><span class="o">.</span><span class="n">preprocess</span><span class="p">(</span>
+</span><span id="BigQuery.Generator-249"><a href="#BigQuery.Generator-249"><span class="linenos">249</span></a> <span class="p">[</span><span class="n">_unqualify_unnest</span><span class="p">,</span> <span class="n">transforms</span><span class="o">.</span><span class="n">eliminate_distinct_on</span><span class="p">]</span>
+</span><span id="BigQuery.Generator-250"><a href="#BigQuery.Generator-250"><span class="linenos">250</span></a> <span class="p">),</span>
+</span><span id="BigQuery.Generator-251"><a href="#BigQuery.Generator-251"><span class="linenos">251</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">StrToTime</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">&quot;PARSE_TIMESTAMP(</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">format_time</span><span class="p">(</span><span class="n">e</span><span class="p">)</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">&#39;this&#39;</span><span class="p">)</span><span class="si">}</span><span class="s2">)&quot;</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-252"><a href="#BigQuery.Generator-252"><span class="linenos">252</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TimeAdd</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;TIME&quot;</span><span class="p">,</span> <span class="s2">&quot;ADD&quot;</span><span class="p">),</span>
+</span><span id="BigQuery.Generator-253"><a href="#BigQuery.Generator-253"><span class="linenos">253</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TimeSub</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;TIME&quot;</span><span class="p">,</span> <span class="s2">&quot;SUB&quot;</span><span class="p">),</span>
+</span><span id="BigQuery.Generator-254"><a href="#BigQuery.Generator-254"><span class="linenos">254</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TimestampAdd</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;TIMESTAMP&quot;</span><span class="p">,</span> <span class="s2">&quot;ADD&quot;</span><span class="p">),</span>
+</span><span id="BigQuery.Generator-255"><a href="#BigQuery.Generator-255"><span class="linenos">255</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TimestampSub</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;TIMESTAMP&quot;</span><span class="p">,</span> <span class="s2">&quot;SUB&quot;</span><span class="p">),</span>
+</span><span id="BigQuery.Generator-256"><a href="#BigQuery.Generator-256"><span class="linenos">256</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TimeStrToTime</span><span class="p">:</span> <span class="n">timestrtotime_sql</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-257"><a href="#BigQuery.Generator-257"><span class="linenos">257</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TsOrDsToDate</span><span class="p">:</span> <span class="n">ts_or_ds_to_date_sql</span><span class="p">(</span><span class="s2">&quot;bigquery&quot;</span><span class="p">),</span>
+</span><span id="BigQuery.Generator-258"><a href="#BigQuery.Generator-258"><span class="linenos">258</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">TsOrDsAdd</span><span class="p">:</span> <span class="n">_date_add_sql</span><span class="p">(</span><span class="s2">&quot;DATE&quot;</span><span class="p">,</span> <span class="s2">&quot;ADD&quot;</span><span class="p">),</span>
+</span><span id="BigQuery.Generator-259"><a href="#BigQuery.Generator-259"><span class="linenos">259</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">PartitionedByProperty</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">&quot;PARTITION BY </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">&#39;this&#39;</span><span class="p">)</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-260"><a href="#BigQuery.Generator-260"><span class="linenos">260</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">VariancePop</span><span class="p">:</span> <span class="n">rename_func</span><span class="p">(</span><span class="s2">&quot;VAR_POP&quot;</span><span class="p">),</span>
+</span><span id="BigQuery.Generator-261"><a href="#BigQuery.Generator-261"><span class="linenos">261</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Values</span><span class="p">:</span> <span class="n">_derived_table_values_to_unnest</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-262"><a href="#BigQuery.Generator-262"><span class="linenos">262</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">ReturnsProperty</span><span class="p">:</span> <span class="n">_returnsproperty_sql</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-263"><a href="#BigQuery.Generator-263"><span class="linenos">263</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Create</span><span class="p">:</span> <span class="n">_create_sql</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-264"><a href="#BigQuery.Generator-264"><span class="linenos">264</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Trim</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">func</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;TRIM&quot;</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">expression</span><span class="p">),</span>
+</span><span id="BigQuery.Generator-265"><a href="#BigQuery.Generator-265"><span class="linenos">265</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">StabilityProperty</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">&quot;DETERMINISTIC&quot;</span>
+</span><span id="BigQuery.Generator-266"><a href="#BigQuery.Generator-266"><span class="linenos">266</span></a> <span class="k">if</span> <span class="n">e</span><span class="o">.</span><span class="n">name</span> <span class="o">==</span> <span class="s2">&quot;IMMUTABLE&quot;</span>
+</span><span id="BigQuery.Generator-267"><a href="#BigQuery.Generator-267"><span class="linenos">267</span></a> <span class="k">else</span> <span class="s2">&quot;NOT DETERMINISTIC&quot;</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-268"><a href="#BigQuery.Generator-268"><span class="linenos">268</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">RegexpLike</span><span class="p">:</span> <span class="n">rename_func</span><span class="p">(</span><span class="s2">&quot;REGEXP_CONTAINS&quot;</span><span class="p">),</span>
+</span><span id="BigQuery.Generator-269"><a href="#BigQuery.Generator-269"><span class="linenos">269</span></a> <span class="p">}</span>
+</span><span id="BigQuery.Generator-270"><a href="#BigQuery.Generator-270"><span class="linenos">270</span></a>
+</span><span id="BigQuery.Generator-271"><a href="#BigQuery.Generator-271"><span class="linenos">271</span></a> <span class="n">TYPE_MAPPING</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="BigQuery.Generator-272"><a href="#BigQuery.Generator-272"><span class="linenos">272</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">TYPE_MAPPING</span><span class="p">,</span> <span class="c1"># type: ignore</span>
+</span><span id="BigQuery.Generator-273"><a href="#BigQuery.Generator-273"><span class="linenos">273</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">BIGDECIMAL</span><span class="p">:</span> <span class="s2">&quot;BIGNUMERIC&quot;</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-274"><a href="#BigQuery.Generator-274"><span class="linenos">274</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">BIGINT</span><span class="p">:</span> <span class="s2">&quot;INT64&quot;</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-275"><a href="#BigQuery.Generator-275"><span class="linenos">275</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">BINARY</span><span class="p">:</span> <span class="s2">&quot;BYTES&quot;</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-276"><a href="#BigQuery.Generator-276"><span class="linenos">276</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">BOOLEAN</span><span class="p">:</span> <span class="s2">&quot;BOOL&quot;</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-277"><a href="#BigQuery.Generator-277"><span class="linenos">277</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">CHAR</span><span class="p">:</span> <span class="s2">&quot;STRING&quot;</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-278"><a href="#BigQuery.Generator-278"><span class="linenos">278</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">DECIMAL</span><span class="p">:</span> <span class="s2">&quot;NUMERIC&quot;</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-279"><a href="#BigQuery.Generator-279"><span class="linenos">279</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">DOUBLE</span><span class="p">:</span> <span class="s2">&quot;FLOAT64&quot;</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-280"><a href="#BigQuery.Generator-280"><span class="linenos">280</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">FLOAT</span><span class="p">:</span> <span class="s2">&quot;FLOAT64&quot;</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-281"><a href="#BigQuery.Generator-281"><span class="linenos">281</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">INT</span><span class="p">:</span> <span class="s2">&quot;INT64&quot;</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-282"><a href="#BigQuery.Generator-282"><span class="linenos">282</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">NCHAR</span><span class="p">:</span> <span class="s2">&quot;STRING&quot;</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-283"><a href="#BigQuery.Generator-283"><span class="linenos">283</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">NVARCHAR</span><span class="p">:</span> <span class="s2">&quot;STRING&quot;</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-284"><a href="#BigQuery.Generator-284"><span class="linenos">284</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">SMALLINT</span><span class="p">:</span> <span class="s2">&quot;INT64&quot;</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-285"><a href="#BigQuery.Generator-285"><span class="linenos">285</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">TEXT</span><span class="p">:</span> <span class="s2">&quot;STRING&quot;</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-286"><a href="#BigQuery.Generator-286"><span class="linenos">286</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMP</span><span class="p">:</span> <span class="s2">&quot;DATETIME&quot;</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-287"><a href="#BigQuery.Generator-287"><span class="linenos">287</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMPTZ</span><span class="p">:</span> <span class="s2">&quot;TIMESTAMP&quot;</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-288"><a href="#BigQuery.Generator-288"><span class="linenos">288</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">TINYINT</span><span class="p">:</span> <span class="s2">&quot;INT64&quot;</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-289"><a href="#BigQuery.Generator-289"><span class="linenos">289</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">VARBINARY</span><span class="p">:</span> <span class="s2">&quot;BYTES&quot;</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-290"><a href="#BigQuery.Generator-290"><span class="linenos">290</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">VARCHAR</span><span class="p">:</span> <span class="s2">&quot;STRING&quot;</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-291"><a href="#BigQuery.Generator-291"><span class="linenos">291</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">VARIANT</span><span class="p">:</span> <span class="s2">&quot;ANY TYPE&quot;</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-292"><a href="#BigQuery.Generator-292"><span class="linenos">292</span></a> <span class="p">}</span>
+</span><span id="BigQuery.Generator-293"><a href="#BigQuery.Generator-293"><span class="linenos">293</span></a>
+</span><span id="BigQuery.Generator-294"><a href="#BigQuery.Generator-294"><span class="linenos">294</span></a> <span class="n">PROPERTIES_LOCATION</span> <span class="o">=</span> <span class="p">{</span>
+</span><span id="BigQuery.Generator-295"><a href="#BigQuery.Generator-295"><span class="linenos">295</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">PROPERTIES_LOCATION</span><span class="p">,</span> <span class="c1"># type: ignore</span>
+</span><span id="BigQuery.Generator-296"><a href="#BigQuery.Generator-296"><span class="linenos">296</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">PartitionedByProperty</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_SCHEMA</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-297"><a href="#BigQuery.Generator-297"><span class="linenos">297</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">VolatileProperty</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">UNSUPPORTED</span><span class="p">,</span>
+</span><span id="BigQuery.Generator-298"><a href="#BigQuery.Generator-298"><span class="linenos">298</span></a> <span class="p">}</span>
+</span><span id="BigQuery.Generator-299"><a href="#BigQuery.Generator-299"><span class="linenos">299</span></a>
+</span><span id="BigQuery.Generator-300"><a href="#BigQuery.Generator-300"><span class="linenos">300</span></a> <span class="k">def</span> <span class="nf">array_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Array</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="BigQuery.Generator-301"><a href="#BigQuery.Generator-301"><span class="linenos">301</span></a> <span class="n">first_arg</span> <span class="o">=</span> <span class="n">seq_get</span><span class="p">(</span><span class="n">expression</span><span class="o">.</span><span class="n">expressions</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
+</span><span id="BigQuery.Generator-302"><a href="#BigQuery.Generator-302"><span class="linenos">302</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">first_arg</span><span class="p">,</span> <span class="n">exp</span><span class="o">.</span><span class="n">Subqueryable</span><span class="p">):</span>
+</span><span id="BigQuery.Generator-303"><a href="#BigQuery.Generator-303"><span class="linenos">303</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">&quot;ARRAY</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">wrap</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">first_arg</span><span class="p">))</span><span class="si">}</span><span class="s2">&quot;</span>
</span><span id="BigQuery.Generator-304"><a href="#BigQuery.Generator-304"><span class="linenos">304</span></a>
-</span><span id="BigQuery.Generator-305"><a href="#BigQuery.Generator-305"><span class="linenos">305</span></a> <span class="k">def</span> <span class="nf">except_op</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Except</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
-</span><span id="BigQuery.Generator-306"><a href="#BigQuery.Generator-306"><span class="linenos">306</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;distinct&quot;</span><span class="p">,</span> <span class="kc">False</span><span class="p">):</span>
-</span><span id="BigQuery.Generator-307"><a href="#BigQuery.Generator-307"><span class="linenos">307</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">unsupported</span><span class="p">(</span><span class="s2">&quot;EXCEPT without DISTINCT is not supported in BigQuery&quot;</span><span class="p">)</span>
-</span><span id="BigQuery.Generator-308"><a href="#BigQuery.Generator-308"><span class="linenos">308</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">&quot;EXCEPT</span><span class="si">{</span><span class="s1">&#39; DISTINCT&#39;</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;distinct&#39;</span><span class="p">)</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="s1">&#39; ALL&#39;</span><span class="si">}</span><span class="s2">&quot;</span>
+</span><span id="BigQuery.Generator-305"><a href="#BigQuery.Generator-305"><span class="linenos">305</span></a> <span class="k">return</span> <span class="n">inline_array_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">)</span>
+</span><span id="BigQuery.Generator-306"><a href="#BigQuery.Generator-306"><span class="linenos">306</span></a>
+</span><span id="BigQuery.Generator-307"><a href="#BigQuery.Generator-307"><span class="linenos">307</span></a> <span class="k">def</span> <span class="nf">transaction_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">_</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="BigQuery.Generator-308"><a href="#BigQuery.Generator-308"><span class="linenos">308</span></a> <span class="k">return</span> <span class="s2">&quot;BEGIN TRANSACTION&quot;</span>
</span><span id="BigQuery.Generator-309"><a href="#BigQuery.Generator-309"><span class="linenos">309</span></a>
-</span><span id="BigQuery.Generator-310"><a href="#BigQuery.Generator-310"><span class="linenos">310</span></a> <span class="k">def</span> <span class="nf">intersect_op</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Intersect</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
-</span><span id="BigQuery.Generator-311"><a href="#BigQuery.Generator-311"><span class="linenos">311</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;distinct&quot;</span><span class="p">,</span> <span class="kc">False</span><span class="p">):</span>
-</span><span id="BigQuery.Generator-312"><a href="#BigQuery.Generator-312"><span class="linenos">312</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">unsupported</span><span class="p">(</span><span class="s2">&quot;INTERSECT without DISTINCT is not supported in BigQuery&quot;</span><span class="p">)</span>
-</span><span id="BigQuery.Generator-313"><a href="#BigQuery.Generator-313"><span class="linenos">313</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">&quot;INTERSECT</span><span class="si">{</span><span class="s1">&#39; DISTINCT&#39;</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;distinct&#39;</span><span class="p">)</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="s1">&#39; ALL&#39;</span><span class="si">}</span><span class="s2">&quot;</span>
+</span><span id="BigQuery.Generator-310"><a href="#BigQuery.Generator-310"><span class="linenos">310</span></a> <span class="k">def</span> <span class="nf">commit_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">_</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="BigQuery.Generator-311"><a href="#BigQuery.Generator-311"><span class="linenos">311</span></a> <span class="k">return</span> <span class="s2">&quot;COMMIT TRANSACTION&quot;</span>
+</span><span id="BigQuery.Generator-312"><a href="#BigQuery.Generator-312"><span class="linenos">312</span></a>
+</span><span id="BigQuery.Generator-313"><a href="#BigQuery.Generator-313"><span class="linenos">313</span></a> <span class="k">def</span> <span class="nf">rollback_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">_</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="BigQuery.Generator-314"><a href="#BigQuery.Generator-314"><span class="linenos">314</span></a> <span class="k">return</span> <span class="s2">&quot;ROLLBACK TRANSACTION&quot;</span>
+</span><span id="BigQuery.Generator-315"><a href="#BigQuery.Generator-315"><span class="linenos">315</span></a>
+</span><span id="BigQuery.Generator-316"><a href="#BigQuery.Generator-316"><span class="linenos">316</span></a> <span class="k">def</span> <span class="nf">in_unnest_op</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Unnest</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="BigQuery.Generator-317"><a href="#BigQuery.Generator-317"><span class="linenos">317</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span>
+</span><span id="BigQuery.Generator-318"><a href="#BigQuery.Generator-318"><span class="linenos">318</span></a>
+</span><span id="BigQuery.Generator-319"><a href="#BigQuery.Generator-319"><span class="linenos">319</span></a> <span class="k">def</span> <span class="nf">except_op</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Except</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="BigQuery.Generator-320"><a href="#BigQuery.Generator-320"><span class="linenos">320</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;distinct&quot;</span><span class="p">,</span> <span class="kc">False</span><span class="p">):</span>
+</span><span id="BigQuery.Generator-321"><a href="#BigQuery.Generator-321"><span class="linenos">321</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">unsupported</span><span class="p">(</span><span class="s2">&quot;EXCEPT without DISTINCT is not supported in BigQuery&quot;</span><span class="p">)</span>
+</span><span id="BigQuery.Generator-322"><a href="#BigQuery.Generator-322"><span class="linenos">322</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">&quot;EXCEPT</span><span class="si">{</span><span class="s1">&#39; DISTINCT&#39;</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;distinct&#39;</span><span class="p">)</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="s1">&#39; ALL&#39;</span><span class="si">}</span><span class="s2">&quot;</span>
+</span><span id="BigQuery.Generator-323"><a href="#BigQuery.Generator-323"><span class="linenos">323</span></a>
+</span><span id="BigQuery.Generator-324"><a href="#BigQuery.Generator-324"><span class="linenos">324</span></a> <span class="k">def</span> <span class="nf">intersect_op</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Intersect</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="BigQuery.Generator-325"><a href="#BigQuery.Generator-325"><span class="linenos">325</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;distinct&quot;</span><span class="p">,</span> <span class="kc">False</span><span class="p">):</span>
+</span><span id="BigQuery.Generator-326"><a href="#BigQuery.Generator-326"><span class="linenos">326</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">unsupported</span><span class="p">(</span><span class="s2">&quot;INTERSECT without DISTINCT is not supported in BigQuery&quot;</span><span class="p">)</span>
+</span><span id="BigQuery.Generator-327"><a href="#BigQuery.Generator-327"><span class="linenos">327</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">&quot;INTERSECT</span><span class="si">{</span><span class="s1">&#39; DISTINCT&#39;</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;distinct&#39;</span><span class="p">)</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="s1">&#39; ALL&#39;</span><span class="si">}</span><span class="s2">&quot;</span>
+</span><span id="BigQuery.Generator-328"><a href="#BigQuery.Generator-328"><span class="linenos">328</span></a>
+</span><span id="BigQuery.Generator-329"><a href="#BigQuery.Generator-329"><span class="linenos">329</span></a> <span class="k">def</span> <span class="nf">with_properties</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">properties</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="BigQuery.Generator-330"><a href="#BigQuery.Generator-330"><span class="linenos">330</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">properties</span><span class="p">(</span><span class="n">properties</span><span class="p">,</span> <span class="n">prefix</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">seg</span><span class="p">(</span><span class="s2">&quot;OPTIONS&quot;</span><span class="p">))</span>
</span></pre></div>
@@ -995,12 +1043,12 @@ Default: True</li>
</div>
<a class="headerlink" href="#BigQuery.Generator.array_sql"></a>
- <div class="pdoc-code codehilite"><pre><span></span><span id="BigQuery.Generator.array_sql-286"><a href="#BigQuery.Generator.array_sql-286"><span class="linenos">286</span></a> <span class="k">def</span> <span class="nf">array_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Array</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
-</span><span id="BigQuery.Generator.array_sql-287"><a href="#BigQuery.Generator.array_sql-287"><span class="linenos">287</span></a> <span class="n">first_arg</span> <span class="o">=</span> <span class="n">seq_get</span><span class="p">(</span><span class="n">expression</span><span class="o">.</span><span class="n">expressions</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
-</span><span id="BigQuery.Generator.array_sql-288"><a href="#BigQuery.Generator.array_sql-288"><span class="linenos">288</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">first_arg</span><span class="p">,</span> <span class="n">exp</span><span class="o">.</span><span class="n">Subqueryable</span><span class="p">):</span>
-</span><span id="BigQuery.Generator.array_sql-289"><a href="#BigQuery.Generator.array_sql-289"><span class="linenos">289</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">&quot;ARRAY</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">wrap</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">first_arg</span><span class="p">))</span><span class="si">}</span><span class="s2">&quot;</span>
-</span><span id="BigQuery.Generator.array_sql-290"><a href="#BigQuery.Generator.array_sql-290"><span class="linenos">290</span></a>
-</span><span id="BigQuery.Generator.array_sql-291"><a href="#BigQuery.Generator.array_sql-291"><span class="linenos">291</span></a> <span class="k">return</span> <span class="n">inline_array_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">)</span>
+ <div class="pdoc-code codehilite"><pre><span></span><span id="BigQuery.Generator.array_sql-300"><a href="#BigQuery.Generator.array_sql-300"><span class="linenos">300</span></a> <span class="k">def</span> <span class="nf">array_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Array</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="BigQuery.Generator.array_sql-301"><a href="#BigQuery.Generator.array_sql-301"><span class="linenos">301</span></a> <span class="n">first_arg</span> <span class="o">=</span> <span class="n">seq_get</span><span class="p">(</span><span class="n">expression</span><span class="o">.</span><span class="n">expressions</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
+</span><span id="BigQuery.Generator.array_sql-302"><a href="#BigQuery.Generator.array_sql-302"><span class="linenos">302</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">first_arg</span><span class="p">,</span> <span class="n">exp</span><span class="o">.</span><span class="n">Subqueryable</span><span class="p">):</span>
+</span><span id="BigQuery.Generator.array_sql-303"><a href="#BigQuery.Generator.array_sql-303"><span class="linenos">303</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">&quot;ARRAY</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">wrap</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">first_arg</span><span class="p">))</span><span class="si">}</span><span class="s2">&quot;</span>
+</span><span id="BigQuery.Generator.array_sql-304"><a href="#BigQuery.Generator.array_sql-304"><span class="linenos">304</span></a>
+</span><span id="BigQuery.Generator.array_sql-305"><a href="#BigQuery.Generator.array_sql-305"><span class="linenos">305</span></a> <span class="k">return</span> <span class="n">inline_array_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">)</span>
</span></pre></div>
@@ -1018,8 +1066,8 @@ Default: True</li>
</div>
<a class="headerlink" href="#BigQuery.Generator.transaction_sql"></a>
- <div class="pdoc-code codehilite"><pre><span></span><span id="BigQuery.Generator.transaction_sql-293"><a href="#BigQuery.Generator.transaction_sql-293"><span class="linenos">293</span></a> <span class="k">def</span> <span class="nf">transaction_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">_</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
-</span><span id="BigQuery.Generator.transaction_sql-294"><a href="#BigQuery.Generator.transaction_sql-294"><span class="linenos">294</span></a> <span class="k">return</span> <span class="s2">&quot;BEGIN TRANSACTION&quot;</span>
+ <div class="pdoc-code codehilite"><pre><span></span><span id="BigQuery.Generator.transaction_sql-307"><a href="#BigQuery.Generator.transaction_sql-307"><span class="linenos">307</span></a> <span class="k">def</span> <span class="nf">transaction_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">_</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="BigQuery.Generator.transaction_sql-308"><a href="#BigQuery.Generator.transaction_sql-308"><span class="linenos">308</span></a> <span class="k">return</span> <span class="s2">&quot;BEGIN TRANSACTION&quot;</span>
</span></pre></div>
@@ -1037,8 +1085,8 @@ Default: True</li>
</div>
<a class="headerlink" href="#BigQuery.Generator.commit_sql"></a>
- <div class="pdoc-code codehilite"><pre><span></span><span id="BigQuery.Generator.commit_sql-296"><a href="#BigQuery.Generator.commit_sql-296"><span class="linenos">296</span></a> <span class="k">def</span> <span class="nf">commit_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">_</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
-</span><span id="BigQuery.Generator.commit_sql-297"><a href="#BigQuery.Generator.commit_sql-297"><span class="linenos">297</span></a> <span class="k">return</span> <span class="s2">&quot;COMMIT TRANSACTION&quot;</span>
+ <div class="pdoc-code codehilite"><pre><span></span><span id="BigQuery.Generator.commit_sql-310"><a href="#BigQuery.Generator.commit_sql-310"><span class="linenos">310</span></a> <span class="k">def</span> <span class="nf">commit_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">_</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="BigQuery.Generator.commit_sql-311"><a href="#BigQuery.Generator.commit_sql-311"><span class="linenos">311</span></a> <span class="k">return</span> <span class="s2">&quot;COMMIT TRANSACTION&quot;</span>
</span></pre></div>
@@ -1056,8 +1104,8 @@ Default: True</li>
</div>
<a class="headerlink" href="#BigQuery.Generator.rollback_sql"></a>
- <div class="pdoc-code codehilite"><pre><span></span><span id="BigQuery.Generator.rollback_sql-299"><a href="#BigQuery.Generator.rollback_sql-299"><span class="linenos">299</span></a> <span class="k">def</span> <span class="nf">rollback_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">_</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
-</span><span id="BigQuery.Generator.rollback_sql-300"><a href="#BigQuery.Generator.rollback_sql-300"><span class="linenos">300</span></a> <span class="k">return</span> <span class="s2">&quot;ROLLBACK TRANSACTION&quot;</span>
+ <div class="pdoc-code codehilite"><pre><span></span><span id="BigQuery.Generator.rollback_sql-313"><a href="#BigQuery.Generator.rollback_sql-313"><span class="linenos">313</span></a> <span class="k">def</span> <span class="nf">rollback_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">_</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="BigQuery.Generator.rollback_sql-314"><a href="#BigQuery.Generator.rollback_sql-314"><span class="linenos">314</span></a> <span class="k">return</span> <span class="s2">&quot;ROLLBACK TRANSACTION&quot;</span>
</span></pre></div>
@@ -1075,8 +1123,8 @@ Default: True</li>
</div>
<a class="headerlink" href="#BigQuery.Generator.in_unnest_op"></a>
- <div class="pdoc-code codehilite"><pre><span></span><span id="BigQuery.Generator.in_unnest_op-302"><a href="#BigQuery.Generator.in_unnest_op-302"><span class="linenos">302</span></a> <span class="k">def</span> <span class="nf">in_unnest_op</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Unnest</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
-</span><span id="BigQuery.Generator.in_unnest_op-303"><a href="#BigQuery.Generator.in_unnest_op-303"><span class="linenos">303</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span>
+ <div class="pdoc-code codehilite"><pre><span></span><span id="BigQuery.Generator.in_unnest_op-316"><a href="#BigQuery.Generator.in_unnest_op-316"><span class="linenos">316</span></a> <span class="k">def</span> <span class="nf">in_unnest_op</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Unnest</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="BigQuery.Generator.in_unnest_op-317"><a href="#BigQuery.Generator.in_unnest_op-317"><span class="linenos">317</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span>
</span></pre></div>
@@ -1094,10 +1142,10 @@ Default: True</li>
</div>
<a class="headerlink" href="#BigQuery.Generator.except_op"></a>
- <div class="pdoc-code codehilite"><pre><span></span><span id="BigQuery.Generator.except_op-305"><a href="#BigQuery.Generator.except_op-305"><span class="linenos">305</span></a> <span class="k">def</span> <span class="nf">except_op</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Except</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
-</span><span id="BigQuery.Generator.except_op-306"><a href="#BigQuery.Generator.except_op-306"><span class="linenos">306</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;distinct&quot;</span><span class="p">,</span> <span class="kc">False</span><span class="p">):</span>
-</span><span id="BigQuery.Generator.except_op-307"><a href="#BigQuery.Generator.except_op-307"><span class="linenos">307</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">unsupported</span><span class="p">(</span><span class="s2">&quot;EXCEPT without DISTINCT is not supported in BigQuery&quot;</span><span class="p">)</span>
-</span><span id="BigQuery.Generator.except_op-308"><a href="#BigQuery.Generator.except_op-308"><span class="linenos">308</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">&quot;EXCEPT</span><span class="si">{</span><span class="s1">&#39; DISTINCT&#39;</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;distinct&#39;</span><span class="p">)</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="s1">&#39; ALL&#39;</span><span class="si">}</span><span class="s2">&quot;</span>
+ <div class="pdoc-code codehilite"><pre><span></span><span id="BigQuery.Generator.except_op-319"><a href="#BigQuery.Generator.except_op-319"><span class="linenos">319</span></a> <span class="k">def</span> <span class="nf">except_op</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Except</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="BigQuery.Generator.except_op-320"><a href="#BigQuery.Generator.except_op-320"><span class="linenos">320</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;distinct&quot;</span><span class="p">,</span> <span class="kc">False</span><span class="p">):</span>
+</span><span id="BigQuery.Generator.except_op-321"><a href="#BigQuery.Generator.except_op-321"><span class="linenos">321</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">unsupported</span><span class="p">(</span><span class="s2">&quot;EXCEPT without DISTINCT is not supported in BigQuery&quot;</span><span class="p">)</span>
+</span><span id="BigQuery.Generator.except_op-322"><a href="#BigQuery.Generator.except_op-322"><span class="linenos">322</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">&quot;EXCEPT</span><span class="si">{</span><span class="s1">&#39; DISTINCT&#39;</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;distinct&#39;</span><span class="p">)</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="s1">&#39; ALL&#39;</span><span class="si">}</span><span class="s2">&quot;</span>
</span></pre></div>
@@ -1115,10 +1163,29 @@ Default: True</li>
</div>
<a class="headerlink" href="#BigQuery.Generator.intersect_op"></a>
- <div class="pdoc-code codehilite"><pre><span></span><span id="BigQuery.Generator.intersect_op-310"><a href="#BigQuery.Generator.intersect_op-310"><span class="linenos">310</span></a> <span class="k">def</span> <span class="nf">intersect_op</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Intersect</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
-</span><span id="BigQuery.Generator.intersect_op-311"><a href="#BigQuery.Generator.intersect_op-311"><span class="linenos">311</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;distinct&quot;</span><span class="p">,</span> <span class="kc">False</span><span class="p">):</span>
-</span><span id="BigQuery.Generator.intersect_op-312"><a href="#BigQuery.Generator.intersect_op-312"><span class="linenos">312</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">unsupported</span><span class="p">(</span><span class="s2">&quot;INTERSECT without DISTINCT is not supported in BigQuery&quot;</span><span class="p">)</span>
-</span><span id="BigQuery.Generator.intersect_op-313"><a href="#BigQuery.Generator.intersect_op-313"><span class="linenos">313</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">&quot;INTERSECT</span><span class="si">{</span><span class="s1">&#39; DISTINCT&#39;</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;distinct&#39;</span><span class="p">)</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="s1">&#39; ALL&#39;</span><span class="si">}</span><span class="s2">&quot;</span>
+ <div class="pdoc-code codehilite"><pre><span></span><span id="BigQuery.Generator.intersect_op-324"><a href="#BigQuery.Generator.intersect_op-324"><span class="linenos">324</span></a> <span class="k">def</span> <span class="nf">intersect_op</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Intersect</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="BigQuery.Generator.intersect_op-325"><a href="#BigQuery.Generator.intersect_op-325"><span class="linenos">325</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;distinct&quot;</span><span class="p">,</span> <span class="kc">False</span><span class="p">):</span>
+</span><span id="BigQuery.Generator.intersect_op-326"><a href="#BigQuery.Generator.intersect_op-326"><span class="linenos">326</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">unsupported</span><span class="p">(</span><span class="s2">&quot;INTERSECT without DISTINCT is not supported in BigQuery&quot;</span><span class="p">)</span>
+</span><span id="BigQuery.Generator.intersect_op-327"><a href="#BigQuery.Generator.intersect_op-327"><span class="linenos">327</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">&quot;INTERSECT</span><span class="si">{</span><span class="s1">&#39; DISTINCT&#39;</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;distinct&#39;</span><span class="p">)</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="s1">&#39; ALL&#39;</span><span class="si">}</span><span class="s2">&quot;</span>
+</span></pre></div>
+
+
+
+
+ </div>
+ <div id="BigQuery.Generator.with_properties" class="classattr">
+ <input id="BigQuery.Generator.with_properties-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">
+<div class="attr function">
+
+ <span class="def">def</span>
+ <span class="name">with_properties</span><span class="signature pdoc-code condensed">(<span class="param"><span class="bp">self</span>, </span><span class="param"><span class="n">properties</span><span class="p">:</span> <span class="n"><a href="../expressions.html#Properties">sqlglot.expressions.Properties</a></span></span><span class="return-annotation">) -> <span class="nb">str</span>:</span></span>
+
+ <label class="view-source-button" for="BigQuery.Generator.with_properties-view-source"><span>View Source</span></label>
+
+ </div>
+ <a class="headerlink" href="#BigQuery.Generator.with_properties"></a>
+ <div class="pdoc-code codehilite"><pre><span></span><span id="BigQuery.Generator.with_properties-329"><a href="#BigQuery.Generator.with_properties-329"><span class="linenos">329</span></a> <span class="k">def</span> <span class="nf">with_properties</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">properties</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
+</span><span id="BigQuery.Generator.with_properties-330"><a href="#BigQuery.Generator.with_properties-330"><span class="linenos">330</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">properties</span><span class="p">(</span><span class="n">properties</span><span class="p">,</span> <span class="n">prefix</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">seg</span><span class="p">(</span><span class="s2">&quot;OPTIONS&quot;</span><span class="p">))</span>
</span></pre></div>
@@ -1179,7 +1246,6 @@ Default: True</li>
<dd id="BigQuery.Generator.properties_sql" class="function"><a href="../generator.html#Generator.properties_sql">properties_sql</a></dd>
<dd id="BigQuery.Generator.root_properties" class="function"><a href="../generator.html#Generator.root_properties">root_properties</a></dd>
<dd id="BigQuery.Generator.properties" class="function"><a href="../generator.html#Generator.properties">properties</a></dd>
- <dd id="BigQuery.Generator.with_properties" class="function"><a href="../generator.html#Generator.with_properties">with_properties</a></dd>
<dd id="BigQuery.Generator.locate_properties" class="function"><a href="../generator.html#Generator.locate_properties">locate_properties</a></dd>
<dd id="BigQuery.Generator.property_sql" class="function"><a href="../generator.html#Generator.property_sql">property_sql</a></dd>
<dd id="BigQuery.Generator.likeproperty_sql" class="function"><a href="../generator.html#Generator.likeproperty_sql">likeproperty_sql</a></dd>
@@ -1247,7 +1313,7 @@ Default: True</li>
<dd id="BigQuery.Generator.where_sql" class="function"><a href="../generator.html#Generator.where_sql">where_sql</a></dd>
<dd id="BigQuery.Generator.window_sql" class="function"><a href="../generator.html#Generator.window_sql">window_sql</a></dd>
<dd id="BigQuery.Generator.partition_by_sql" class="function"><a href="../generator.html#Generator.partition_by_sql">partition_by_sql</a></dd>
- <dd id="BigQuery.Generator.window_spec_sql" class="function"><a href="../generator.html#Generator.window_spec_sql">window_spec_sql</a></dd>
+ <dd id="BigQuery.Generator.windowspec_sql" class="function"><a href="../generator.html#Generator.windowspec_sql">windowspec_sql</a></dd>
<dd id="BigQuery.Generator.withingroup_sql" class="function"><a href="../generator.html#Generator.withingroup_sql">withingroup_sql</a></dd>
<dd id="BigQuery.Generator.between_sql" class="function"><a href="../generator.html#Generator.between_sql">between_sql</a></dd>
<dd id="BigQuery.Generator.bracket_sql" class="function"><a href="../generator.html#Generator.bracket_sql">bracket_sql</a></dd>
@@ -1256,6 +1322,7 @@ Default: True</li>
<dd id="BigQuery.Generator.exists_sql" class="function"><a href="../generator.html#Generator.exists_sql">exists_sql</a></dd>
<dd id="BigQuery.Generator.case_sql" class="function"><a href="../generator.html#Generator.case_sql">case_sql</a></dd>
<dd id="BigQuery.Generator.constraint_sql" class="function"><a href="../generator.html#Generator.constraint_sql">constraint_sql</a></dd>
+ <dd id="BigQuery.Generator.nextvaluefor_sql" class="function"><a href="../generator.html#Generator.nextvaluefor_sql">nextvaluefor_sql</a></dd>
<dd id="BigQuery.Generator.extract_sql" class="function"><a href="../generator.html#Generator.extract_sql">extract_sql</a></dd>
<dd id="BigQuery.Generator.trim_sql" class="function"><a href="../generator.html#Generator.trim_sql">trim_sql</a></dd>
<dd id="BigQuery.Generator.concat_sql" class="function"><a href="../generator.html#Generator.concat_sql">concat_sql</a></dd>