phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Marc Spaggiari <jean-m...@spaggiari.org>
Subject Auto-increment field?
Date Wed, 27 Aug 2014 12:56:24 GMT
Hi,

I have data like:

CustID, URL

and I want to put that into Phoenix. Is there a way to have an
auto-increment field to do something like:
CREATE TABLE IF NOT EXISTS testdata (  id BIGINT NOT NULL,  subid
AUTO-INCREMENT, url VARCHAR CONSTRAINT my_pk PRIMARY KEY (id, subid));

Idea is, I have duplicates in the key. On customer can access 2 different
URLs, so I want to store the 2 under this customer name.

I'm totally fine to do that with HBase only, but I'm wondering how I can do
that with Phoenix?

I planned to use the bulkload given in the documentation to load the data
so I have a 22GB csv sample I want to load:
/usr/lib/phoenix/bin/psql.py hbm101 us_population.sql us_population.csv
us_population_queries.sq

But this doesn't seem to have any increment option.

I can probably use a sequence and loop over all my rows and generate UPSERT
statement like in this example: http://phoenix.apache.org/sequences.html
but I have 156 576 856 lines into the file and doing 156M UPSERT might take
a while.

Do you have any shortcut for my issue? So far, the only idea I have is to
update the .cvs file and add an increment column manually.

Thanks,

JM

Mime
View raw message