-
Notifications
You must be signed in to change notification settings - Fork 319
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
[Bug report] Exception with Postgres join in playground #1154
Comments
@diqiu50 would you please take a look? |
It's a bug. we can run this sql to avoid it in the current version. |
The same happens on AWS so it is not just restricted to the playground. |
can confirm that this gets around the issue. I can see this is in one example but is not explained or mentioned in the documentation. |
… in PostgreSQL. (#1177) ### What changes were proposed in this pull request? Fix the issue with joins causing errors in PostgreSQL. Error message is "Cannot cast com.datastrato.gravitino.trino.connector.GravitinoColumnHandle to io.trino.plugin.jdbc.JdbcColumnHandle" ### Why are the changes needed? Fix: #1154 ### Does this PR introduce _any_ user-facing change? NO ### How was this patch tested? UT
… in PostgreSQL. (#1177) ### What changes were proposed in this pull request? Fix the issue with joins causing errors in PostgreSQL. Error message is "Cannot cast com.datastrato.gravitino.trino.connector.GravitinoColumnHandle to io.trino.plugin.jdbc.JdbcColumnHandle" ### Why are the changes needed? Fix: #1154 ### Does this PR introduce _any_ user-facing change? NO ### How was this patch tested? UT
… in PostgreSQL. (#1186) ### What changes were proposed in this pull request? Fix the issue with joins causing errors in PostgreSQL. Error message is "Cannot cast com.datastrato.gravitino.trino.connector.GravitinoColumnHandle to io.trino.plugin.jdbc.JdbcColumnHandle" ### Why are the changes needed? Fix: #1154 ### Does this PR introduce _any_ user-facing change? NO ### How was this patch tested? UT Co-authored-by: Yuhui <hui@datastrato.com>
Describe what's wrong
An exception is thrown when trying to join two tables in Postgres from a Trino connection in dbeaver.
Error message and/or stacktrace
org.jkiss.dbeaver.model.exec.DBCException: SQL Error [65536]: Query failed (#20231214_062414_00043_prk8b): java.lang.ClassCastException: Cannot cast com.datastrato.gravitino.trino.connector.GravitinoColumnHandle to io.trino.plugin.jdbc.JdbcColumnHandle
at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCResultSetImpl.nextRow(JDBCResultSetImpl.java:183)
at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.fetchQueryData(SQLQueryJob.java:874)
at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.executeStatement(SQLQueryJob.java:657)
at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.lambda$1(SQLQueryJob.java:510)
at org.jkiss.dbeaver.model.exec.DBExecUtils.tryExecuteRecover(DBExecUtils.java:190)
at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.executeSingleQuery(SQLQueryJob.java:517)
at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.extractData(SQLQueryJob.java:971)
at org.jkiss.dbeaver.ui.editors.sql.SQLEditor$QueryResultsContainer.readData(SQLEditor.java:4135)
at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.lambda$0(ResultSetJobDataRead.java:123)
at org.jkiss.dbeaver.model.exec.DBExecUtils.tryExecuteRecover(DBExecUtils.java:190)
at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.run(ResultSetJobDataRead.java:121)
at org.jkiss.dbeaver.ui.controls.resultset.ResultSetViewer$ResultSetDataPumpJob.run(ResultSetViewer.java:5151)
at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:105)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.sql.SQLException: Query failed (#20231214_062414_00043_prk8b): java.lang.ClassCastException: Cannot cast com.datastrato.gravitino.trino.connector.GravitinoColumnHandle to io.trino.plugin.jdbc.JdbcColumnHandle
at io.trino.jdbc.AbstractTrinoResultSet.resultsException(AbstractTrinoResultSet.java:1937)
at io.trino.jdbc.TrinoResultSet$ResultsPageIterator.computeNext(TrinoResultSet.java:294)
at io.trino.jdbc.TrinoResultSet$ResultsPageIterator.computeNext(TrinoResultSet.java:254)
at io.trino.jdbc.$internal.guava.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:145)
at io.trino.jdbc.$internal.guava.collect.AbstractIterator.hasNext(AbstractIterator.java:140)
at java.base/java.util.Spliterators$IteratorSpliterator.tryAdvance(Unknown Source)
at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.lambda$initPartialTraversalState$0(Unknown Source)
at java.base/java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.fillBuffer(Unknown Source)
at java.base/java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.doAdvance(Unknown Source)
at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.tryAdvance(Unknown Source)
at java.base/java.util.Spliterators$1Adapter.hasNext(Unknown Source)
at io.trino.jdbc.TrinoResultSet$AsyncIterator.lambda$new$1(TrinoResultSet.java:179)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.util.concurrent.CompletionException: java.lang.ClassCastException: Cannot cast com.datastrato.gravitino.trino.connector.GravitinoColumnHandle to io.trino.plugin.jdbc.JdbcColumnHandle
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
at java.base/java.util.concurrent.CompletableFuture.uniApplyNow(CompletableFuture.java:687)
at java.base/java.util.concurrent.CompletableFuture.uniApplyStage(CompletableFuture.java:662)
at java.base/java.util.concurrent.CompletableFuture.thenApply(CompletableFuture.java:2168)
at io.trino.plugin.jdbc.DynamicFilteringJdbcSplitSource.getNextBatch(DynamicFilteringJdbcSplitSource.java:57)
at io.trino.plugin.jdbc.JdbcDynamicFilteringSplitManager$DynamicFilteringSplitSource.getNextBatch(JdbcDynamicFilteringSplitManager.java:140)
at io.trino.split.ConnectorAwareSplitSource.getNextBatch(ConnectorAwareSplitSource.java:53)
at io.trino.split.TracingSplitSource.getNextBatch(TracingSplitSource.java:63)
at io.trino.split.BufferingSplitSource$GetNextBatch.fetchSplits(BufferingSplitSource.java:109)
at io.trino.split.BufferingSplitSource$GetNextBatch.lambda$fetchSplits$1(BufferingSplitSource.java:117)
at com.google.common.util.concurrent.AbstractTransformFuture$AsyncTransformFuture.doTransform(AbstractTransformFuture.java:223)
at com.google.common.util.concurrent.AbstractTransformFuture$AsyncTransformFuture.doTransform(AbstractTransformFuture.java:210)
at com.google.common.util.concurrent.AbstractTransformFuture.run(AbstractTransformFuture.java:123)
at com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:31)
at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1286)
at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:1055)
at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:782)
at com.google.common.util.concurrent.AbstractTransformFuture$TransformFuture.setResult(AbstractTransformFuture.java:257)
at com.google.common.util.concurrent.AbstractTransformFuture.run(AbstractTransformFuture.java:169)
at com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:31)
at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1286)
at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:1055)
at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:782)
at com.google.common.util.concurrent.SettableFuture.set(SettableFuture.java:49)
at io.airlift.concurrent.MoreFutures.lambda$toListenableFuture$11(MoreFutures.java:515)
at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863)
at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2147)
at io.airlift.concurrent.MoreFutures$UnmodifiableCompletableFuture.internalComplete(MoreFutures.java:648)
at io.airlift.concurrent.MoreFutures.lambda$unmodifiableFuture$2(MoreFutures.java:150)
at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863)
at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2147)
at io.airlift.concurrent.MoreFutures$2.onSuccess(MoreFutures.java:487)
at com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1133)
at com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:31)
at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1286)
at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:1055)
at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:782)
at io.airlift.concurrent.ExtendedSettableFuture.set(ExtendedSettableFuture.java:26)
at io.airlift.concurrent.ExtendedSettableFuture.lambda$setAsync$0(ExtendedSettableFuture.java:54)
at com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:31)
at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1286)
at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:1055)
at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:782)
at com.google.common.util.concurrent.SettableFuture.set(SettableFuture.java:49)
at io.trino.server.DynamicFilterService$DynamicFilterContext.lambda$new$1(DynamicFilterService.java:932)
at com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:31)
at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1286)
at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:1055)
at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:782)
at com.google.common.util.concurrent.SettableFuture.set(SettableFuture.java:49)
at io.trino.server.DynamicFilterService$DynamicFilterCollectionContext.setExpectedTaskCount(DynamicFilterService.java:883)
at io.trino.server.DynamicFilterService$DynamicFilterContext.lambda$updateExpectedTaskCount$5(DynamicFilterService.java:997)
at java.base/java.util.concurrent.ConcurrentHashMap.forEach(ConcurrentHashMap.java:1603)
at io.trino.server.DynamicFilterService$DynamicFilterContext.updateExpectedTaskCount(DynamicFilterService.java:991)
at io.trino.server.DynamicFilterService$DynamicFilterContext.addTaskDynamicFilters(DynamicFilterService.java:978)
at io.trino.server.DynamicFilterService.addTaskDynamicFilters(DynamicFilterService.java:400)
at io.trino.server.remotetask.DynamicFiltersFetcher.updateDynamicFilterDomains(DynamicFiltersFetcher.java:224)
at io.trino.server.remotetask.DynamicFiltersFetcher$DynamicFiltersResponseCallback.success(DynamicFiltersFetcher.java:168)
at io.trino.server.remotetask.DynamicFiltersFetcher$DynamicFiltersResponseCallback.success(DynamicFiltersFetcher.java:157)
at io.trino.server.remotetask.SimpleHttpResponseHandler.onSuccess(SimpleHttpResponseHandler.java:49)
at io.trino.server.remotetask.SimpleHttpResponseHandler.onSuccess(SimpleHttpResponseHandler.java:27)
at com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1133)
at io.airlift.concurrent.BoundedExecutor.drainQueue(BoundedExecutor.java:79)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.ClassCastException: Cannot cast com.datastrato.gravitino.trino.connector.GravitinoColumnHandle to io.trino.plugin.jdbc.JdbcColumnHandle
at java.base/java.lang.Class.cast(Class.java:3889)
at io.trino.spi.predicate.TupleDomain.transformKeys(TupleDomain.java:545)
at io.trino.plugin.jdbc.DynamicFilteringJdbcSplitSource.lambda$getNextBatch$1(DynamicFilteringJdbcSplitSource.java:59)
at java.base/java.util.concurrent.CompletableFuture.uniApplyNow(CompletableFuture.java:684)
... 68 more
How to reproduce
Run this query in a Trino connection in dbeaver.
Additional context
No response
The text was updated successfully, but these errors were encountered: