mirror of
https://github.com/apache/impala.git
synced 2025-12-19 09:58:28 -05:00
IMPALA-8548: [DOCS] Impala supports ordinal substitutions in SELECT
Change-Id: Ia48a4a6711ffcf326f3f51200040420101451967 Reviewed-on: http://gerrit.cloudera.org:8080/14209 Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com> Reviewed-by: Zoltan Borok-Nagy <boroknagyz@cloudera.com>
This commit is contained in:
@@ -1098,12 +1098,13 @@ select concat('abc','mno','xyz');</codeblock>
|
||||
</codeblock>
|
||||
</p>
|
||||
|
||||
<p id="column_ordinals" rev="IMPALA-6415 IMPALA-5191">
|
||||
You can also refer to <codeph>SELECT</codeph>-list items by their ordinal position.
|
||||
Impala supports ordinals in the <codeph>GROUP BY</codeph>, <codeph>HAVING</codeph>, and
|
||||
<codeph>ORDER BY</codeph> clauses. From Impala 3.0, ordinals can only be used at the top
|
||||
level. For example, the following statements are allowed:
|
||||
<codeblock>
|
||||
<p id="column_ordinals" rev="IMPALA-6415 IMPALA-5191"> You can refer to
|
||||
<codeph>SELECT</codeph>-list items by their ordinal position. Impala
|
||||
supports ordinals in the <codeph>GROUP BY</codeph>,
|
||||
<codeph>HAVING</codeph>, and <codeph>ORDER BY</codeph> clauses. From
|
||||
Impala 3.0, ordinals can only be used at the top level. For example, the
|
||||
following statements are allowed:
|
||||
<codeblock>
|
||||
SELECT int_col / 2, sum(x)
|
||||
FROM t
|
||||
GROUP BY 1;
|
||||
@@ -1118,7 +1119,7 @@ select concat('abc','mno','xyz');</codeblock>
|
||||
HAVING 1;
|
||||
</codeblock>
|
||||
Numbers in subexpressions are not interpreted as ordinals:
|
||||
<codeblock>
|
||||
<codeblock>
|
||||
SELECT int_col / 2, sum(x)
|
||||
FROM t
|
||||
GROUP BY 1 * 2;
|
||||
|
||||
@@ -124,6 +124,9 @@ table_reference := { <varname>table_name</varname> | (<varname>subquery</varname
|
||||
restriction is lifted; sort operations that would exceed the Impala memory limit automatically use a
|
||||
temporary disk work area to perform the sort.
|
||||
</li>
|
||||
<li>
|
||||
<p conref="../shared/impala_common.xml#common/column_ordinals"/>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<p conref="../shared/impala_common.xml#common/join_types"/>
|
||||
@@ -210,18 +213,4 @@ table_reference := { <varname>table_name</varname> | (<varname>subquery</varname
|
||||
details.
|
||||
</p>
|
||||
</conbody>
|
||||
|
||||
<concept id="where" audience="hidden">
|
||||
|
||||
<!-- WHERE hidden for the moment until there's the chance to add some reasonably comprehensive content
|
||||
|
||||
and make it its own file. -->
|
||||
|
||||
<title>WHERE Clause</title>
|
||||
|
||||
<conbody>
|
||||
|
||||
<p/>
|
||||
</conbody>
|
||||
</concept>
|
||||
</concept>
|
||||
|
||||
Reference in New Issue
Block a user