Skip to main content
Apr 23, 2018 8:47 AM UTC
Question

How to invoke athena query editor from a thingworx service?

I am able to connect to athena with jdbc extension. I created a service including sql query which I want to run on athena.
Whenever I try to invoke the service, I am able to see the service hit in athena history with a failed log as follows,
/////
2018-04-23 14:06:15.052+0530 [L: ERROR] [O: c.t.w.BaseService] [I: ] [U: user] [S: ] [T: https-jsse-nio-8443-exec-3] [context: com.thingworx.webservices.context.HttpExecutionContext@4e2d91c9][message: Unable to Invoke Service hitAthena on athenaNew : Execute Update failed: java.sql.SQLException: [Simba][AthenaJDBC](100071) An error has been thrown from the AWS Athena client. Only one sql statement is allowed. Got: SELECT * FROM (select * from "data"."table";) T LIMIT 0]
/////

4 replies

Apr 23, 2018 11:25 AM UTC

Hi @chaitanya could you please share your sql statement here?

chaitanyaAuthor
Apr 24, 2018 4:57 AM UTC

sHi @supandey,

My Sql statement is "select * from "databaseName"."tableName";

 

Please find attached configuration  screenshot for thing created with imported jdbc extension

Apr 24, 2018 9:19 AM UTC

@chaitanya are you attempting to execute that statement with quotation marks? I don't think you'll need that. BTW what kind of query handler are you using for select statement?