Sqoop抽取Sqlserver数据到hbase
语法:
sqoop import --connect "jdbc:sqlserver://10.96.183.70:1433;database=SPC" --username mes --password mes+123 \
--query \
"select \
random+fdatec+boardsn+idstation+imulti as rowkey, \
fdate, \
idstation, \
imulti, \
cmodel, \
status, \
case when LEN(boardsn)=10 or LEN(boardsn)=11 then \
case when PATINDEX('%[^0-9A-Z]%',boardsn)>0 then 'ErrorSN' \
else boardsn end \
else 'ErrorSN' end as boardsn, \
trans, \
tb, \
path, \
opentime, \
lifecycle, \
case when len(line)=2 then left(line,1)+'0'+right(line,1) else line end as line, \
abside, \
realmodel, \
onlinecheck, \
modifier, \
modifydate, \
yfdate, \
tag, \
steelid, \
vendor, \
createdate, \
rearsq_speed, \
frontsq_pressure, \
rearsq_pressure, \
frontsq_standardspeed, \
frontsq_lowspeed, \
frontsq_highspeed, \
frontsq_st