Redshift: The JDBC storage plugin failed while trying setup the SQL query

The queries worked on v3.1.8, now throw this error, since I upgraded to 3.1.9
The JDBC storage plugin failed while trying setup the SQL query.


here is the profile of the failed query. (44.3 KB)

Record fetch size: 0
Enable legacy dialect: checked

i am also getting these logs in the master

 2019-04-16T18:00:11.383+0000: [GC (Allocation Failure) [PSYoungGen: 58560K->2432K(72192K)] 213357K->159421K(247296K), 0.0055391 secs] [Times: user=0.03 sys=0.00, real=0.00 secs] 
2019-04-16T18:00:11.479+0000: [GC (Allocation Failure) [PSYoungGen: 60800K->1664K(71680K)] 217789K->160969K(246784K), 0.0052010 secs] [Times: user=0.03 sys=0.00, real=0.01 secs] 
2019-04-16T18:00:11.575+0000: [GC (Allocation Failure) [PSYoungGen: 60032K->1056K(72704K)] 219337K->161945K(247808K), 0.0048196 secs] [Times: user=0.02 sys=0.00, real=0.01 secs] 
2019-04-16T18:00:11.699+0000: [GC (Allocation Failure) [PSYoungGen: 60960K->3108K(72704K)] 221849K->164829K(247808K), 0.0183040 secs] [Times: user=0.11 sys=0.00, real=0.02 secs] - - [16/Apr/2019:18:00:11 +0000] "GET /apiv2/job/2349f07a-1202-5b43-f392-e496318b6000/details HTTP/1.1" 200 1446 "" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"
2019-04-16 18:00:11,967 [FABRIC-rpc-event-queue] INFO - Fragment 2349e7d8-646b-535f-31a4-fc69fbd85a00:0:0 failed, cancelling remaining fragments.
2019-04-16 18:00:11,971 [out-of-band-observer] INFO  query.logger - {"queryId":"2349e7d8-646b-535f-31a4-fc69fbd85a00","schema":"[us-patents]","queryText":"SELECT \n    patent_id, \n    test_value_data.\"date\" AS \"patent_date\", \n    kind, \n    num_claims, \n    number, \n    assignee_id, \n    organization\nFROM us_patents.test_value_data AS test_value_data","start":1555437607277,"finish":1555437611967,"outcome":"FAILED","username":"rohithzr"}
2019-04-16 18:00:11,979 [FABRIC-rpc-event-queue] WARN - Dropping request to move to COMPLETED state as query is already at FAILED state (which is terminal).


more logs

starting dremio
rename to txt from zip. (398.0 KB)

Hello @Rohithzr,

If you look at the profile, under the Planning tab there’s a section called the Final Physical Transformation. This is the query plan that is executed and you can see that a large part of the query is pushed down into the Redshift source. It is during that pushdown that we see the root error (as can be seen in the verbose error message in the profile)

(java.sql.SQLException) Amazon Invalid operation: function datediff(date, timestamp without time zone) does not exist;

This query references several virtual datasets that call the function datediff which is not supported in Dremio. Specifically us_patents.all_forward_citation_counts and us_patents.all_backward_citation_counts call this function.

Can you successfully run queries against those virtual datasets?

If not, you can try a couple of things:

  1. Disable “Legacy dialect”
    … or …
  2. Replace the call to datediff with an equivalent call to Dremio’s timestampdiff