-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Feature][connector-elasticsearch] elasticsearch source support PIT #9150
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
[Feature][connector-elasticsearch] elasticsearch source support PIT #9150
Conversation
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.
Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- seatunnel-e2e/seatunnel-connector-v2-e2e/connector-elasticsearch-e2e/src/test/resources/elasticsearch/elasticsearch_source_with_pit.conf: Language not supported
Map<String, String> sortField = new HashMap<>(); | ||
sortField.put("order", "asc"); | ||
sort.add(Collections.singletonMap("_shard_doc", "asc")); |
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.
The variable 'sortField' is assigned but never used; consider removing it to clean up the code.
Map<String, String> sortField = new HashMap<>(); | |
sortField.put("order", "asc"); | |
sort.add(Collections.singletonMap("_shard_doc", "asc")); |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
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.
Do you have more information on PIT vs scroll? |
|
@@ -87,4 +88,25 @@ public class ElasticsearchSourceOptions extends ElasticsearchBaseOptions { | |||
Collections.singletonMap("match_all", new HashMap<String, String>())) | |||
.withDescription( | |||
"Elasticsearch query language. You can control the range of data read"); | |||
|
|||
public static final Option<Boolean> USE_PIT = |
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.
How about add new enum type named search_api_type
? Support scorll
and pit
and set scroll
by default.
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.
Get
Which versions of elasticsearch can be used? |
7.10 |
@@ -30,7 +30,7 @@ support version >= 2.x and <= 8.x. | |||
| index_list | array | no | used to define a multiple table task | | |||
| source | array | no | - | | |||
| query | json | no | {"match_all": {}} | | |||
| search_type | json | no | Search method,sql or dsl,default dsl | | |||
| search_type | json | no | Search method,SQL、PIT、SCROLL,default SCROLL | |
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.
search_type
and search_api_type
not same.
search_type
: SQL, DSL
search_api_type
: SCROLL, PIT
Map<String, String> sortField = new HashMap<>(); | ||
sortField.put("order", "asc"); | ||
sort.add(Collections.singletonMap("_shard_doc", "asc")); |
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.
PIT_KEEP_ALIVE, | ||
PIT_BATCH_SIZE, |
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.
PIT_KEEP_ALIVE, | |
PIT_BATCH_SIZE, | |
PIT_KEEP_ALIVE, | |
PIT_BATCH_SIZE, | |
SEARCH_API_TYPE, |
} | ||
// DSL query | ||
else { | ||
// Check if we should use PIT API |
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.
} | |
// DSL query | |
else { | |
// Check if we should use PIT API | |
} else { | |
// Check if we should use PIT API |
} | ||
// Default scroll API | ||
else { |
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.
} | |
// Default scroll API | |
else { | |
} else { |
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.
Thanks @CosmosNi . LGTM if ci passes.
elasticsearch source support PIT
close #9149
Purpose of this pull request
Does this PR introduce any user-facing change?
How was this patch tested?
Check list
New License Guide
release-note
.