Passing Null Values To A Teradata Issue using Scaling JDBC

273 views
Skip to first unread message

JOHN THOMAS

unread,
Jul 13, 2014, 9:47:06 PM7/13/14
to cascadi...@googlegroups.com
Hi ,

I am trying to export data to Teradata from HDFS using scaling JDBC and its throwing below error .


Caused by: com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata JDBC Driver] [TeraJDBC ********] [Error 1063] [SQLState HY000] null is not supported as a data value with this variant of the setObject method; use the setNull method or the setObject method with a targetSqlType parameter




Column defintion i have used is as below .

   ColumnDefinition ("Name","CHAR(20) NULL")


and also tried .


   ColumnDefinition ("Name","java.sql.Types.CHAR(20) NULL")


Please help!!!

Regards,
Jonz

JOHN THOMAS

unread,
Jul 14, 2014, 4:33:33 AM7/14/14
to cascadi...@googlegroups.com
I have some Null values to be entered in teradata . Request your Immediate help !!! its bit urgent .

Andre Kelpe

unread,
Jul 14, 2014, 6:38:44 AM7/14/14
to cascadi...@googlegroups.com
If the table exists and does not allow for null types, you will not be able to write a null to it, unless you use SinkMode.REPLACE, which will drop and re-create the table.

- André


--
You received this message because you are subscribed to the Google Groups "cascading-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cascading-use...@googlegroups.com.
To post to this group, send email to cascadi...@googlegroups.com.
Visit this group at http://groups.google.com/group/cascading-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/cascading-user/dac55aee-440e-46b5-837f-8681855d6fe3%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
André Kelpe
an...@concurrentinc.com
http://concurrentinc.com

Joe Posner

unread,
Jul 14, 2014, 12:31:32 PM7/14/14
to cascadi...@googlegroups.com
The need to use "setNull" rather than "setObject" can be the results
of the internals of some JDBC drivers and not a Cascading issue; I
know Oracle used to have this requirement even if you were writing
direct JDBC code.

Can you post more details about what versions of the DB and driver you
are using?
> https://groups.google.com/d/msgid/cascading-user/CAA2tiY%2BLNqxePO5tDBDiHeJRMz-DQJmPU_1_EfQiwDYQh%2BCAhg%40mail.gmail.com.

JOHN THOMAS

unread,
Jul 14, 2014, 7:25:56 PM7/14/14
to cascadi...@googlegroups.com
Hi Andre ,

I am trying to insert values to table that allows null types. So issue is happening when i am trying to insert null values to fields that allows null values.

JOHN THOMAS

unread,
Jul 14, 2014, 7:30:07 PM7/14/14
to cascadi...@googlegroups.com
Hi ,

Driver : com.teradata.jdbc.TeraDriver
Db :terdata 

JOHN THOMAS

unread,
Jul 14, 2014, 9:18:00 PM7/14/14
to cascadi...@googlegroups.com
Hi Andre ,
I feel the root issue is Tuple Record in package cascading .jdbc  have a write methord 
public void write( PreparedStatement statement ) throws SQLException {
        for( int i = 0; i < tuple.size(); i++ )
            statement.setObject( i + 1, tuple.getObject( i ) );
    }


This statement.setObject needs to be change to   statement.setObject( i + 1, tuple.getObject( i ) , targetSqlType)

On Monday, 14 July 2014 20:38:44 UTC+10, Andre Kelpe wrote:

Andre Kelpe

unread,
Jul 15, 2014, 11:25:38 AM7/15/14
to cascadi...@googlegroups.com
Hi,

We do not support teradata in cascading-jdbc. Did you add that yourself? If so, you  will have to do, what Joe suggested:

https://forums.teradata.com/forum/third-party-software/passing-null-values-to-a-teradata-sp-using-teradata-net-provider-1-0

- André



For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages