phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "" <>
Subject 回复: Phoenix4.2.1 against HBase0.98.6 encountered a strange problem when using connection with props
Date Thu, 04 Dec 2014 07:03:51 GMT
The main cause is that you put inappropriate props key value for the parameter.
What properties would you expect to utilize at the phoenix connection time ?



发件人: chenwenhui
发送时间: 2014-12-04 13:49
收件人: user
主题: Phoenix4.2.1 against HBase0.98.6 encountered a strange problem when using connection
with props
The main code fragment is as follow:
        final Properties props = new Properties();
        final long ts = 1417597200000L;
        props.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts));
        final Connection con = DriverManager.getConnection("jdbc:phoenix:", props);
        stmt = con.createStatement();
        stmt.executeUpdate("upsert into mytest1 values(3,'abc')");        
It will report the following exception:
Exception in thread "main" org.apache.phoenix.schema.TableNotFoundException: ERROR 1012 (42M03):
Table undefined. tableName=MYTEST1
at org.apache.phoenix.compile.FromCompiler$BaseColumnResolver.createTableRef(
at org.apache.phoenix.compile.FromCompiler$SingleTableColumnResolver.<init>(
at org.apache.phoenix.compile.FromCompiler$SingleTableColumnResolver.<init>(
at org.apache.phoenix.compile.FromCompiler.getResolverForMutation(
at org.apache.phoenix.compile.UpsertCompiler.compile(
at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableUpsertStatement.compilePlan(
at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableUpsertStatement.compilePlan(
at org.apache.phoenix.jdbc.PhoenixStatement$
at org.apache.phoenix.jdbc.PhoenixStatement$
at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(
at org.apache.phoenix.jdbc.PhoenixStatement.executeUpdate(
at com.bitauto.phoenix.FirstTest.main(

But the table named MYTEST1 indeed exists, and if using connection without props, i.e.
Connection con = DriverManager.getConnection("jdbc:phoenix:";
all things will become  okay.

Any ideas can be appreciated!

View raw message