Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server 将数据从配置单元导出到SQL时发生Sqoop NoSuchElementException_Sql Server_Azure_Hadoop_Sqoop_Azure Hdinsight - Fatal编程技术网

Sql server 将数据从配置单元导出到SQL时发生Sqoop NoSuchElementException

Sql server 将数据从配置单元导出到SQL时发生Sqoop NoSuchElementException,sql-server,azure,hadoop,sqoop,azure-hdinsight,Sql Server,Azure,Hadoop,Sqoop,Azure Hdinsight,我正在尝试将配置单元表从Hdinsight群集导出到Azure SQL。当两个表中都有一列时,我可以这样做,但是如果列的数量更大,我有上面提到的例外。我已经尝试了不同的分隔符组合,但没有任何帮助 我创建了配置单元表,如下所示: create table test2 ( a string, b string ) row format delimited fields terminated by ','; SQL表具有以下架构: create table test1 ( a [nvar

我正在尝试将配置单元表从Hdinsight群集导出到Azure SQL。当两个表中都有一列时,我可以这样做,但是如果列的数量更大,我有上面提到的例外。我已经尝试了不同的分隔符组合,但没有任何帮助

我创建了配置单元表,如下所示:

create table test2
(
a string, 
b string
)
row format delimited fields terminated by ',';
SQL表具有以下架构:

create table test1 
(
    a [nvarchar](100),
    b [nvarchar](100)
);

create clustered index test1_clustered_index on test1(a);
我使用以下脚本导出数据:

$tableName = 'test1'

$connectionString = "jdbc:sqlserver://$sqlDatabaseServerName.database.windows.net;user=$sqlDatabaseLogin@$sqlDatabaseServerName;password=$sqlDatabasePassword;database=$databaseName"

$exportDir = "/hive/warehouse/test2"

$sqoopDef = New-AzureHDInsightSqoopJobDefinition -Command "export --connect $connectionString --table $tableName --export-dir $exportDir --fields-terminated-by ','"

$sqoopJob = Start-AzureHDInsightJob -Cluster $clusterName -JobDefinition $sqoopDef 
作业日志如下所示:

15/01/07 00:02:46 INFO mapreduce.Job: Task Id : attempt_1420540952382_0059_m_000000_1, Status : FAILED
Error: java.io.IOException: Can't export data, please check failed map task logs
    at org.apache.sqoop.mapreduce.TextExportMapper.map(TextExportMapper.java:112)
    at org.apache.sqoop.mapreduce.TextExportMapper.map(TextExportMapper.java:39)
    at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:145)
    at org.apache.sqoop.mapreduce.AutoProgressMapper.run(AutoProgressMapper.java:64)
    at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:764)
    at org.apache.hadoop.mapred.MapTask.run(MapTask.java:340)
    at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:168)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:415)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1594)
    at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:163)
Caused by: java.lang.RuntimeException: Can't parse input data: 'a,b'
    at test1.__loadFromFields(test1.java:204)
    at test1.parse(test1.java:147)
    at org.apache.sqoop.mapreduce.TextExportMapper.map(TextExportMapper.java:83)
    ... 10 more
Caused by: java.util.NoSuchElementException
    at java.util.ArrayList$Itr.next(ArrayList.java:834)
    at test1.__loadFromFields(test1.java:199)
    ... 12 more
我做错了什么?提前谢谢