---
title: "sqoop导入数据到hive中，数据不一致"
author: "kingding"
date: "2018-12-11T10:54:27Z"
tags: []
categories: ["行业应用"]
slug: "sqoop-hive"
draft: false
lastmod: "2018-12-11T10:54:27Z"
id: 2435018
url: "https://kingding.iteye.com/blog/2435018"
---

sqoop import "-Dorg.apache.sqoop.splitter.allow\_text\_splitter=true" -D mapreduce.job.queuename=hqgf --connect jdbc:mysql://xxx.xx.x.xxx:1234/hqmart\_nc --username bitest --password 123456 --table rent\_contract\_baseinfo --hive-import --create-hive-table --hive-table hqgf\_ods\_nc.rent\_contract\_baseinfo --split-by contractcode --hive-drop-import-delims --fields-terminated-by '\\001' --lines-terminated-by '\\n'  -m 1 --delete-target-dir

 

 

--hive-drop-import-delims --fields-terminated-by '\\001' --lines-terminated-by '\\n'

 

--hive-delims-replacement 导入到hive时用自定义的字符替换掉 \\n, \\r, and \\01

防止换行