-
Notifications
You must be signed in to change notification settings - Fork 334
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
WIP: [BitSail][Connector] Support ElasticSearch Source connector #336
base: master
Are you sure you want to change the base?
Conversation
@BlockLiu PTAL, thx. |
07:40:59.746 [main] ERROR o.t.d.DockerClientProviderStrategy - As no valid configuration was found, execution cannot continue
07:40:59.746 [main] ERROR c.b.b.t.c.t.t.e.ElasticsearchCluster - failed to initialize Elasticsearch container.
org.testcontainers.containers.ContainerFetchException: Can't get Docker image: RemoteDockerImage(imageName=docker.elastic.co/elasticsearch/elasticsearch:7.10.2, imagePullPolicy=DefaultPullPolicy(), imageNameSubstitutor=org.testcontainers.utility.ImageNameSubstitutor$LogWrappedImageNameSubstitutor@768f9097)
at org.testcontainers.containers.GenericContainer.getDockerImageName(GenericContainer.java:1371)
at org.testcontainers.containers.GenericContainer.logger(GenericContainer.java:651)
at org.testcontainers.elasticsearch.ElasticsearchContainer.<init>(ElasticsearchContainer.java:98)
at com.bytedance.bitsail.test.connector.test.testcontainers.elasticsearch.ElasticsearchCluster.startService(ElasticsearchCluster.java:52)
at com.bytedance.bitsail.connector.elasticsearch.rest.source.EsSourceRequestTest.setup(EsSourceRequestTest.java:54)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498) it works fine locally, i'll re-trigger to try. |
...bitsail/connector/elasticsearch/source/reader/deserializer/ElasticsearchRowDeserializer.java
Outdated
Show resolved
Hide resolved
row.setField(i, convert(typeInfo, value.toString())); | ||
} catch (ParseException e) { | ||
LOG.error("Parse value {} with type {} failed.", value, typeInfo); | ||
throw new RuntimeException(e); |
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.
Could be replace to bitsail exception, so bitsail will make this row as dirty record.
try { | ||
row.setField(i, convert(typeInfo, value.toString())); | ||
} catch (ParseException e) { | ||
LOG.error("Parse value {} with type {} failed.", value, typeInfo); |
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.
Log should be sample in sometimes, it will caused many exception log when the type not correct.
return false; | ||
} | ||
|
||
private Object convert(TypeInfo<?> typeInfo, String value) throws ParseException { |
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 proposal to have a new class to store the common logic like convert, maybe we can process this proposal in next issue.
@@ -46,7 +49,13 @@ public class EsRestClientBuilder { | |||
private final RestClientBuilder builder; | |||
|
|||
public EsRestClientBuilder(BitSailConfiguration jobConf) { |
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 make a new interface for the class EsRestClientBuilder. i just want to make it more flexible between the difference elasticsearch version.
Signed-off-by:
Pre-Checklist
Note: Please complete ALL items in the following checklist.
Purpose
Some description about what this PR wants to do.
Approaches
Some description about how this PR achives the purpose.
Related Issues
Close #146
New Behavior (screenshots if needed)
N/A