phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McAllister <mmcallis...@homeaway.com>
Subject Re: REG: Update -Set in Phoenix
Date Wed, 15 Jul 2015 14:38:56 GMT
Yes it’s true as far as I can tell, you’ll at least have to get the PK columns as well.

Michael McAllister
Staff Data Warehouse Engineer | Decision Systems
mmcallister@HomeAway.com<mailto:mmcallister@HomeAway.com> | C: 512.423.7447 | skype:
michael.mcallister.ha<mailto:zimmkate@hotmail.com> | webex: https://h.a/mikewebex

[cid:image002.png@01D080DC.77AD4930]
This electronic communication (including any attachment) is confidential.  If you are not
an intended recipient of this communication, please be advised that any disclosure, dissemination,
distribution, copying or other use of this communication or any attachment is strictly prohibited.
 If you have received this communication in error, please notify the sender immediately by
reply e-mail and promptly destroy all electronic and printed copies of this communication
and any attachment.

On Jul 14, 2015, at 8:53 PM, Ns G <nsgnsg84@gmail.com<mailto:nsgnsg84@gmail.com>>
wrote:


Michael,

For using upsert, I need to fetch the primary ID at the least and then do processing and update
the columns. I need to read the entire table to fetch primary keys and then do processing
at service layer and do an upsert, which I think is quite a task for huge table.

Please let me know your thoughts,

Thanks,
Satya

On 14-Jul-2015 7:44 pm, "Michael McAllister" <mmcallister@homeaway.com<mailto:mmcallister@homeaway.com>>
wrote:
Satya

Try the UPSERT SELECT statement:-

https://phoenix.apache.org/language/#upsert_select

Michael McAllister
Staff Data Warehouse Engineer | Decision Systems
mmcallister@HomeAway.com<mailto:mmcallister@HomeAway.com> | C: 512.423.7447 | skype:
michael.mcallister.ha<mailto:zimmkate@hotmail.com> | webex: https://h.a/mikewebex

<image002.png>
This electronic communication (including any attachment) is confidential.  If you are not
an intended recipient of this communication, please be advised that any disclosure, dissemination,
distribution, copying or other use of this communication or any attachment is strictly prohibited.
 If you have received this communication in error, please notify the sender immediately by
reply e-mail and promptly destroy all electronic and printed copies of this communication
and any attachment.

On Jul 14, 2015, at 5:09 AM, Ns G <nsgnsg84@gmail.com<mailto: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