sqoop import --connect 'jdbc:sybase:Tds:10.100.*.***:5500/DATABASE=****' --driver 'com.sybase.jdbc3.jdbc.SybDriver' --username "keswara" --password "****" --target-dir "/user/keswara/WT_CONSUMERSTATS" --verbose --query "select c.YEARMONTH as d_stat_yearmonth,b.CONSNO,a.CONSCURRJDGMNTNUM as d_conscurrjdgmntnum,a.CONSCURRDFLTNUM as d_conscurrdfltnum,a.CONSCURRNOTICENUM as d_conscurrnoticenum,a.CONSCURRNOTRLBONDNUM as d_conscurrnotrlbondnum,a.CONSCURRDFLTADMINNUM as d_conscurrdfltadminnum,a.AMNISTYIND as d_amnisty_ind,a.NCRCREDITACTIVE as d_ncr_credit_active_ind,b.ACTIVEIND as d_active_ind,a.ESTINCOME as d_income,'d_create_date' as d_create_date,e.SUBURBCODE as d_physaddrsuburb_code,
a.ENQHARDTOTALNUM as d_enqhardtotalnum,a.ENQSOFTTOTALNUM as d_enqsofttotalnum,a.ENQHARDNUMMONTH as d_enqhardnummonth,a.ENQSOFTNUMMONTH as d_enqsoftnummonth,a.ENQTOTALNUM as d_enqtotalnum,a.ENQTOTALNUMMONTH as d_enqtotalnummonth,'d_cug' as d_cug,a.CCACRWORSTEVER as d_crworstever,a.CCAINSWORSTEVER as d_insworstever,a.CCACRWORSTEVER as d_worstever,a.CCANUMACC as d_numacc,a.CCANUMOPENACC as d_numopenacc,a.CCANUMCLOSEDACC as d_numclosedacc,a.CCANUMNEGCLOSEDACC as d_numnegclosedacc,a.CCANUMPOSCLOSEDACC as d_numposclosedacc,a.CCANUMACTIVEACC as d_numactiveacc,a.CCANUMWRITEOFFS as d_numwriteoffs,a.CCANUMDECEASEDWRITEOFFS as d_numdeceasedwriteoffs,
a.CCANUMHANDEDOVER as d_numhandedover,a.CCANUMCRCARDREVOKE as d_numcrcardrevoke,a.CCANUMREPO as d_numrepo,a.CCATOTALINSTALMENTAMT as d_totalinstalmentamt,a.CCATOTALOPENBAL as d_totalopenbal,a.CCATOTALCURRBAL as d_totalcurrbal,a.CCATOTALOVDUECRAMT as d_totalovduecramt,a.CCATOTALOVDUEDRAMT as d_totalovduedramt,a.CCANUMPAIDUPDEFACC as d_numpaidupdefacc,a.CCANUMSUSPENDEDACC as d_numsuspendedacc,a.CCANUMFROZENACC as d_numfrozenacc,d.SCORE as d_con_no,d.EXCLUSIONCODE as d_exclusion_code,'d_score_date' as d_score_date from dw.FT_CONSUMERSTATS a
inner join dw.DM_CONSUMER as b on a.CONSKEY = b.CONSKEY,inner join dw.DM_MONTH as c on c.MONTHKEY = a.MONTHKEY,inner join dw.FT_CONSUMER_SCORE as d on d.CONSKEY = b.CONSKEY,inner join dw.DM_SUBURB as e on b.SUBURBKEY = e.SUBURBKEY where yearmonth = 201501 AND \$CONDITIONS" --split-by 1 --verbose --create-hive-table --hive-table wt_consumer_stats --hive-import --map-column-hive d_stat_yearmonth=integer,d_con_no=integer,d_conscurrjdgmntnum=integer,d_conscurrdfltnum=integer,d_conscurrnoticenum=integer,d_conscurrnotrlbondnum=integer,d_conscurrdfltadminnum=integer,d_amnisty_ind=string,d_ncr_credit_active_ind=string,d_active_ind=string,d_income=integer,d_create_date=datetime,d_physaddrsuburb_code=integer,d_enqhardtotalnum=integer,d_enqsofttotalnum=integer,
d_enqhardnummonth=integer,d_enqsoftnummonth=integer,d_enqtotalnum=integer,d_enqtotalnummonth=integer,d_cug=string,d_crworstever=string,d_insworstever=string,d_worstever=string,d_numacc=integer,d_numopenacc=integer,d_numclosedacc=integer,d_numnegclosedacc=integer,d_numposclosedacc=integer,d_numactiveacc=integer,d_numwriteoffs=integer,d_numdeceasedwriteoffs=integer,d_numhandedover=integer,d_numcrcardrevoke=integer,d_numrepo=integer,d_totalinstalmentamt=decimal,d_totalopenbal=decimal,d_totalcurrbal=decimal,d_totalovduecramt=decimal,d_totalovduedramt=decimal,d_numpaidupdefacc=integer,d_numsuspendedacc=integer,d_numfrozenacc=integer,d_score_version=string,d_score=integer,d_exclusion_code=string,d_score_date=integer
回答
你試過類似的東西嗎?
sqoop import --connect'jdbc:sybase:Tds:10.100。*。***:5500/DATABASE = ****'--driver'com.sybase.jdbc3.jdbc.SybDriver'--username 「keswara」--password「****」--target-dir「/ user/keswara/WT_CONSUMERSTATS」--verbose --query「select * from( select c.YEARMONTH as d_stat_yearmonth,b.CONSNO,a。 CONSCURRJDGMNTNUM爲d_conscurrjdgmntnum,a.CONSCURRDFLTNUM爲d_conscurrdfltnum,a.CONSCURRNOTICENUM爲d_conscurrnoticenum,a.CONSCURRNOTRLBONDNUM爲d_conscurrnotrlbondnum,a.CONSCURRDFLTADMINNUM爲d_conscurrdfltadminnum,a.AMNISTYIND爲d_amnisty_ind,a.NCRCREDITACTIVE爲d_ncr_credit_active_ind,b.ACTIVEIND爲d_active_ind,a.ESTINCOME作爲d_income,'d_create_date'爲d_create_date,e.SUBURBCODE爲d_physaddrsuburb_code, a.ENQHARDTOTALNUM as d_enqhardtotalnum,a.ENQSOFTTOTALNUM as d_enqsofttotalnum,a.ENQHARDNUMMONTH as d_enqhar dnummonth,a.ENQSOFTNUMMONTH如d_enqsoftnummonth,a.ENQTOTALNUM如d_enqtotalnum,a.ENQTOTALNUMMONTH如d_enqtotalnummonth, 'd_cug' 作爲d_cug,a.CCACRWORSTEVER如d_crworstever,a.CCAINSWORSTEVER如d_insworstever,a.CCACRWORSTEVER如d_worstever,a.CCANUMACC如d_numacc, a.CCANUMOPENACC如d_numopenacc,a.CCANUMCLOSEDACC如d_numclosedacc,a.CCANUMNEGCLOSEDACC如d_numnegclosedacc,a.CCANUMPOSCLOSEDACC如d_numposclosedacc,a.CCANUMACTIVEACC如d_numactiveacc,a.CCANUMWRITEOFFS如d_numwriteoffs,a.CCANUMDECEASEDWRITEOFFS如d_numdeceasedwriteoffs, a.CCANUMHANDEDOVER作爲d_numhandedover,一個.CCANUMCRCARDREVOKE如d_numcrcardrevoke,a.CCANUMREPO如d_numrepo,a.CCATOTALINSTALMENTAMT如d_totalinstalmentamt,a.CCATOTALOPENBAL如d_totalopenbal,a.CCATOTALCURRBAL如d_totalcurrbal,a.CCATOTALOVDUECRAMT如d_totalovduecramt,a.CCATOTALOVDUEDRAMT如d_totalovduedramt,a.CCANUMPAIDUPDEFACC如d_numpaidupdefacc,a.CCANUMSUSPENDEDACC作爲d_numsuspendedacc,a.CCANUMFROZENACC作爲d_numfrozena cc,d.SCORE as d_con_no,d.EXCLUSIONCODE as d_exclusion_code,'d_score_date'as d_score_date from dw.FT_CONSUMERSTATS a inner join dw.DM_CONSUMER as b on a.CONSKEY = b.CONSKEY,inner join dw.DM_MONTH as c on c .MONTHKEY = a.MONTHKEY,inner join dw.FT_CONSUMER_SCORE as d on d.CONSKEY = b.CONSKEY,inner join dw.DM_SUBURB as e。b.SUBURBKEY = e.SUBURBKEY where yearmonth = 201501 )t10 where \ $ CONDITIONS「 --split-by 1 --verbose --create-hive-table --hive-table wt_consumer_stats --hive-import --map-column-hive d_stat_yearmonth =整數,d_con_no =整數,d_conscurrjdgmntnum =整數,d_conscurrdfltnum =整數, d_conscurrnoticenum =整數,d_conscurrnotrlbondnum =整數,d_conscurrdfltadminnum =整數,d_amnisty_ind =串,d_ncr_credit_active_ind =串,d_active_ind =串,d_income =整數,d_create_date =日期時間,d_physaddrsuburb_code =整數,d_enqhardtotalnum =整數,d_enqsofttotalnum =整數, d_enqhardnummonth =整數,d_enqsoftnummonth =整數,d_enqtotalnum =整數,d_enqtotalnummonth =整數,d_cug =串,d_crworstever =串,d_insworstever =串,d_worstever =串,d_numacc =整數,d_numopenacc =整數,d_numclosedacc =整數,d_numnegclosedacc =整數,d_numposclosedacc =整數, d_numactiveacc =整數,d_numwriteoffs =整數,d_numdeceasedwriteoffs =整數,d_numhandedover =整數,d_numcrcardrevoke =整數,d_numrepo =整數,d_totalinstalmentamt =十進制,d_totalopenbal =十進制,d_totalcurrbal =十進制,d_totalovduecramt =十進制,d_totalovduedramt =十進制,d_numpaidupdefacc =整數,d_numsuspendedacc =整數,d_numfrozenacc =整數,d_score_version =字符串,d_score =整數,d_exclusion_code =字符串,d_score_date =整數
- 1. Postgresql包含在哪裏條款
- 2. Oracle提高查詢在哪裏條款
- 3. 在哪裏條款
- 4. 查詢輸入必須包含至少一個表或查詢
- 5. 加入哪裏條款?
- 6. 結果必須包含所有查詢條件的過濾器/搜索查詢條款
- 7. 連接在哪裏條款
- 8. MYSQL Subselect在哪裏條款
- 9. 問題在哪裏條款
- 10. Linq查詢在哪裏包含
- 11. EF不包括在哪裏條款
- 12. 必須在哪裏寫WriteConcern?
- 13. 光標與AND在哪裏條款
- 14. 在sqoop導入中的AND \ $ CONDITIONS被澄清,沒有任何導入,爲什麼?
- 15. 雄辯地加入在哪裏條款
- 16. 重構在哪裏條款
- 17. 號碼通配符在哪裏條款
- 18. 哪裏條款0結果
- 19. LINQ查詢中沒有包含哪裏
- 20. CASE構造在哪裏條款
- 21. 在哪裏條款案例
- 22. SQL - 「IF」在哪裏條款
- 23. Substrack在哪裏條款
- 24. 案例在哪裏條款
- 25. 流利的Api包括哪裏條款
- 26. Linq在哪裏條入
- 27. 再次,變量在哪裏條款
- 28. VBA代碼「查詢輸入必須至少包含一個表或查詢」
- 29. MySQL條件查詢裏面的條款
- 30. SQL案例在哪裏條款
這裏有什麼問題?在這裏只發布命令的相關部分... – franklinsijo
當我運行這個腳本時...''查詢必須包含'$ CONDITIONS'在where子句「!!!這是個問題!:) – karthee
但@ karthee你的'sqoop'命令已經包含了'$ CONDITIONS',你仍然得到錯誤或者需要解釋爲什麼需要它嗎? – franklinsijo