UnsupportedOperationException: Currently the writer can only accept BytesRefArrayWritable

简介: 往Hive表中插入时报错: java.lang.RuntimeException: java.lang.UnsupportedOperationException: Currently the writer can only accept BytesRefArrayWritable at org.

往Hive表中插入时报错:

java.lang.RuntimeException: java.lang.UnsupportedOperationException: Currently the writer can only accept BytesRefArrayWritable
	at org.apache.hadoop.hive.ql.exec.ExecReducer.reduce(ExecReducer.java:270)
	at org.apache.hadoop.mapred.ReduceTask.runOldReducer(ReduceTask.java:506)
	at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:447)
	at org.apache.hadoop.mapred.Child$4.run(Child.java:268)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAs(Subject.java:396)
	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1408)
	at org.apache.hadoop.mapred.Child.main(Child.java:262)
Caused by: java.lang.UnsupportedOperationException: Currently the writer can only accept BytesRefArrayWritable
	at org.apache.hadoop.hive.ql.io.RCFile$Writer.append(RCFile.java:880)
	at org.apache.hadoop.hive.ql.io.RCFileOutputFormat$2.write(RCFileOutputFormat.java:140)
	at org.apache.hadoop.hive.ql.exec.FileSinkOperator.processOp(FileSinkOperator.java:606)

java.lang.RuntimeException: java.lang.UnsupportedOperationException: Currently the writer can only accept BytesRefArrayWritable
	at org.apache.hadoop.hive.ql.exec.ExecReducer.reduce(ExecReducer.java:270)
	at org.apache.hadoop.mapred.ReduceTask.runOldReducer(ReduceTask.java:506)
	at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:447)
	at org.apache.hadoop.mapred.Child$4.run(Child.java:268)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAs(Subject.java:396)
	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1408)
	at org.apache.hadoop.mapred.Child.main(Child.java:262)
Caused by: java.lang.UnsupportedOperationException: Currently the writer can only accept BytesRefArrayWritable
	at org.apache.hadoop.hive.ql.io.RCFile$Writer.append(RCFile.java:880)
	at org.apache.hadoop.hive.ql.io.RCFileOutputFormat$2.write(RCFileOutputFormat.java:140)
	at org.apache.hadoop.hive.ql.exec.FileSinkOperator.processOp(FileSinkOperator.java:606)

java.lang.RuntimeException: java.lang.UnsupportedOperationException: Currently the writer can only accept BytesRefArrayWritable
	at org.apache.hadoop.hive.ql.exec.ExecReducer.reduce(ExecReducer.java:270)
	at org.apache.hadoop.mapred.ReduceTask.runOldReducer(ReduceTask.java:506)
	at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:447)
	at org.apache.hadoop.mapred.Child$4.run(Child.java:268)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAs(Subject.java:396)
	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1408)
	at org.apache.hadoop.mapred.Child.main(Child.java:262)
Caused by: java.lang.UnsupportedOperationException: Currently the writer can only accept BytesRefArrayWritable
	at org.apache.hadoop.hive.ql.io.RCFile$Writer.append(RCFile.java:880)
	at org.apache.hadoop.hive.ql.io.RCFileOutputFormat$2.write(RCFileOutputFormat.java:140)
	at org.apache.hadoop.hive.ql.exec.FileSinkOperator.processOp(FileSinkOperator.java:606)

貌似建表是格式的问题:http://comments.gmane.org/gmane.comp.java.hadoop.hive.user/2849

建表语句如下:

CREATE  TABLE client_user_type_installtime(
  userkey string,
  mos string,
  type string)
PARTITIONED BY ( 
  dt string,
  installtime_type string)
ROW FORMAT DELIMITED 
  FIELDS TERMINATED BY '9' 
  LINES TERMINATED BY '10' 
STORED AS INPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.RCFileInputFormat' 
OUTPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'

修改建表语句:

CREATE  TABLE client_user_type_installtime(
  userkey string, 
  mos string, 
  type string)
PARTITIONED BY ( 
  dt string, 
  installtime_type string)
ROW FORMAT SERDE 
  'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' 
STORED AS INPUTFORMAT 
  'org.apache.hadoop.mapred.TextInputFormat' 
OUTPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'

重建后插入成功。

 

目录
相关文章
|
11月前
|
Java 编译器 程序员
Checked Exception 和 Unchecked Exception 有什么区别?
Checked Exception 和 Unchecked Exception 有什么区别?
|
3月前
Request Headers 中的 Accept 是 text/event-stream
Request Headers 中的 Accept 是 text/event-stream
165 0
|
11月前
|
Java 容器
RestTemplate报错I/O error on POST request for "http://crmjob.xxx.xxx.com/removeJob": Read timed out; nested exception is java.net.SocketTimeoutException: Read timed out问题处理
讲述RestTemplate报错I/O error on POST request for "http://crmjob.xxx.xxx.com/removeJob": Read timed out; nested exception is java.net.SocketTimeoutException: Read timed out处理方案
|
Java API Spring
RuntimeException和Exception的区别
RuntimeException和Exception的区别
150 0
|
Java 容器
Java 是否应该在HttpServletResponse.getOutputStream()/getWriter()上调用.close()?
Java 是否应该在HttpServletResponse.getOutputStream()/getWriter()上调用.close()?
125 0
|
安全 Java 数据库连接
Exception和Error有什么区别吗
Exception和Error有什么区别吗
212 1
OkHttp responsejava.lang.IllegalStateException: closed
OkHttp responsejava.lang.IllegalStateException: closed
|
安全 Java 数据库连接
Java中的异常处理详解(try、catch、finally、throw、throws)
Java中的异常处理详解(try、catch、finally、throw、throws)
287 1
|
Web App开发 Java Apache
java.lang.IllegalStateException: getOutputStream() has already been called for this response
https://stackoverflow.com/questions/33982515/handlerinterceptor-getoutputstream-has-already-been-called-for-this-response http://blog.
3775 0
|
Java
【学习笔记】【Java】try-catch-finally中,finally是在什么时候执行的:try结束、catch结束、return前
结论:try-catch-finally中,finally执行:try结束、catch结束、return前
186 0
【学习笔记】【Java】try-catch-finally中,finally是在什么时候执行的:try结束、catch结束、return前