-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Fix dereference in SQL routine #20181
Merged
wendigo
merged 1 commit into
trinodb:master
from
findepi:findepi/fix-dereference-in-sql-routine-2f9db1
Dec 21, 2023
Merged
Fix dereference in SQL routine #20181
wendigo
merged 1 commit into
trinodb:master
from
findepi:findepi/fix-dereference-in-sql-routine-2f9db1
Dec 21, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
martint
reviewed
Dec 20, 2023
testing/trino-testing/src/main/java/io/trino/testing/AbstractTestEngineOnlyQueries.java
Outdated
Show resolved
Hide resolved
testing/trino-testing/src/main/java/io/trino/testing/AbstractTestEngineOnlyQueries.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/sql/gen/DereferenceCodeGenerator.java
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/sql/relational/SqlToRowExpressionTranslator.java
Show resolved
Hide resolved
testing/trino-testing/src/main/java/io/trino/testing/AbstractTestEngineOnlyQueries.java
Outdated
Show resolved
Hide resolved
findepi
commented
Dec 20, 2023
Comment on lines
68
to
76
// TODO Fix LocalQueryRunner execution of functions | ||
assertThatThrownBy(super::testIssue19997) | ||
.isInstanceOf(AssertionError.class) | ||
.hasMessageContaining("[Rows for query [WITH FUNCTION format_topn(input map<varchar, bigint>)") | ||
.hasMessageContaining(""" | ||
Expecting actual: | ||
(null, null, null) | ||
to contain exactly in any order: | ||
[([AAA, AAA, BBB, BBB, BBB, CCC, CCC, CCC, DDD, DDD], {AAA=2, CCC=3, BBB=3}, CCC=3, BBB=3, AAA=2)]"""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently LocalQueryRunner and DistributedQueryRunner return different results for this test.
cc @electrum
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported as #20190
findepi
force-pushed
the
findepi/fix-dereference-in-sql-routine-2f9db1
branch
3 times, most recently
from
December 20, 2023 21:21
40acf4b
to
f91b601
Compare
wendigo
reviewed
Dec 20, 2023
core/trino-main/src/main/java/io/trino/testing/LocalQueryRunner.java
Outdated
Show resolved
Hide resolved
findepi
force-pushed
the
findepi/fix-dereference-in-sql-routine-2f9db1
branch
from
December 21, 2023 09:34
f91b601
to
873410b
Compare
When `ConstantExpression` was created with a Trino type and a value that didn't match this type's java type (for example Trino INTEGER with value being Integer, instead of Long), the `ConstantExpression` would fail to serialize to JSON. Such failure happens during sending task status updates to workers and is currently logged and ignored, leading to query hang. The problem could be triggered with SQL routines, which utilize `RowExpression` (including `ConstantExpression`) serialization. Thus, this fixes execution of SQL routines involving Row field dereference.
findepi
force-pushed
the
findepi/fix-dereference-in-sql-routine-2f9db1
branch
from
December 21, 2023 09:42
873410b
to
e567dbf
Compare
AC |
wendigo
approved these changes
Dec 21, 2023
Nice! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #19997