ArrayWritable的使用方式

ArrayWritable is a touch hard to use. Say you have an array of 
IntWritable[]. The get() method or ArrayWritable, after 
serializations/deserialization, does in fact return an array of type 
Writable. As such you cannot cast it directly to IntWritable[]. Individual 
elements are of type IntWritable and can be cast as such. 

Will not work: 

IntWritable[] array = (IntWritable[]) writable.get(); 

Will work: 

for(Writable element : writable.get()) { 
  IntWritable intWritable = (IntWritable)element; 

你可能感兴趣的:(table)