Support Questions

Find answers, ask questions, and share your expertise

creation of phoenix table

avatar

When i create Internal table with phoenix i got error " Syntax error. Encountered "BY" "

create table phoenix_table (
. . . . . . . . >   s1 CHAR(10),
. . . . . . . . >  i1 INTEGER,
. . . . . . . . >   f1 FLOAT,
. . . . . . . . >   d1 DOUBLE
. . . . . . . . > )
. . . . . . . . > STORED BY 'org.apache.phoenix.hive.PhoenixStorageHandler'
. . . . . . . . > TBLPROPERTIES (
. . . . . . . . > "phoenix.table.name" = "phoenix_table",
. . . . . . . . > "phoenix.zookeeper.quorum" = "localhost",
. . . . . . . . > "phoenix.zookeeper.znode.parent" = "/hbase",
. . . . . . . . >   "phoenix.zookeeper.client.port" = "2181",
. . . . . . . . > "phoenix.rowkeys" = "s1, i1",
. . . . . . . . > "phoenix.column.mapping" = "s1:s1, i1:i1, f1:f1, d1:d1",
. . . . . . . . > "phoenix.table.options" = "SALT_BUCKETS=10, DATA_BLOCK_ENCODING='DIFF'"
. . . . . . . . > );
1 ACCEPTED SOLUTION

avatar

Are you creating table from phoenix sqlline or hive?

When you create table from Phoenix client or sqlline then you don't need to provide all the information PhoenixStoragehandler and table properties.

View solution in original post

2 REPLIES 2

avatar

Are you creating table from phoenix sqlline or hive?

When you create table from Phoenix client or sqlline then you don't need to provide all the information PhoenixStoragehandler and table properties.

avatar
Explorer

Phoenix Hive integration is there from Phoenix 4.8, if you are trying to create phoenix table using hive then that is the way. But if you need to create a phoenix table on top of hbase, as @Rajeshbabu Chintaguntla said you don't need to use phoenix storage handler. And passing the table properties is not required.