-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Add support for passthrough Elasticsearch queries #15900
Conversation
189d06c
to
c30b2e9
Compare
The Trino PR says it depends on https://github.com/trinodb/trino/pull/3718/files, but it looks to me like we already have it? |
One note, we should also bring the elastic search connector doc up to date trinodb/trino@f776741 |
Yes, we have it already. |
I'll add it. |
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.
This looks good to me modulo the doc changes and the unresolved question about that error code. Whether we should take all the semantic error code removal changes or whether there is a different better error code to use in this case.
Pulling up to a higher level I was a little surprised the overlap in functionality between plain text pass through queries and base32 passthrough queries. I wonder what drove the introduction of base32 encoded passthrough.
I also found during review that we are missing limit and filter pushdown for ES and that isn't in the list of targeted improvements.
@@ -151,4 +172,76 @@ public boolean equals(Object obj) | |||
Objects.equals(this.extraInfo, other.extraInfo) && | |||
Objects.equals(this.hidden, other.hidden); | |||
} | |||
|
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.
This isn't all of trinodb/trino@6415b9a
It makes sense as a separate commit more.
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.
Yeah, I'll commit separately next time. Thanks
@@ -65,6 +65,7 @@ | |||
INVALID_ANALYZE_PROPERTY(0x0000_002A, USER_ERROR), | |||
GENERATED_BYTECODE_TOO_LARGE(0x0000_002B, USER_ERROR), | |||
WARNING_AS_ERROR(0x0000_002C, USER_ERROR), | |||
INVALID_ARGUMENTS(0x0000_002D, USER_ERROR), |
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.
Hmm we don't have martint/trino@1f40322 so it's questionable whether this makes sense in isolation or if we should use some other existing error code.
Martin's reasoning seems sound. @arhimondr @rongrong @kaikalur do you have any opinions on direction for error codes?
Yes, we ready have it. |
The failed test is not related. Looks like a network problem on CI. |
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.
Documentation commit needs a co-author and link to the source. Can you also squash and clean up the history?
Cherry-pick of trinodb/trino#3735 This allows running queries over the results of a raw Elasticsearch query. It extends the syntax of the enhanced ES table names with the following: SELECT * FROM es.default."<index>$query:<base32-encoded ES query>" The query is base32-encoded to avoid having to deal with escaping quotes and case sensitivity issues in table identifiers. The result of these query tables is a table with a single row and a single column named "result" of type JSON. Co-authored-by: Martin Traverso <[email protected]> Co-authored-by: Manfred Moser <[email protected]>
2dd7d35
to
9a2c06e
Compare
Added co-author, thanks. |
@zhenxiao do you have time to review/merge this? |
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.
looks good
Cherry-pick of trinodb/trino#3735
This allows running queries over the results of a raw Elasticsearch query.
It extends the syntax of the enhanced ES table names with the following:
SELECT * FROM es.default."$query:"
The query is base32-encoded to avoid having to deal with escaping quotes and case
sensitivity issues in table identifiers.
The result of these query tables is a table with a single row and a single column
named "result" of type JSON.
Co-authored-by: Martin Traverso [email protected]