Return-Path: X-Original-To: apmail-phoenix-commits-archive@minotaur.apache.org Delivered-To: apmail-phoenix-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1889B10655 for ; Thu, 9 Jan 2014 21:51:41 +0000 (UTC) Received: (qmail 35922 invoked by uid 500); 9 Jan 2014 21:51:41 -0000 Delivered-To: apmail-phoenix-commits-archive@phoenix.apache.org Received: (qmail 35894 invoked by uid 500); 9 Jan 2014 21:51:41 -0000 Mailing-List: contact commits-help@phoenix.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.incubator.apache.org Delivered-To: mailing list commits@phoenix.incubator.apache.org Received: (qmail 35887 invoked by uid 99); 9 Jan 2014 21:51:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Jan 2014 21:51:40 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Jan 2014 21:51:28 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id CF3242388A5B; Thu, 9 Jan 2014 21:51:05 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1556962 [3/3] - /incubator/phoenix/site/publish/ Date: Thu, 09 Jan 2014 21:51:04 -0000 To: commits@phoenix.incubator.apache.org From: mujtaba@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140109215105.CF3242388A5B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: incubator/phoenix/site/publish/download.html URL: http://svn.apache.org/viewvc/incubator/phoenix/site/publish/download.html?rev=1556962&r1=1556961&r2=1556962&view=diff ============================================================================== --- incubator/phoenix/site/publish/download.html (original) +++ incubator/phoenix/site/publish/download.html Thu Jan 9 21:51:03 2014 @@ -1,7 +1,7 @@ @@ -74,6 +74,7 @@
  • Phoenix on EMR
  • Bulk CSV via M/R
  • Apache Flume Plugin
  • +
  • Sequences
  • Apache Flume Plugin
  • +
  • + Sequences +
  • @@ -281,7 +285,7 @@

    Back to top

    -

    Version: 2.2.2. Last Published: 2014-01-08.

    +

    Version: 2.2.2. Last Published: 2014-01-09.

    Modified: incubator/phoenix/site/publish/dynamic_columns.html URL: http://svn.apache.org/viewvc/incubator/phoenix/site/publish/dynamic_columns.html?rev=1556962&r1=1556961&r2=1556962&view=diff ============================================================================== --- incubator/phoenix/site/publish/dynamic_columns.html (original) +++ incubator/phoenix/site/publish/dynamic_columns.html Thu Jan 9 21:51:03 2014 @@ -1,7 +1,7 @@ @@ -74,6 +74,7 @@
  • Phoenix on EMR
  • Bulk CSV via M/R
  • Apache Flume Plugin
  • +
  • Sequences
  • Apache Flume Plugin
  • +
  • + Sequences +
  • @@ -231,7 +235,7 @@ WHERE eventType = 'OOM' AND lastGCTime &

    Back to top

    -

    Version: 2.2.2. Last Published: 2014-01-08.

    +

    Version: 2.2.2. Last Published: 2014-01-09.

    Modified: incubator/phoenix/site/publish/faq.html URL: http://svn.apache.org/viewvc/incubator/phoenix/site/publish/faq.html?rev=1556962&r1=1556961&r2=1556962&view=diff ============================================================================== --- incubator/phoenix/site/publish/faq.html (original) +++ incubator/phoenix/site/publish/faq.html Thu Jan 9 21:51:03 2014 @@ -1,7 +1,7 @@ @@ -74,6 +74,7 @@
  • Phoenix on EMR
  • Bulk CSV via M/R
  • Apache Flume Plugin
  • +
  • Sequences
  • Phoenix on EMR
  • Bulk CSV via M/R
  • Apache Flume Plugin
  • +
  • Sequences
  • Apache Flume Plugin
  • +
  • + Sequences +
  • @@ -315,7 +319,7 @@

    Back to top

    -

    Version: 2.2.2. Last Published: 2014-01-08.

    +

    Version: 2.2.2. Last Published: 2014-01-09.

    Modified: incubator/phoenix/site/publish/functions.html URL: http://svn.apache.org/viewvc/incubator/phoenix/site/publish/functions.html?rev=1556962&r1=1556961&r2=1556962&view=diff ============================================================================== --- incubator/phoenix/site/publish/functions.html (original) +++ incubator/phoenix/site/publish/functions.html Thu Jan 9 21:51:03 2014 @@ -74,6 +74,7 @@
  • Phoenix on EMR
  • Bulk CSV via M/R
  • Apache Flume Plugin
  • +
  • Sequences
  • Apache Flume Plugin
  • +
  • + Sequences +
  • Modified: incubator/phoenix/site/publish/grammar.html URL: http://svn.apache.org/viewvc/incubator/phoenix/site/publish/grammar.html?rev=1556962&r1=1556961&r2=1556962&view=diff ============================================================================== --- incubator/phoenix/site/publish/grammar.html (original) +++ incubator/phoenix/site/publish/grammar.html Thu Jan 9 21:51:03 2014 @@ -74,6 +74,7 @@
  • Phoenix on EMR
  • Bulk CSV via M/R
  • Apache Flume Plugin
  • +
  • Sequences
  • Apache Flume Plugin
  • +
  • + Sequences +
  • Modified: incubator/phoenix/site/publish/index.html URL: http://svn.apache.org/viewvc/incubator/phoenix/site/publish/index.html?rev=1556962&r1=1556961&r2=1556962&view=diff ============================================================================== --- incubator/phoenix/site/publish/index.html (original) +++ incubator/phoenix/site/publish/index.html Thu Jan 9 21:51:03 2014 @@ -1,7 +1,7 @@ @@ -74,6 +74,7 @@
  • Phoenix on EMR
  • Bulk CSV via M/R
  • Apache Flume Plugin
  • +
  • Sequences
  • Apache Flume Plugin
  • +
  • + Sequences +
  • @@ -285,7 +289,7 @@

    Back to top

    -

    Version: 2.2.2. Last Published: 2014-01-08.

    +

    Version: 2.2.2. Last Published: 2014-01-09.

    Modified: incubator/phoenix/site/publish/integration.html URL: http://svn.apache.org/viewvc/incubator/phoenix/site/publish/integration.html?rev=1556962&r1=1556961&r2=1556962&view=diff ============================================================================== --- incubator/phoenix/site/publish/integration.html (original) +++ incubator/phoenix/site/publish/integration.html Thu Jan 9 21:51:03 2014 @@ -1,7 +1,7 @@ @@ -74,6 +74,7 @@
  • Phoenix on EMR
  • Bulk CSV via M/R
  • Apache Flume Plugin
  • +
  • Sequences
  • Apache Flume Plugin
  • +
  • + Sequences +
  • @@ -217,7 +221,7 @@

    Back to top

    -

    Version: 2.2.2. Last Published: 2014-01-08.

    +

    Version: 2.2.2. Last Published: 2014-01-09.

    Modified: incubator/phoenix/site/publish/issue-tracking.html URL: http://svn.apache.org/viewvc/incubator/phoenix/site/publish/issue-tracking.html?rev=1556962&r1=1556961&r2=1556962&view=diff ============================================================================== --- incubator/phoenix/site/publish/issue-tracking.html (original) +++ incubator/phoenix/site/publish/issue-tracking.html Thu Jan 9 21:51:03 2014 @@ -1,7 +1,7 @@ @@ -74,6 +74,7 @@
  • Phoenix on EMR
  • Bulk CSV via M/R
  • Apache Flume Plugin
  • +
  • Sequences
  • Apache Flume Plugin
  • +
  • + Sequences +
  • @@ -217,7 +221,7 @@

    Back to top

    -

    Version: 2.2.2. Last Published: 2014-01-08.

    +

    Version: 2.2.2. Last Published: 2014-01-09.

    Modified: incubator/phoenix/site/publish/issues.html URL: http://svn.apache.org/viewvc/incubator/phoenix/site/publish/issues.html?rev=1556962&r1=1556961&r2=1556962&view=diff ============================================================================== --- incubator/phoenix/site/publish/issues.html (original) +++ incubator/phoenix/site/publish/issues.html Thu Jan 9 21:51:03 2014 @@ -1,7 +1,7 @@ @@ -74,6 +74,7 @@
  • Phoenix on EMR
  • Bulk CSV via M/R
  • Apache Flume Plugin
  • +
  • Sequences
  • Apache Flume Plugin
  • +
  • + Sequences +
  • @@ -218,7 +222,7 @@

    Back to top

    -

    Version: 2.2.2. Last Published: 2014-01-08.

    +

    Version: 2.2.2. Last Published: 2014-01-09.

    Modified: incubator/phoenix/site/publish/license.html URL: http://svn.apache.org/viewvc/incubator/phoenix/site/publish/license.html?rev=1556962&r1=1556961&r2=1556962&view=diff ============================================================================== --- incubator/phoenix/site/publish/license.html (original) +++ incubator/phoenix/site/publish/license.html Thu Jan 9 21:51:03 2014 @@ -1,7 +1,7 @@ @@ -74,6 +74,7 @@
  • Phoenix on EMR
  • Bulk CSV via M/R
  • Apache Flume Plugin
  • +
  • Sequences
  • Apache Flume Plugin
  • +
  • + Sequences +
  • @@ -428,7 +432,7 @@

    Back to top

    -

    Version: 2.2.2. Last Published: 2014-01-08.

    +

    Version: 2.2.2. Last Published: 2014-01-09.

    Modified: incubator/phoenix/site/publish/mail-lists.html URL: http://svn.apache.org/viewvc/incubator/phoenix/site/publish/mail-lists.html?rev=1556962&r1=1556961&r2=1556962&view=diff ============================================================================== --- incubator/phoenix/site/publish/mail-lists.html (original) +++ incubator/phoenix/site/publish/mail-lists.html Thu Jan 9 21:51:03 2014 @@ -1,7 +1,7 @@ @@ -74,6 +74,7 @@
  • Phoenix on EMR
  • Bulk CSV via M/R
  • Apache Flume Plugin
  • +
  • Sequences
  • Apache Flume Plugin
  • +
  • + Sequences +
  • @@ -217,7 +221,7 @@

    Back to top

    -

    Version: 2.2.2. Last Published: 2014-01-08.

    +

    Version: 2.2.2. Last Published: 2014-01-09.

    Modified: incubator/phoenix/site/publish/mailing_list.html URL: http://svn.apache.org/viewvc/incubator/phoenix/site/publish/mailing_list.html?rev=1556962&r1=1556961&r2=1556962&view=diff ============================================================================== --- incubator/phoenix/site/publish/mailing_list.html (original) +++ incubator/phoenix/site/publish/mailing_list.html Thu Jan 9 21:51:03 2014 @@ -1,7 +1,7 @@ @@ -74,6 +74,7 @@
  • Phoenix on EMR
  • Bulk CSV via M/R
  • Apache Flume Plugin
  • +
  • Sequences
  • Apache Flume Plugin
  • +
  • + Sequences +
  • @@ -253,7 +257,7 @@

    Back to top

    -

    Version: 2.2.2. Last Published: 2014-01-08.

    +

    Version: 2.2.2. Last Published: 2014-01-09.

    Modified: incubator/phoenix/site/publish/mr_dataload.html URL: http://svn.apache.org/viewvc/incubator/phoenix/site/publish/mr_dataload.html?rev=1556962&r1=1556961&r2=1556962&view=diff ============================================================================== --- incubator/phoenix/site/publish/mr_dataload.html (original) +++ incubator/phoenix/site/publish/mr_dataload.html Thu Jan 9 21:51:03 2014 @@ -1,7 +1,7 @@ @@ -74,6 +74,7 @@
  • Phoenix on EMR
  • Bulk CSV via M/R
  • Apache Flume Plugin
  • +
  • Sequences
  • Apache Flume Plugin
  • +
  • + Sequences +
  • @@ -301,7 +305,7 @@

    Back to top

    -

    Version: 2.2.2. Last Published: 2014-01-08.

    +

    Version: 2.2.2. Last Published: 2014-01-09.

    Modified: incubator/phoenix/site/publish/paged.html URL: http://svn.apache.org/viewvc/incubator/phoenix/site/publish/paged.html?rev=1556962&r1=1556961&r2=1556962&view=diff ============================================================================== --- incubator/phoenix/site/publish/paged.html (original) +++ incubator/phoenix/site/publish/paged.html Thu Jan 9 21:51:03 2014 @@ -1,7 +1,7 @@ @@ -74,6 +74,7 @@
  • Phoenix on EMR
  • Bulk CSV via M/R
  • Apache Flume Plugin
  • +
  • Sequences
  • Apache Flume Plugin
  • +
  • + Sequences +
  • @@ -250,7 +254,7 @@ LIMIT 20

    Back to top

    -

    Version: 2.2.2. Last Published: 2014-01-08.

    +

    Version: 2.2.2. Last Published: 2014-01-09.

    Modified: incubator/phoenix/site/publish/performance.html URL: http://svn.apache.org/viewvc/incubator/phoenix/site/publish/performance.html?rev=1556962&r1=1556961&r2=1556962&view=diff ============================================================================== --- incubator/phoenix/site/publish/performance.html (original) +++ incubator/phoenix/site/publish/performance.html Thu Jan 9 21:51:03 2014 @@ -1,7 +1,7 @@ @@ -74,6 +74,7 @@
  • Phoenix on EMR
  • Bulk CSV via M/R
  • Apache Flume Plugin
  • +
  • Sequences
  • Apache Flume Plugin
  • +
  • + Sequences +
  • @@ -271,7 +275,7 @@

    Back to top

    -

    Version: 2.2.2. Last Published: 2014-01-08.

    +

    Version: 2.2.2. Last Published: 2014-01-09.

    Modified: incubator/phoenix/site/publish/phoenix_on_emr.html URL: http://svn.apache.org/viewvc/incubator/phoenix/site/publish/phoenix_on_emr.html?rev=1556962&r1=1556961&r2=1556962&view=diff ============================================================================== --- incubator/phoenix/site/publish/phoenix_on_emr.html (original) +++ incubator/phoenix/site/publish/phoenix_on_emr.html Thu Jan 9 21:51:03 2014 @@ -1,7 +1,7 @@ @@ -74,6 +74,7 @@
  • Phoenix on EMR
  • Bulk CSV via M/R
  • Apache Flume Plugin
  • +
  • Sequences
  • Apache Flume Plugin
  • +
  • + Sequences +
  • @@ -254,7 +258,7 @@

    Back to top

    -

    Version: 2.2.2. Last Published: 2014-01-08.

    +

    Version: 2.2.2. Last Published: 2014-01-09.

    Modified: incubator/phoenix/site/publish/plugin-management.html URL: http://svn.apache.org/viewvc/incubator/phoenix/site/publish/plugin-management.html?rev=1556962&r1=1556961&r2=1556962&view=diff ============================================================================== --- incubator/phoenix/site/publish/plugin-management.html (original) +++ incubator/phoenix/site/publish/plugin-management.html Thu Jan 9 21:51:03 2014 @@ -1,7 +1,7 @@ @@ -74,6 +74,7 @@
  • Phoenix on EMR
  • Bulk CSV via M/R
  • Apache Flume Plugin
  • +
  • Sequences
  • Apache Flume Plugin
  • +
  • + Sequences +
  • @@ -327,7 +331,7 @@

    Back to top

    -

    Version: 2.2.2. Last Published: 2014-01-08.

    +

    Version: 2.2.2. Last Published: 2014-01-09.

    Modified: incubator/phoenix/site/publish/plugins.html URL: http://svn.apache.org/viewvc/incubator/phoenix/site/publish/plugins.html?rev=1556962&r1=1556961&r2=1556962&view=diff ============================================================================== --- incubator/phoenix/site/publish/plugins.html (original) +++ incubator/phoenix/site/publish/plugins.html Thu Jan 9 21:51:03 2014 @@ -1,7 +1,7 @@ @@ -74,6 +74,7 @@
  • Phoenix on EMR
  • Bulk CSV via M/R
  • Apache Flume Plugin
  • +
  • Sequences
  • Apache Flume Plugin
  • +
  • + Sequences +
  • @@ -276,7 +280,7 @@

    Back to top

    -

    Version: 2.2.2. Last Published: 2014-01-08.

    +

    Version: 2.2.2. Last Published: 2014-01-09.

    Modified: incubator/phoenix/site/publish/project-info.html URL: http://svn.apache.org/viewvc/incubator/phoenix/site/publish/project-info.html?rev=1556962&r1=1556961&r2=1556962&view=diff ============================================================================== --- incubator/phoenix/site/publish/project-info.html (original) +++ incubator/phoenix/site/publish/project-info.html Thu Jan 9 21:51:03 2014 @@ -1,7 +1,7 @@ @@ -74,6 +74,7 @@
  • Phoenix on EMR
  • Bulk CSV via M/R
  • Apache Flume Plugin
  • +
  • Sequences
  • Apache Flume Plugin
  • +
  • + Sequences +
  • @@ -274,7 +278,7 @@

    Back to top

    -

    Version: 2.2.2. Last Published: 2014-01-08.

    +

    Version: 2.2.2. Last Published: 2014-01-09.

    Modified: incubator/phoenix/site/publish/project-summary.html URL: http://svn.apache.org/viewvc/incubator/phoenix/site/publish/project-summary.html?rev=1556962&r1=1556961&r2=1556962&view=diff ============================================================================== --- incubator/phoenix/site/publish/project-summary.html (original) +++ incubator/phoenix/site/publish/project-summary.html Thu Jan 9 21:51:03 2014 @@ -1,7 +1,7 @@ @@ -74,6 +74,7 @@
  • Phoenix on EMR
  • Bulk CSV via M/R
  • Apache Flume Plugin
  • +
  • Sequences
  • Apache Flume Plugin
  • +
  • + Sequences +
  • @@ -291,7 +295,7 @@

    Back to top

    -

    Version: 2.2.2. Last Published: 2014-01-08.

    +

    Version: 2.2.2. Last Published: 2014-01-09.

    Modified: incubator/phoenix/site/publish/recent.html URL: http://svn.apache.org/viewvc/incubator/phoenix/site/publish/recent.html?rev=1556962&r1=1556961&r2=1556962&view=diff ============================================================================== --- incubator/phoenix/site/publish/recent.html (original) +++ incubator/phoenix/site/publish/recent.html Thu Jan 9 21:51:03 2014 @@ -1,7 +1,7 @@ @@ -74,6 +74,7 @@
  • Phoenix on EMR
  • Bulk CSV via M/R
  • Apache Flume Plugin
  • +
  • Sequences
  • Apache Flume Plugin
  • +
  • + Sequences +
  • @@ -230,7 +234,7 @@

    Back to top

    -

    Version: 2.2.2. Last Published: 2014-01-08.

    +

    Version: 2.2.2. Last Published: 2014-01-09.

    Modified: incubator/phoenix/site/publish/roadmap.html URL: http://svn.apache.org/viewvc/incubator/phoenix/site/publish/roadmap.html?rev=1556962&r1=1556961&r2=1556962&view=diff ============================================================================== --- incubator/phoenix/site/publish/roadmap.html (original) +++ incubator/phoenix/site/publish/roadmap.html Thu Jan 9 21:51:03 2014 @@ -1,7 +1,7 @@ @@ -74,6 +74,7 @@
  • Phoenix on EMR
  • Bulk CSV via M/R
  • Apache Flume Plugin
  • +
  • Sequences
  • Apache Flume Plugin
  • +
  • + Sequences +
  • @@ -269,7 +273,7 @@

    Back to top

    -

    Version: 2.2.2. Last Published: 2014-01-08.

    +

    Version: 2.2.2. Last Published: 2014-01-09.

    Modified: incubator/phoenix/site/publish/salted.html URL: http://svn.apache.org/viewvc/incubator/phoenix/site/publish/salted.html?rev=1556962&r1=1556961&r2=1556962&view=diff ============================================================================== --- incubator/phoenix/site/publish/salted.html (original) +++ incubator/phoenix/site/publish/salted.html Thu Jan 9 21:51:03 2014 @@ -1,7 +1,7 @@ @@ -74,6 +74,7 @@
  • Phoenix on EMR
  • Bulk CSV via M/R
  • Apache Flume Plugin
  • +
  • Sequences
  • Apache Flume Plugin
  • +
  • + Sequences +
  • @@ -238,7 +242,7 @@

    Back to top

    -

    Version: 2.2.2. Last Published: 2014-01-08.

    +

    Version: 2.2.2. Last Published: 2014-01-09.

    Modified: incubator/phoenix/site/publish/secondary_indexing.html URL: http://svn.apache.org/viewvc/incubator/phoenix/site/publish/secondary_indexing.html?rev=1556962&r1=1556961&r2=1556962&view=diff ============================================================================== --- incubator/phoenix/site/publish/secondary_indexing.html (original) +++ incubator/phoenix/site/publish/secondary_indexing.html Thu Jan 9 21:51:03 2014 @@ -1,7 +1,7 @@ @@ -74,6 +74,7 @@
  • Phoenix on EMR
  • Bulk CSV via M/R
  • Apache Flume Plugin
  • +
  • Sequences
  • Apache Flume Plugin
  • +
  • + Sequences +
  • @@ -362,7 +366,7 @@

    Back to top

    -

    Version: 2.2.2. Last Published: 2014-01-08.

    +

    Version: 2.2.2. Last Published: 2014-01-09.

    Added: incubator/phoenix/site/publish/sequences.html URL: http://svn.apache.org/viewvc/incubator/phoenix/site/publish/sequences.html?rev=1556962&view=auto ============================================================================== --- incubator/phoenix/site/publish/sequences.html (added) +++ incubator/phoenix/site/publish/sequences.html Thu Jan 9 21:51:03 2014 @@ -0,0 +1,298 @@ + + + + + + + + Sequences | Apache Phoenix + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
    +
    +
    +
    + +

    Sequences are a standard SQL feature that allow for generating monotonically increasing numbers typically used to form an ID. To create a sequence, use the following command:

    +
    +
    CREATE SEQUENCE my_schema.my_sequence;
    +
    +
    +

    This will start the sequence from 1, increment by 1 each time, and cache on your session the default number of sequence values based on the phoenix.sequence.cacheSize config parameter. The specification of a sequence schema is optional. Caching sequence values on your session improves performance, as we dont need to ask the server for more sequence values until we run out of cached values. The tradeoff is that you may end up with gaps in your sequence values when other sessions also use the same sequence.

    +

    All of these parameters can be overridden when the sequence is created like this:

    +
    +
    CREATE SEQUENCE my_schema.my_sequence START WITH 100 INCREMENT BY 2 CACHE 50;
    +
    +
    +

    Sequences are incremented using the NEXT VALUE FOR <sequence_name> expression in an UPSERT VALUES, UPSERT SELECT, or SELECT statement as shown below:

    +
    +
    UPSERT VALUES INTO my_table(id, col1, col2) 
    +VALUES( NEXT VALUE FOR my_schema.my_sequence, 'foo', 'bar');
    +
    +
    +

    This will allocate a BIGINT based on the next value from the sequence (beginning with the START WITH value and incrementing from there based on the INCREMENT BY amount).

    +

    When used in an UPSERT SELECT or SELECT statement, each row returned by the statement would have a unique value associated with it. For example:

    +
    +
    UPSERT INTO my_table(id, col1, col2) 
    +SELECT NEXT VALUE FOR my_schema.my_sequence, 'foo', 'bar' FROM my_other_table;
    +
    +
    +

    would allocate a new sequence value for each row returned from the SELECT expression. A sequence is only increment once for a given statement, so multiple references to the same sequence by NEXT VALUE FOR produce the same value. For example, in the following statement, my_table.col1 and my_table.col2 would end up with the same value:

    +
    +
    UPSERT VALUES INTO my_table(col1, col2) 
    +VALUES( NEXT VALUE FOR my_schema.my_sequence, NEXT VALUE FOR my_schema.my_sequence);
    +
    +
    +

    You may also access the last sequence value allocated using a CURRENT VALUE FOR expression as shown below:

    +
    +
    SELECT CURRENT VALUE FOR my_schema.my_sequence, col1, col2 FROM my_table;
    +
    +
    +

    This would evaluate to the last sequence value allocated from the previous NEXT VALUE FOR expression for your session (i.e. all connections on the same JVM for the same client machine). If no NEXT VALUE FOR expression had been previously called, this would produce an exception. If in a given statement a CURRENT VALUE FOR expression is used together with a NEXT VALUE FOR expression for the same sequence, then both would evaluate to the value produced by the NEXT VALUE FOR expression.

    +

    The NEXT VALUE FOR and CURRENT VALUE FOR expressions may only be used as SELECT expressions or in the UPSERT VALUES statement. Use in WHERE, GROUP BY, HAVING, or ORDER BY will produce an exception. In addition, they cannot be used as the argument to an aggregate function.

    +

    To drop a sequence, issue the following command:

    +
    +
    DROP SEQUENCE my_schema.my_sequence;
    +
    +
    +

    To discover all sequences that have been created, you may query the SYSTEM.SEQUENCE table as shown here:

    +
    +
    SELECT sequence_schema, sequence_name, start_with, increment_by, cache_size FROM SYSTEM."SEQUENCE";
    +
    +
    +

    Note that only read-only access to the SYSTEM.SEQUENCE table is supported.

    +
    +
    +
    +
    + +
    + + + + +
    +
    +
    +

    Back to top

    + +

    Version: 2.2.2. Last Published: 2014-01-09.

    +
    +
    +
    + + + + + + + + + + + + + + + + + + + Modified: incubator/phoenix/site/publish/skip_scan.html URL: http://svn.apache.org/viewvc/incubator/phoenix/site/publish/skip_scan.html?rev=1556962&r1=1556961&r2=1556962&view=diff ============================================================================== --- incubator/phoenix/site/publish/skip_scan.html (original) +++ incubator/phoenix/site/publish/skip_scan.html Thu Jan 9 21:51:03 2014 @@ -1,7 +1,7 @@ @@ -74,6 +74,7 @@
  • Phoenix on EMR
  • Bulk CSV via M/R
  • Apache Flume Plugin
  • +
  • Sequences
  • Apache Flume Plugin
  • +
  • + Sequences +
  • @@ -227,7 +231,7 @@ AND KEY2 IN (1, 2)

    Back to top

    -

    Version: 2.2.2. Last Published: 2014-01-08.

    +

    Version: 2.2.2. Last Published: 2014-01-09.

    Modified: incubator/phoenix/site/publish/source-repository.html URL: http://svn.apache.org/viewvc/incubator/phoenix/site/publish/source-repository.html?rev=1556962&r1=1556961&r2=1556962&view=diff ============================================================================== --- incubator/phoenix/site/publish/source-repository.html (original) +++ incubator/phoenix/site/publish/source-repository.html Thu Jan 9 21:51:03 2014 @@ -1,7 +1,7 @@ @@ -74,6 +74,7 @@
  • Phoenix on EMR
  • Bulk CSV via M/R
  • Apache Flume Plugin
  • +
  • Sequences
  • Apache Flume Plugin
  • +
  • + Sequences +
  • @@ -217,7 +221,7 @@

    Back to top

    -

    Version: 2.2.2. Last Published: 2014-01-08.

    +

    Version: 2.2.2. Last Published: 2014-01-09.

    Modified: incubator/phoenix/site/publish/source.html URL: http://svn.apache.org/viewvc/incubator/phoenix/site/publish/source.html?rev=1556962&r1=1556961&r2=1556962&view=diff ============================================================================== --- incubator/phoenix/site/publish/source.html (original) +++ incubator/phoenix/site/publish/source.html Thu Jan 9 21:51:03 2014 @@ -1,7 +1,7 @@ @@ -74,6 +74,7 @@
  • Phoenix on EMR
  • Bulk CSV via M/R
  • Apache Flume Plugin
  • +
  • Sequences
  • Apache Flume Plugin
  • +
  • + Sequences +
  • @@ -218,7 +222,7 @@

    Back to top

    -

    Version: 2.2.2. Last Published: 2014-01-08.

    +

    Version: 2.2.2. Last Published: 2014-01-09.

    Modified: incubator/phoenix/site/publish/team-list.html URL: http://svn.apache.org/viewvc/incubator/phoenix/site/publish/team-list.html?rev=1556962&r1=1556961&r2=1556962&view=diff ============================================================================== --- incubator/phoenix/site/publish/team-list.html (original) +++ incubator/phoenix/site/publish/team-list.html Thu Jan 9 21:51:03 2014 @@ -1,7 +1,7 @@ @@ -74,6 +74,7 @@
  • Phoenix on EMR
  • Bulk CSV via M/R
  • Apache Flume Plugin
  • +
  • Sequences
  • Apache Flume Plugin
  • +
  • + Sequences +
  • @@ -242,7 +246,7 @@ window.onLoad = init();

    Back to top

    -

    Version: 2.2.2. Last Published: 2014-01-08.

    +

    Version: 2.2.2. Last Published: 2014-01-09.

    Modified: incubator/phoenix/site/publish/team.html URL: http://svn.apache.org/viewvc/incubator/phoenix/site/publish/team.html?rev=1556962&r1=1556961&r2=1556962&view=diff ============================================================================== --- incubator/phoenix/site/publish/team.html (original) +++ incubator/phoenix/site/publish/team.html Thu Jan 9 21:51:03 2014 @@ -1,7 +1,7 @@ @@ -74,6 +74,7 @@
  • Phoenix on EMR
  • Bulk CSV via M/R
  • Apache Flume Plugin
  • +
  • Sequences
  • Apache Flume Plugin
  • +
  • + Sequences +
  • @@ -330,7 +334,7 @@

    Back to top

    -

    Version: 2.2.2. Last Published: 2014-01-08.

    +

    Version: 2.2.2. Last Published: 2014-01-09.

    Modified: incubator/phoenix/site/publish/tuning.html URL: http://svn.apache.org/viewvc/incubator/phoenix/site/publish/tuning.html?rev=1556962&r1=1556961&r2=1556962&view=diff ============================================================================== --- incubator/phoenix/site/publish/tuning.html (original) +++ incubator/phoenix/site/publish/tuning.html Thu Jan 9 21:51:03 2014 @@ -1,7 +1,7 @@ @@ -74,6 +74,7 @@
  • Phoenix on EMR
  • Bulk CSV via M/R
  • Apache Flume Plugin
  • +
  • Sequences
  • Apache Flume Plugin
  • +
  • + Sequences +
  • @@ -407,7 +411,7 @@

    Back to top

    -

    Version: 2.2.2. Last Published: 2014-01-08.

    +

    Version: 2.2.2. Last Published: 2014-01-09.