You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by James Taylor <ja...@apache.org> on 2015/10/20 18:24:52 UTC

support for sequences?

Does Drill support sequences in queries for things such as ID generation?

  CREATE TABLE suppliers
    AS (SELECT NEXT VALUE FOR supplier_id_seq, address, city, state, zip
           FROM companies
           WHERE city = 'San Francisco');

Thanks,
James

Re: support for sequences?

Posted by James Taylor <ja...@apache.org>.
We use a Phoenix table where each row in the table represents a sequence
and the increment is done atomically.

FWIW, Calcite supports sequences.

On Tue, Oct 20, 2015 at 5:04 PM, Jacques Nadeau <ja...@dremio.com> wrote:

> Not currently.
>
> How do you guys implement that in Phoenix since I assume the sequence would
> need to be global and unique (and also distributed).
>
> --
> Jacques Nadeau
> CTO and Co-Founder, Dremio
>
> On Tue, Oct 20, 2015 at 9:24 AM, James Taylor <ja...@apache.org>
> wrote:
>
> > Does Drill support sequences in queries for things such as ID generation?
> >
> >   CREATE TABLE suppliers
> >     AS (SELECT NEXT VALUE FOR supplier_id_seq, address, city, state, zip
> >            FROM companies
> >            WHERE city = 'San Francisco');
> >
> > Thanks,
> > James
> >
>

Re: support for sequences?

Posted by Jacques Nadeau <ja...@dremio.com>.
Not currently.

How do you guys implement that in Phoenix since I assume the sequence would
need to be global and unique (and also distributed).

--
Jacques Nadeau
CTO and Co-Founder, Dremio

On Tue, Oct 20, 2015 at 9:24 AM, James Taylor <ja...@apache.org>
wrote:

> Does Drill support sequences in queries for things such as ID generation?
>
>   CREATE TABLE suppliers
>     AS (SELECT NEXT VALUE FOR supplier_id_seq, address, city, state, zip
>            FROM companies
>            WHERE city = 'San Francisco');
>
> Thanks,
> James
>