1

我试图将 CSV 文件中的数据上传到我创建的空表中。但出现以下错误:

May 21, 2014 10:18:18 AM <INFO> Execution Progress.Initializing properties: 1%
May 21, 2014 10:18:18 AM <INFO> Execution Progress.Initialized connection id=in_file, CsvConnection, Dialect{CSV 1.0}, properties {}: 3%
May 21, 2014 10:18:19 AM <INFO> Execution Progress.Initialized connection id=db, JdbcConnection{com.teradata.jdbc.jdk6.JDK6_FastLoadManager_Connection}, Dialect{Teradata Teradata Database 13.10.07.24}, properties {statement.batchSize=100000}: 5%
May 21, 2014 10:18:19 AM <INFO> Execution Progress./etl/query[1] prepared: 10%
May 21, 2014 10:18:19 AM <INFO> Registered JMX mbean: scriptella:type=etl,url="file:/xxx/fastload.xml"
May 21, 2014 10:18:44 AM <INFO> Execution Progress./etl/query[1] executed: 95%
May 21, 2014 10:18:44 AM <INFO> Execution Progress.Complete
May 21, 2014 10:18:55 AM <WARNING> Unable to rollback transaction for connection CsvConnection: Transactions are not supported by CsvConnection
May 21, 2014 10:18:55 AM <SEVERE> Script /xxx/fastload.xml execution failed.
Unable to commit transaction - cannot flush cache
JDBC provider exception: Unable to commit transaction - cannot flush cache
Error codes: [HY000, 1154]
Driver exception: java.sql.BatchUpdateException: [Teradata JDBC Driver] [TeraJDBC 14.10.00.17] [Error 1154] [SQLState HY000] A failure occurred while inserting the batch of rows destined for database table "mydatabase"."myemptytable". Details of the failure can be found in the exception chain that is accessible with getNextException.

这是我的 fastload.xml 文件:

<!DOCTYPE etl SYSTEM "http://scriptella.javaforge.com/dtd/etl.dtd">
<etl>
<description>Scriptella  script</description>
<properties>
    <include href="$config"/> <!--Load from external properties file-->
</properties>
<connection id="in_file" driver="csv" url="$inputfile">
</connection>
<connection id="db" driver="$driver" url="$url" user="$user" password="$password" classpath="lib/terajdbc4.jar">
statement.batchSize=100000
</connection>

<query connection-id="in_file">
<!-- Empty query means select all columns -->
<script connection-id="db">
INSERT INTO  mydatabase.myemptytable VALUES (?1,?2,?3);
</script>
</query>

</etl>

这是我的连接网址:

url=jdbc:teradata://mypath/TMODE=ANSI,CHARSET=UTF8,TYPE=FASTLOAD

没有 FASTLOAD 的上传适用于同一个文件。我试图用谷歌搜索错误消息,但没有找到任何东西。有人知道这里有什么问题吗?谢谢。

4

0 回答 0