How to upsert data into dynamic columns in phoniex.

2015-06-21 Thread guxiaobo1982
Hi,


The official doc only gives an example for querying dynamic columns which are 
not defined at table creating time, but how can create the dynamic columns in 
the schema and get data upsert through the phoniex API?


Thanks

[no subject]

2015-06-21 Thread Kumar Palaniappan
I'm getting this when I use sqlline.

I compiled phoenix4.4 with cdh5.4 along with code changes and pom changes.

Any clue? Appreciate your time.



Error: ERROR 103 (08004): Unable to establish connection.
(state=08004,code=103)

java.sql.SQLException: ERROR 103 (08004): Unable to establish connection.

at
org.apache.phoenix.exception.SQLExceptionCode$Factory$1.newException(SQLExceptionCode.java:386)

at
org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:145)

at
org.apache.phoenix.query.ConnectionQueryServicesImpl.openConnection(ConnectionQueryServicesImpl.java:289)

at
org.apache.phoenix.query.ConnectionQueryServicesImpl.access$300(ConnectionQueryServicesImpl.java:171)

at
org.apache.phoenix.query.ConnectionQueryServicesImpl$12.call(ConnectionQueryServicesImpl.java:1881)

at
org.apache.phoenix.query.ConnectionQueryServicesImpl$12.call(ConnectionQueryServicesImpl.java:1860)

at
org.apache.phoenix.util.PhoenixContextExecutor.call(PhoenixContextExecutor.java:77)

at
org.apache.phoenix.query.ConnectionQueryServicesImpl.init(ConnectionQueryServicesImpl.java:1860)

at
org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:162)

at
org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.connect(PhoenixEmbeddedDriver.java:131)

at org.apache.phoenix.jdbc.PhoenixDriver.connect(PhoenixDriver.java:133)

at sqlline.DatabaseConnection.connect(DatabaseConnection.java:157)

at sqlline.DatabaseConnection.getConnection(DatabaseConnection.java:203)

at sqlline.Commands.connect(Commands.java:1064)

at sqlline.Commands.connect(Commands.java:996)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:497)

at
sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:36)

at sqlline.SqlLine.dispatch(SqlLine.java:804)

at sqlline.SqlLine.initArgs(SqlLine.java:588)

at sqlline.SqlLine.begin(SqlLine.java:656)

at sqlline.SqlLine.start(SqlLine.java:398)

at sqlline.SqlLine.main(SqlLine.java:292)

Caused by: java.io.IOException: java.lang.reflect.InvocationTargetException

at
org.apache.hadoop.hbase.client.ConnectionFactory.createConnection(ConnectionFactory.java:240)

at
org.apache.hadoop.hbase.client.ConnectionManager.createConnection(ConnectionManager.java:414)

at
org.apache.hadoop.hbase.client.ConnectionManager.createConnectionInternal(ConnectionManager.java:323)

at
org.apache.hadoop.hbase.client.HConnectionManager.createConnection(HConnectionManager.java:144)

at
org.apache.phoenix.query.HConnectionFactory$HConnectionFactoryImpl.createConnection(HConnectionFactory.java:47)

at
org.apache.phoenix.query.ConnectionQueryServicesImpl.openConnection(ConnectionQueryServicesImpl.java:286)

... 22 more

Caused by: java.lang.reflect.InvocationTargetException

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:422)

at
org.apache.hadoop.hbase.client.ConnectionFactory.createConnection(ConnectionFactory.java:238)

... 27 more

Caused by: java.lang.NoClassDefFoundError:
org/jboss/netty/channel/ChannelFactory

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:348)

at
org.apache.hadoop.conf.Configuration.getClassByNameOrNull(Configuration.java:2051)

at
org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:2016)

at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2110)

at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2136)

at
org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.init(ConnectionManager.java:643)

... 32 more

Caused by: java.lang.ClassNotFoundException:
org.jboss.netty.channel.ChannelFactory

at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)

at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

... 39 more

sqlline version 1.1.8


CDH 5.4 and Phoenix

2015-06-21 Thread Serega Sheypak
Hi!, did anyone try to integrate Phoenix 1.0 with CDH 5.4.x?
I see weird installation path here:
http://www.cloudera.com/content/cloudera/en/developers/home/cloudera-labs/apache-phoenix/install-apache-phoenix-cloudera-labs.pdf
I would like to avoid it and run app using plain maven dependencies.
Right Now it doesn't work because phoenix and hbase from CDH are compiled
against different HBase source code.


Re:Connection error with Phoenix 4.4

2015-06-21 Thread Kumar Palaniappan
Re-sending with the subject.

On Sun, Jun 21, 2015 at 3:51 PM, Kumar Palaniappan 
kpalaniap...@marinsoftware.com wrote:

 I'm getting this when I use sqlline.

 I compiled phoenix4.4 with cdh5.4 along with code changes and pom changes.

 Any clue? Appreciate your time.



 Error: ERROR 103 (08004): Unable to establish connection.
 (state=08004,code=103)

 java.sql.SQLException: ERROR 103 (08004): Unable to establish connection.

 at
 org.apache.phoenix.exception.SQLExceptionCode$Factory$1.newException(SQLExceptionCode.java:386)

 at
 org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:145)

 at
 org.apache.phoenix.query.ConnectionQueryServicesImpl.openConnection(ConnectionQueryServicesImpl.java:289)

 at
 org.apache.phoenix.query.ConnectionQueryServicesImpl.access$300(ConnectionQueryServicesImpl.java:171)

 at
 org.apache.phoenix.query.ConnectionQueryServicesImpl$12.call(ConnectionQueryServicesImpl.java:1881)

 at
 org.apache.phoenix.query.ConnectionQueryServicesImpl$12.call(ConnectionQueryServicesImpl.java:1860)

 at
 org.apache.phoenix.util.PhoenixContextExecutor.call(PhoenixContextExecutor.java:77)

 at
 org.apache.phoenix.query.ConnectionQueryServicesImpl.init(ConnectionQueryServicesImpl.java:1860)

 at
 org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:162)

 at
 org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.connect(PhoenixEmbeddedDriver.java:131)

 at org.apache.phoenix.jdbc.PhoenixDriver.connect(PhoenixDriver.java:133)

 at sqlline.DatabaseConnection.connect(DatabaseConnection.java:157)

 at sqlline.DatabaseConnection.getConnection(DatabaseConnection.java:203)

 at sqlline.Commands.connect(Commands.java:1064)

 at sqlline.Commands.connect(Commands.java:996)

 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

 at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

 at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

 at java.lang.reflect.Method.invoke(Method.java:497)

 at
 sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:36)

 at sqlline.SqlLine.dispatch(SqlLine.java:804)

 at sqlline.SqlLine.initArgs(SqlLine.java:588)

 at sqlline.SqlLine.begin(SqlLine.java:656)

 at sqlline.SqlLine.start(SqlLine.java:398)

 at sqlline.SqlLine.main(SqlLine.java:292)

 Caused by: java.io.IOException: java.lang.reflect.InvocationTargetException

 at
 org.apache.hadoop.hbase.client.ConnectionFactory.createConnection(ConnectionFactory.java:240)

 at
 org.apache.hadoop.hbase.client.ConnectionManager.createConnection(ConnectionManager.java:414)

 at
 org.apache.hadoop.hbase.client.ConnectionManager.createConnectionInternal(ConnectionManager.java:323)

 at
 org.apache.hadoop.hbase.client.HConnectionManager.createConnection(HConnectionManager.java:144)

 at
 org.apache.phoenix.query.HConnectionFactory$HConnectionFactoryImpl.createConnection(HConnectionFactory.java:47)

 at
 org.apache.phoenix.query.ConnectionQueryServicesImpl.openConnection(ConnectionQueryServicesImpl.java:286)

 ... 22 more

 Caused by: java.lang.reflect.InvocationTargetException

 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

 at
 sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

 at
 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

 at java.lang.reflect.Constructor.newInstance(Constructor.java:422)

 at
 org.apache.hadoop.hbase.client.ConnectionFactory.createConnection(ConnectionFactory.java:238)

 ... 27 more

 Caused by: java.lang.NoClassDefFoundError:
 org/jboss/netty/channel/ChannelFactory

 at java.lang.Class.forName0(Native Method)

 at java.lang.Class.forName(Class.java:348)

 at
 org.apache.hadoop.conf.Configuration.getClassByNameOrNull(Configuration.java:2051)

 at
 org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:2016)

 at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2110)

 at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2136)

 at
 org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.init(ConnectionManager.java:643)

 ... 32 more

 Caused by: java.lang.ClassNotFoundException:
 org.jboss.netty.channel.ChannelFactory

 at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

 at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)

 at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

 ... 39 more

 sqlline version 1.1.8



Re: Indexing array type

2015-06-21 Thread Leon Prouger
Hey James, thank you for replying.
Yes you're right, this option is pretty useless is our case. We've been
thinking to create a separate table which will model the array with one to
many relation, then index it and perform join with the main table for every
query. Like:

Main table: PK(id), data columns
Array table: PK(id, array cell), index of the array cell

But I wonder is the join gonna be faster then full scan of the main table.

Is there any plans for implementing an array index? Maybe it can be done
for immutable tables only.


On Wed, Jun 17, 2015 at 10:05 PM James Taylor jamestay...@apache.org
wrote:

 Hey Leon,
 You can have an array in an index, but it has to be at the end of the
 PK constraint which is not very useful and likely not what you want -
 it'd essentially be equivalent of having the array at the end of your
 primary key constraint.

 The other alternative I can think of that may be more useful is to use
 functional indexing[1] on specific array elements. You'd need to know
 the position of the element that you're indexing and querying against
 in advance, though.

 [1] http://phoenix.apache.org/secondary_indexing.html#Functional_Index

 On Wed, Jun 17, 2015 at 4:43 AM, Leon Prouger leonp...@gmail.com wrote:
  Hey folks,
 
  Maybe I'm asking too much but I couldn't find a straight answer. Is this
  possible to index an array type with Phoenix?
 
  If I can't does anybody tried any alternatives? Like keeping another
 table
  for the array many to one relation



Phoenix and Jooq

2015-06-21 Thread Leon Prouger
Found this tutorial about Phoenix and Jooq
http://blog.sequenceiq.com/blog/2014/09/04/sql-on-hbase-with-apache-phoenix/

I wonder if it's possible to use more advanced Jooq features like code
generation?