Teradata LIMIT keyword issue

420 views
Skip to first unread message

jnkrish

unread,
Feb 11, 2016, 10:20:29 PM2/11/16
to cascading-user
Hello,

We are using the Git example to connect to Teradata and trying both FastExport/Default options in JDBC connection. We are getting following issue:

1) The SQL statement generated contains keyword LIMIT 100 OFFSET 100 and fails as LIMIT is not actually used in Teradata

 How do we get rid of the LIMIT?  Tried exploring options in JDBCTAP documentation but could not find.

 Select <column_names>  
 FROM t1 t1 LIMIT 100 OFFSET 100


connStr =  "jdbc:teradata://<server>/TMODE=ANSI,CHARSET=UTF8,TYPE=DEFAULT”
 
driver = "com.teradata.jdbc.TeraDriver”;


Tap exportTeradataTap = obj.createTeraDataDbTap(tdTable, connStr, dbUser, dbPass);



    public Tap createTeraDataDbTap( String tableName, String connectionUrl, String user, String password )
    {
    TableDesc tableDesc = new TableDesc( tableName, _urlsSinkColumnNames, _urlsSinkColumnDefs, primaryKeys );

    // Invoke TeradataDBInputFormat.class to pick up Teradata specific behaviour
    JDBCScheme scheme = new JDBCScheme( inFields, _urlsSinkColumnNames, "" );

    // Create standard JDBCTap
    Tap teradataTap = new JDBCTap( connectionUrl, user, password, driver, tableDesc, scheme );
    return teradataTap;
    }



Andre Kelpe

unread,
Feb 12, 2016, 4:57:44 AM2/12/16
to cascading-user
I think something is wrong in the tutorial. Sorry for that.

When using teradata, you have to use the TeradataTableDesc and the
TeradataDBInputformat and pass those to the JDBCTap constructor. These
are teradata specific sub-classes that work with teradata.

- 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 https://groups.google.com/group/cascading-user.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/cascading-user/b1836be9-9135-4496-a91e-51a4d13a14a5%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



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

jnkrish

unread,
Feb 12, 2016, 5:49:53 PM2/12/16
to cascading-user
Hi Andre,

 Thanks for reply. We could only find cascading-jdbc-core jar and not cascading-jdbc-teradata  as mentioned in the dependency below. So unable to find classes TeradataTableDesc and the TeradataDBInputformat

Can you please provide us a link or Maven dependency details so we can download the required jars.

dependencies {

  compile( group: 'cascading', name: 'cascading-core', version: cascadingVersion )

  compile( group: 'cascading', name: 'cascading-local', version: cascadingVersion )

  compile( group: 'cascading', name: 'cascading-hadoop2-mr1', version: cascadingVersion )

  compile( group: 'com.teradata', name: 'terajdbc4', version: teradataVersion )

  compile( group: 'com.teradata', name: 'tdgssconfig', version: teradataVersion )

  compile( group: 'cascading', name: 'cascading-jdbc-teradata', version: cascadingJDBCVersion )


  provided( group: 'org.apache.hadoop', name: 'hadoop-common', version: hadoopVersion )

  provided( group: 'org.apache.hadoop', name: 'hadoop-mapreduce-client-core', version: hadoopVersion )


}


Thanks

Andre Kelpe

unread,
Feb 14, 2016, 8:12:55 AM2/14/16
to cascading-user

jnkrish

unread,
Feb 23, 2016, 10:59:14 PM2/23/16
to cascading-user
Hi Andre,

 Thanks for the info. I referred to below link and got the Teradata classes. I created a jar with these and used it in my POM file. It worked, thanks lot. Is there any better way to do it?

Andre Kelpe

unread,
Feb 24, 2016, 5:40:51 AM2/24/16
to cascading-user
Since the teradata jdbc drivers aren't in a public maven repo, we
can't offer pre-compiled jar files. Maybe you can open a ticket at
teradata and ask them to provide a maven repo. Then we can offer
easier downloads.

- André
> https://groups.google.com/d/msgid/cascading-user/025aa5fc-7b75-451c-b207-707e003a9807%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages