apache pig - Passing parameter in sqoop -


below sqoop cmd in shell script,

sqoop import --connect 'jdbc:sqlserver://190.148.155.91:1433;username=****;password=****;database=testdb' --query 'select dimfreqcellrelationid,ossc_rc, mecontext, enodebfunction,eutrancellfdd,eutranfreqrelation, eutrancellrelation dbo.dimcellrelation dimfreqcellrelationid > **$maxval** , $conditions'  --split-by oss --target-dir /testval; 

before executing command, have assigned value $maxval , when execute sqoop cmd value should passed in place of $maxval. thats not happning. possible pass parameter through sqoop. can please let me know if have suggestion achieve logic?

i believe problem seeing incorrect enclosing. using single quotes (') prohibit bash perform substitutions. need use double quotes (") if want use variables inside parameter. have careful not want substitute $conditions placeholder. try without sqoop:

jarcec@odie ~ % echo '$maxval , $conditions' $maxval , $conditions jarcec@odie ~ % echo "$maxval , $conditions"  ,  jarcec@odie ~ % echo "$maxval , $conditions" jarcec@odie ~ % export maxval=30 jarcec@odie ~ % echo "$maxval , $conditions" 30 ,  jarcec@odie ~ % echo "$maxval , \$conditions" 30 , $conditions 

Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -