运行sqoop从sqlservre抽数时报错
source /var/lib/workflow/TDH-Client/init.sh
export HADOOP_USER_NAME=hdfs
CONDITIONS=1=1
sqoop import --connect 'jdbc:sqlserver://10.96.243.79:1433;username=a_lsumpdba;password=1234!Initial;database=OAGFP' -m 1 \
--delete-target-dir --target-dir /bigdata/oagfp/umsform \
--query "select * from LE.UMSForm where \$CONDITIONS" \
--hive-drop-import-delims --fetch-size 10000 --fields-terminated-by "\001" --null-string '\\N' --null-non-string '\\N';
Text.writeString(__dataOut, ContactPerson);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1508: error: cannot find symbol
Text.writeString(__dataOut, ContactPersonTelephone);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1514: error: cannot find symbol
Text.writeString(__dataOut, ContactPersonEmail);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1520: error: cannot find symbol
Text.writeString(__dataOut, RequestorID);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1526: error: cannot find symbol
Text.writeString(__dataOut, RequestorName);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1532: error: cannot find symbol
Text.writeString(__dataOut, RequestorLogonname);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1538: error: cannot find symbol
Text.writeString(__dataOut, RequestorCountry);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1544: error: cannot find symbol
Text.writeString(__dataOut, RequestorTelephone);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1550: error: cannot find symbol
Text.writeString(__dataOut, RequestorEmail);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1556: error: cannot find symbol
Text.writeString(__dataOut, OperatorID);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1562: error: cannot find symbol
Text.writeString(__dataOut, OperatorName);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1568: error: cannot find symbol
Text.writeString(__dataOut, OperatorLogonName);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1574: error: cannot find symbol
Text.writeString(__dataOut, Country);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1580: error: cannot find symbol
Text.writeString(__dataOut, CompanyCode);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1593: error: cannot find symbol
Text.writeString(__dataOut, NonPoPurchaseCategory);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1599: error: cannot find symbol
Text.writeString(__dataOut, CategoryRemark);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1605: error: cannot find symbol
Text.writeString(__dataOut, ContractNumber);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1611: error: cannot find symbol
Text.writeString(__dataOut, Currency);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1630: error: cannot find symbol
Text.writeString(__dataOut, PayingBankAccountNumber);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1636: error: cannot find symbol
Text.writeString(__dataOut, CheckToRequestorName);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1642: error: cannot find symbol
Text.writeString(__dataOut, CheckToRequestorTelephone);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1648: error: cannot find symbol
Text.writeString(__dataOut, BankConfirmationMail);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1654: error: cannot find symbol
Text.writeString(__dataOut, BeneficiaryName);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1660: error: cannot find symbol
Text.writeString(__dataOut, BeneficiaryAddress);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1666: error: cannot find symbol
Text.writeString(__dataOut, BeneficiaryBankName);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1672: error: cannot find symbol
Text.writeString(__dataOut, BankAccountNumber);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1678: error: cannot find symbol
Text.writeString(__dataOut, BankCode);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1684: error: cannot find symbol
Text.writeString(__dataOut, TaxID);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1738: error: cannot find symbol
Text.writeString(__dataOut, PaymentfileNumber);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1751: error: cannot find symbol
Text.writeString(__dataOut, Remark);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1770: error: cannot find symbol
Text.writeString(__dataOut, PONo);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1776: error: cannot find symbol
Text.writeString(__dataOut, GEO);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1782: error: cannot find symbol
Text.writeString(__dataOut, SID);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1788: error: cannot find symbol
Text.writeString(__dataOut, UMSAttachments);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1794: error: cannot find symbol
Text.writeString(__dataOut, TaxJurisdictionReport);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1800: error: cannot find symbol
Text.writeString(__dataOut, DeductableTaxCostCenter);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1806: error: cannot find symbol
Text.writeString(__dataOut, ServiceTax);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1812: error: cannot find symbol
Text.writeString(__dataOut, ServiceTaxAccount);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1818: error: cannot find symbol
Text.writeString(__dataOut, ServiceTaxCode);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1824: error: cannot find symbol
Text.writeString(__dataOut, Assignment);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1830: error: cannot find symbol
Text.writeString(__dataOut, Text);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1838: error: cannot find symbol
Text.writeString(__dataOut, ID);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1844: error: cannot find symbol
Text.writeString(__dataOut, Subject);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1850: error: cannot find symbol
Text.writeString(__dataOut, TicketNumber);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
/tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java:1856: error: cannot find symbol
Text.writeString(__dataOut, VendorID);
^
symbol: method writeString(DataOutput,String)
location: variable Text of type String
Note: /tmp/sqoop-UsageDB/compile/63ed4e1b876fc68c056677a27403e288/QueryResult.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
100 errors
2019-06-27 19:10:40,977 ERROR [main] tool.ImportTool (ImportTool.java:run(609)) - Encountered IOException running import job: java.io.IOException: Error returned by javac
at org.apache.sqoop.orm.CompilationManager.compile(CompilationManager.java:217)
at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:97)
at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478)
at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:601)
at org.apache.sqoop.Sqoop.run(Sqoop.java:143)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:179)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:218)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:227)
at org.apache.sqoop.Sqoop.main(Sqoop.java:236)
对应的是sqlserver FIle table;没办法指定--table.
网上查到说指定字符,就去检查下下字符,检查到原因时目标表中有列字段名叫Text,在抽数时将这个字段去掉了。
更改后如下
source /var/lib/workflow/TDH-Client/init.sh
export HADOOP_USER_NAME=hdfs
CONDITIONS=1=1
sqoop import --connect 'jdbc:sqlserver://10.96.243.79:1433;username=a_lsumpdba;password=1234!Initial;database=OAGFP' -m 1 \
--delete-target-dir --target-dir /bigdata/oagfp/umsform \
--query "select ID,Subject,TicketNumber,VendorID,VendorCode,VendorName,VendorAddress,ContactPerson,ContactPersonTelephone,ContactPersonEmail,RequestorID,RequestorName,RequestorLogonname,RequestorCountry,RequestorTelephone,RequestorEmail,OperatorID,OperatorName,OperatorLogonName,Country,CompanyCode,RequestDate,NonPoPurchaseCategory,CategoryRemark,ContractNumber,Currency,PayMethod,RequestedPayDate,PayingBankAccountNumber,CheckToRequestorName,CheckToRequestorTelephone,BankConfirmationMail,BeneficiaryName,BeneficiaryAddress,BeneficiaryBankName,BankAccountNumber,BankCode,TaxID,VendorsDataSource,TotalRequestPaymentAmount,ExchangeRate,ConfirmGoods,Status,PaymentType,PaymentResult,ManualPaymentType,PaymentfileNumber,ChangeTime,Remark,ValueDate,TotalInvoiceAmt,PONo,GEO,SID,UMSAttachments,TaxJurisdictionReport,DeductableTaxCostCenter,ServiceTax,ServiceTaxAccount,ServiceTaxCode,Assignment from LE.UMSForm where \$CONDITIONS" \
--hive-drop-import-delims --fetch-size 10000 --fields-terminated-by "\001" --null-string '\\N' --null-non-string '\\N';
网友评论