Teradata JDBC Pagination


(Jennifer Kirchner) #1

I am new to the Elastic Stack. I'm using Logstash to load data from Teradata into ElastiSearch. I want to implement jdbc_paging_enabled, but Logstash is wrapping my sql statement in a SELECT count(*) AS "COUNT" FROM () AS "T1" LIMIT 1. This is throwing an exception:
[2017-05-24T10:33:00,377][WARN ][logstash.inputs.jdbc ] Exception when executing JDBC query {:exception=>#<Sequel::DatabaseError: Java::JavaSql::SQLException: [Teradata Database] [TeraJDBC 14.10.00.44] [Error 3706] [SQLState 42000] Syntax error: expected something between the word 'T1' and the 'LIMIT' keyword.>}
The query executes fine without the LIMIT 1. Is there an option that I need to have enabled for the query to be wrapped properly?
jdbc_driver_library => "/dha/download/terajdbc4.jar,/dha/download/tdgssconfig.jar"
jdbc_driver_class => "com.teradata.jdbc.TeraDriver"
jdbc_connection_string => "jdbc:teradata://<database_domain>/DATABASE=<database_name>"
jdbc_validate_connection => true
jdbc_user => "<username>"
jdbc_password => "<password>"
jdbc_fetch_size => 200000
jdbc_paging_enabled => true
jdbc_page_size => 200000
clean_run => false

Please see Result limits:

Teradata uses keyword TOP and SAMPLE


(system) #2

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.