phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicholas Whitehead <whitehead.nicho...@gmail.com>
Subject Re: REG: Update -Set in Phoenix
Date Thu, 06 Aug 2015 13:14:11 GMT
If col fam and tables are really in lower case, you need to double quote
them.

E.g.   b.el_id
Should be
"b"."el_id"

Could be the issue.
On Aug 6, 2015 2:25 AM, "Ns G" <nsgnsg84@gmail.com> wrote:

> Hello Team,
>
> Any help , suggestions or examples on my request.
>
> I have tried upsert select as advised by Micheal but it was giving me
> table undefined error.
>
> UPSERT INTO SDM_262.ELEMENT select MAX_V,
> f.ATTR_1,f.ATTR_2,f.ATTR_3,f.ATTR_4,f.ATTR_5,f.ATTR_6,f.ATTR_7,f.ATTR_8,f.ATTR_9,f.ATTR_10,f.ATTR_11,f.ATTR_12,f.ATTR_13,f.ATTR_14,f.ATTR_15,f.ATTR_16
> from sdm_262.element f, (select max(b.el_id) from sdm_262.element b where
> b.el_parent_id in (10001000,10001002)) as MAX_V where f.el_parent_id in
> (10001000,10001002);
>
>
> Error: ERROR 1012 (42M03): Table undefined. (state=42M03,code=1012)
> org.apache.phoenix.schema.TableNotFoundException: ERROR 1012 (42M03):
> Table undefined.
>         at
> org.apache.phoenix.compile.FromCompiler$MultiTableColumnResolver.resolveTable(FromCompiler.java:511)
>         at
> org.apache.phoenix.compile.JoinCompiler$ColumnRefParseNodeVisitor.visit(JoinCompiler.java:1065)
>         at
> org.apache.phoenix.compile.JoinCompiler$ColumnRefParseNodeVisitor.visit(JoinCompiler.java:1037)
>         at
> org.apache.phoenix.parse.ColumnParseNode.accept(ColumnParseNode.java:56)
>         at
> org.apache.phoenix.compile.JoinCompiler.extractFromSelect(JoinCompiler.java:1160)
>         at
> org.apache.phoenix.compile.JoinCompiler.access$500(JoinCompiler.java:104)
>         at
> org.apache.phoenix.compile.JoinCompiler$JoinTableConstructor.visit(JoinCompiler.java:209)
>         at
> org.apache.phoenix.compile.JoinCompiler$JoinTableConstructor.visit(JoinCompiler.java:174)
>         at
> org.apache.phoenix.parse.NamedTableNode.accept(NamedTableNode.java:58)
>         at
> org.apache.phoenix.compile.JoinCompiler$JoinTableConstructor.visit(JoinCompiler.java:193)
>         at
> org.apache.phoenix.compile.JoinCompiler$JoinTableConstructor.visit(JoinCompiler.java:174)
>         at
> org.apache.phoenix.parse.JoinTableNode.accept(JoinTableNode.java:81)
>         at
> org.apache.phoenix.compile.JoinCompiler.compile(JoinCompiler.java:130)
>         at
> org.apache.phoenix.compile.JoinCompiler.optimize(JoinCompiler.java:1216)
>         at
> org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:146)
>         at
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:331)
>         at
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:314)
>         at
> org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:230)
>         at
> org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:226)
>         at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
>         at
> org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:225)
>         at
> org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1066)
>         at sqlline.Commands.execute(Commands.java:822)
>         at sqlline.Commands.sql(Commands.java:732)
>         at sqlline.SqlLine.dispatch(SqlLine.java:808)
>         at sqlline.SqlLine.begin(SqlLine.java:681)
>         at sqlline.SqlLine.start(SqlLine.java:398)
>         at sqlline.SqlLine.main(SqlLine.java:292)
>
>
> Please this is important and spending lot of time on this.
>
>
> Dear James,
>
>
> I request you to implement update set command in phoenix as lack of it is
> making me circumvent. Even a simple solution is getting complex.
>
>
> Regards,
>
> Satya
>
>
> On Tue, Jul 14, 2015 at 3:39 PM, Ns G <nsgnsg84@gmail.com> wrote:
>
>> HI There,
>>
>> I have a query like one below
>>
>> UPDATE table_1
>> SET    id1 = (SELECT Min(id1)
>>           FROM   table_1 t2
>>           WHERE  table_1.id3 = t2.id3)
>> WHERE  id3 = id4
>>
>> I am trying to implement this in Apache Phoenix. Can anyone suggest how
>> should i be doing this as we do not have set command in phoenix. I am using
>> 4.3.1 version.
>>
>>
>> Thanks,
>>
>> Satya
>>
>>
>>
>>
>>
>

Mime
View raw message