Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redshift driver 2.1.0.11 is not supporting batch operation using jooq #82

Open
muskaan62 opened this issue Mar 1, 2023 · 1 comment

Comments

@muskaan62
Copy link

muskaan62 commented Mar 1, 2023

Driver version

2.1.0.11

Client Operating System

ubuntu 20.04

JAVA/JVM version

open jdk 11.0.18

Problem description

Redshift driver is not supporting the batch operation with jooq(version 3.9.1) library..when trying to execute multiple statements at a time.

Error message/stack trace:
Exception in thread "main" java.sql.BatchUpdateException: Batch entry 1 was aborted: Too many update results were returned. Call getNextException to see other errors in the batch.
at com.amazon.redshift.jdbc.BatchResultHandler.handleError(BatchResultHandler.java:167)
at com.amazon.redshift.jdbc.BatchResultHandler.handleCommandStatus(BatchResultHandler.java:108)
at com.amazon.redshift.core.ResultHandlerDelegate.handleCommandStatus(ResultHandlerDelegate.java:40)
at com.amazon.redshift.core.v3.QueryExecutorImpl$1.handleCommandStatus(QueryExecutorImpl.java:669)
at com.amazon.redshift.core.v3.QueryExecutorImpl.interpretCommandStatus(QueryExecutorImpl.java:2650)
at com.amazon.redshift.core.v3.QueryExecutorImpl.processResultsOnThread(QueryExecutorImpl.java:2150)
at com.amazon.redshift.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1874)
at com.amazon.redshift.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1866)
at com.amazon.redshift.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:593)
at com.amazon.redshift.jdbc.RedshiftStatementImpl.internalExecuteBatch(RedshiftStatementImpl.java:984)
at com.amazon.redshift.jdbc.RedshiftStatementImpl.executeBatch(RedshiftStatementImpl.java:1012)
at org.jooq.tools.jdbc.DefaultStatement.executeBatch(DefaultStatement.java:93)
at org.jooq.tools.jdbc.DefaultStatement.executeBatch(DefaultStatement.java:93)
at org.jooq.impl.BatchMultiple.execute(BatchMultiple.java:106)
at org.jooq.impl.BatchMultiple.execute(BatchMultiple.java:78)
at Main.main(Main.java:39)
Caused by: com.amazon.redshift.util.RedshiftException: Too many update results were returned.
... 15 more

Reproduction code

String q = "insert into public.multi_test_Testtable values(111);insert into public.multi_test_Testatble values(222);";
DSLContext context = DSL.using(con, SQLDialect.REDSHIFT);
Query Q1 = context.query(q);
arrayList.add(Q1);
batch= context.batch(arrayList);
try {
result = batch.execute();
} catch (Throwable e) {
if(e.getCause() instanceof BatchUpdateException)
throw (BatchUpdateException)e.getCause();
}

@bhvkshah
Copy link
Contributor

bhvkshah commented Mar 1, 2023

Thanks for submitting this issue, we will look into it and get back to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants