I am trying to migrate some of PLSQL code to hadoop + Apache Pheonix.
See below sample example. it has cursor declaration and then iterating over cursor to update table.
cursor cur is
numbers_en join translations using(id_num)
left join lang
Iterate over curser to update table translations:
for rec in cur
mod(rec.id_num,2) = 0 then
translations set txt_trans = upper(txt_trans)
Easiest way to achieve is below :
- * Make JDBC call to collect ResultSet
- * Iterate through ResultSet
- * In each record in resultset, make JDBC for update.
Dis-advantages with approach:
- Client become bottleneck as complete resultset will come to client first.
- cursor logic is not leveraging parallelism processing.
Help me to implement the same bottleneck removed through Apache Pheonix + HBAse + Hbase Coprocessor.
( Have Coprocessor on Query/View/Table scan and update operation within coprocessor logic)
Any guidance highly appreciated.