java - Partitioner for result set from oracle database in spring batch -


i need extract results query in flat file. there way partition result set can accessed multiple threads.

i tried partitioning based on rownum without sort, when same query executed multiple threads rownum not remain same(because not sorting due performance impact) , creates duplicates in output.

use rowid instead. rowid immutable every record. or use primary key (or other field enough distinct values mather) devide data in subsets.

select *  table     substr(rowidtochar(rowid),-1) in ('a','a','0');  select *  table        substr(rowidtochar(rowid),-1) in ('b','b','1');  or   select *  table        substr(rowidtochar(rowid),-1) between 'a' , 'z'; etc. 

you'll have experiment little clause. far know last character of rownum can contain [a-z][a-z][0-9] + , /


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -