phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Samarth Jain <samarth.j...@gmail.com>
Subject Re: Phoenix4.2.1 against HBase0.98.6 encountered a strange problem when using connection with props
Date Thu, 04 Dec 2014 07:17:55 GMT
Is there a reason why you are using CURRENT_SCN_ATTRIBUTE while you are
getting a phoenix connection? Is it because you want to query data at a
point of time? If yes, you probably want to check that the create time
stamp of the table MYTEST1 <= 1417597200000L. If you don't want any
snapshot like queries, then *not* using CURRENT_SCN_ATTRIBUTE is the way to
go.

On Wed, Dec 3, 2014 at 11:03 PM, sunfl@certusnet.com.cn <
sunfl@certusnet.com.cn> wrote:

> Hi,
> 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
> ?
>
> Thanks,
> Sun
>
> ------------------------------
> ------------------------------
>
> CertusNet
>
>
>
> *发件人:* chenwenhui <c77_cn@163.com>
> *发送时间:* 2014-12-04 13:49
> *收件人:* user <user@phoenix.apache.org>
> *主题:* 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));
>         Class.forName("org.apache.phoenix.jdbc.PhoenixDriver");
>         final Connection con =
> DriverManager.getConnection("jdbc:phoenix:192.168.15.48", props);
>         stmt = con.createStatement();
>         stmt.executeUpdate("upsert into mytest1 values(3,'abc')");
>         con.commit();
>         con.close();
> 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(FromCompiler.java:325)
> at
> org.apache.phoenix.compile.FromCompiler$SingleTableColumnResolver.<init>(FromCompiler.java:215)
> at
> org.apache.phoenix.compile.FromCompiler$SingleTableColumnResolver.<init>(FromCompiler.java:209)
> at
> org.apache.phoenix.compile.FromCompiler.getResolverForMutation(FromCompiler.java:185)
> at
> org.apache.phoenix.compile.UpsertCompiler.compile(UpsertCompiler.java:246)
> at
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableUpsertStatement.compilePlan(PhoenixStatement.java:478)
> at
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableUpsertStatement.compilePlan(PhoenixStatement.java:469)
> at
> org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:270)
> at
> org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:263)
> at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
> at
> org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:261)
> at
> org.apache.phoenix.jdbc.PhoenixStatement.executeUpdate(PhoenixStatement.java:1043)
> at com.bitauto.phoenix.FirstTest.main(FirstTest.java:40)
>
> But the table named MYTEST1 indeed exists, and if using connection without
> props, i.e.
> Connection con = DriverManager.getConnection("jdbc:phoenix:192.168.15.48";
> all things will become  okay.
>
> Any ideas can be appreciated!
>
>
>

Mime
View raw message