kettle连接Hive中数据导入导出(6)


1.hive往外写数据

http://wiki.pentaho.com/display/BAD/Extracting+Data+from+Hive+to+Load+an+RDBMS

连接hive

 

表输入

 

1)往excel中写数据

2)往文本文件中写数据

注:这里需要填上hive的表名.字段名,不然会报如下错误:

2016/07/27 15:43:01 - 表输入.0 - ERROR (version 3.2.0, build 1 from 2016-07-07 10.46.10 by xnren) : Unexpected error
2016/07/27 15:43:01 - 表输入.0 - ERROR (version 3.2.0, build 1 from 2016-07-07 10.46.10 by xnren) : org.pentaho.di.core.exception.KettleDatabaseException: 
2016/07/27 15:43:01 - 表输入.0 - ERROR (version 3.2.0, build 1 from 2016-07-07 10.46.10 by xnren) : Couldn't get row from result set
2016/07/27 15:43:01 - 表输入.0 - ERROR (version 3.2.0, build 1 from 2016-07-07 10.46.10 by xnren) : Error retrieving next row

2.hive中写数据

http://wiki.pentaho.com/display/BAD/Loading+Data+into+Hive

1 hive -e "load data local inpath '/opt/a.txt' into table jj.ss"

原始数据:

插入数据:

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM