-
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 user/password auth - Elasticsearch #16524
Conversation
09d857b
to
e017572
Compare
e0b6f75
to
a5d8bb9
Compare
Why hasn't this PR been submitted yet? Anyone knows some news? |
This pull request has been automatically marked as stale because it has not had recent activity. If you'd still like this PR merged, please comment on the task, make sure you've addressed reviewer comments, and rebase on the latest master. Thank you for your contributions! |
Reviewed in #15877 |
hi @v-jizhang could you please resolved the conflict? |
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.
I'll leave @zhenxiao to do a proper review, but just a couple things I noticed.
@@ -53,6 +54,11 @@ public QueryAssertions(Session session) | |||
runner = new LocalQueryRunner(session); |
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.
would be good to update this constructor to call the new one
this(new LocalQueryRunner(requireNonNull(session, "session is null")))
@@ -108,8 +108,13 @@ public void addResults(QueryStatusInfo statusInfo, QueryData data) | |||
throw new UncheckedIOException("Error loading data into Elasticsearch index: " + tableName, e); | |||
} | |||
} | |||
client.bulk(request).actionGet(); | |||
client.admin().indices().flush(flushRequest(tableName)).actionGet(); | |||
request.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE); |
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.
static import IMMEDIATE
@@ -120,6 +120,9 @@ public static Session createSession() | |||
public static void main(String[] args) | |||
throws Exception | |||
{ | |||
// To start Elasticsearch: |
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.
Can you add a readme too with any instructions?
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.
Working on it.
Cherry-pick of trinodb/trino@bd4b3dd Co-authored-by: Martin Traverso <mtraverso@gmail.com>
Cherry-pick of trinodb/trino#3331 Co-authored-by: Martin Traverso <mtraverso@gmail.com>
Cherry-pick of trinodb/trino@7efb49c Co-authored-by: Martin Traverso <mtraverso@gmail.com>
Cherry-pick of trinodb/trino@a381258 Co-authored-by: Martin Traverso <mtraverso@gmail.com>
916ebbd
to
4d788cd
Compare
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.
hi @v-jizhang nice work
looks good. 2 minor things
@@ -32,7 +32,8 @@ | |||
{ | |||
public enum Security | |||
{ | |||
AWS | |||
AWS, | |||
PASSWORD, |
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.
should we remove the ,
after PASSWORD
?
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.
Removed.
@@ -57,12 +57,15 @@ | |||
protected QueryRunner createQueryRunner() | |||
throws Exception | |||
{ | |||
elasticsearch = new ElasticsearchServer(); | |||
elasticsearch = new ElasticsearchServer("docker.elastic.co/elasticsearch/elasticsearch-oss:6.0.0", ImmutableMap.of()); |
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.
shall we make it a constant or configurable?
docker.elastic.co/elasticsearch/elasticsearch-oss:6.0.0
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.
kindly ping
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.
Made it a constant. Thanks for your reviews.
702ffe7
to
84ee838
Compare
looks good. @v-jizhang could you please take a look at the 2 failing tests? |
nice. thank you, @v-jizhang could you please merge the last commit into previous ones? |
Cherry-pick of trinodb/trino#4165 Co-authored-by: Martin Traverso <mtraverso@gmail.com>
17b0905
to
9542b19
Compare
Cherry-pick of
trinodb/trino@bd4b3dd
Co-authored-by: Martin Traverso mtraverso@gmail.com
Test plan - (Please fill in how you tested your changes)