You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by jr...@apache.org on 2017/05/30 19:11:45 UTC

incubator-impala git commit: IMPALA-4730: [DOCS] DISTINCT is allowed with group_concat()

Repository: incubator-impala
Updated Branches:
  refs/heads/master f15589573 -> 45e2329c9


IMPALA-4730: [DOCS] DISTINCT is allowed with group_concat()

Remove the "DISTINCT not allowed" restriction.

Add DISTINCT to syntax.

Add an example showing usage of DISTINCT.

Change-Id: Ib7d4555a5bc4c4195fa1529d1c1bdf39f98e7346
Reviewed-on: http://gerrit.cloudera.org:8080/7016
Reviewed-by: Alex Behm <al...@cloudera.com>
Tested-by: Impala Public Jenkins


Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/45e2329c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/45e2329c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/45e2329c

Branch: refs/heads/master
Commit: 45e2329c92c2e3e31c6940e52bedfa20f48c8fd7
Parents: f155895
Author: John Russell <jr...@cloudera.com>
Authored: Tue May 30 11:33:43 2017 -0700
Committer: Impala Public Jenkins <im...@gerrit.cloudera.org>
Committed: Tue May 30 19:01:20 2017 +0000

----------------------------------------------------------------------
 docs/topics/impala_group_concat.xml | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/45e2329c/docs/topics/impala_group_concat.xml
----------------------------------------------------------------------
diff --git a/docs/topics/impala_group_concat.xml b/docs/topics/impala_group_concat.xml
index ffa4084..476d7dc 100644
--- a/docs/topics/impala_group_concat.xml
+++ b/docs/topics/impala_group_concat.xml
@@ -45,9 +45,7 @@ under the License.
 
     <p conref="../shared/impala_common.xml#common/syntax_blurb"/>
 
-<!-- Might allow DISTINCT at some point. Check: does it allow ALL now? -->
-
-<codeblock>GROUP_CONCAT([ALL] <varname>expression</varname> [, <varname>separator</varname>])</codeblock>
+<codeblock>GROUP_CONCAT([ALL<ph rev="IMPALA-4730"> | DISTINCT</ph>] <varname>expression</varname> [, <varname>separator</varname>])</codeblock>
 
     <p conref="../shared/impala_common.xml#common/concat_blurb"/>
 
@@ -61,12 +59,6 @@ under the License.
       <b>Return type:</b> <codeph>STRING</codeph>
     </p>
 
-    <p conref="../shared/impala_common.xml#common/restrictions_blurb"/>
-
-    <p>
-      You cannot apply the <codeph>DISTINCT</codeph> operator to the argument of this function.
-    </p>
-
     <p conref="../shared/impala_common.xml#common/analytic_not_allowed_caveat"/>
 
     <p>
@@ -100,6 +92,20 @@ under the License.
 +---------------------------------+
 </codeblock>
 
+    <p rev="IMPALA-4730">
+      Specify the <codeph>DISTINCT</codeph> keyword to eliminate duplicate values from
+      the concatenated result:
+    </p>
+
+<codeblock rev="IMPALA-4730">
+[localhost:21000] &gt; select group_concat(distinct s) from t1;
++--------------------------+
+| group_concat(distinct s) |
++--------------------------+
+| three, two, one          |
++--------------------------+
+</codeblock>
+
     <p>
       The optional separator lets you format the result in flexible ways. The separator can be an arbitrary string
       expression, not just a single character.