Incorrect syntax near 'LIMIT'

746 views
Skip to first unread message

Sudarshan Thakur

unread,
May 24, 2016, 6:39:52 AM5/24/16
to CDAP User
Hi Thanks for the reply .

i dont know why connection is different from jdbc odbc connection although is uses same driver .
and also the way we write query is also different .
i wrote this query that does not have ant LIMIT key word but getting this exception all time .

Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near 'LIMIT'.

                "importQuery": "select * from table where col<10",
                "countQuery": "select count(*) from table where col<10"

Same query works fine at other place ...

Albert Shau

unread,
May 24, 2016, 1:45:02 PM5/24/16
to Sudarshan Thakur, CDAP User
Hi Sudar,

This is due to how Sqoop splits data. It inserts limit offset into your query in order to split the db query across multiple mappers. This is not good, as limit offset is a bad access pattern, and it also uses non-standard SQL.

In CDAP 3.3, you can use the Teradata source instead of the Database source, which works in a very similar way, except you need to specify a field to split on, a bounding query to determine the min and max values for that field, and your import query needs to include 'where $CONDITIONS' in it. The Sqoop input format will replace '$CONDITIONS' with a value range on the split field.

Note that in CDAP 3.4, we've removed the 'Teradata' plugin and moved its behavior to the Database plugin because of these issues.

Regards,
Albert

--
You received this message because you are subscribed to the Google Groups "CDAP User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cdap-user+...@googlegroups.com.
To post to this group, send email to cdap...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cdap-user/00a1fd49-fca3-46e7-b053-08c4b4c624a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages