Hisoka-X commented on code in PR #5005:
URL: https://github.com/apache/seatunnel/pull/5005#discussion_r1250355466
##########
seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/serialize/ElasticsearchRowSerializer.java:
##########
@@ -143,22 +146,6 @@ private String serializeDelete(SeaTunnelRow row) {
}
}
- private Map<String, Object> toDocumentMap(SeaTunnelRow row) {
- String[] fieldNames = seaTunnelRowType.getFieldNames();
- Map<String, Object> doc = new HashMap<>(fieldNames.length);
- Object[] fields = row.getFields();
- for (int i = 0; i < fieldNames.length; i++) {
- Object value = fields[i];
- if (value instanceof Temporal) {
Review Comment:
The change will lost the logic of handle `Temporal`. Is that acceptable?
##########
seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/serialize/ElasticsearchRowSerializer.java:
##########
@@ -81,7 +84,7 @@ public String serializeRow(SeaTunnelRow row) {
private String serializeUpsert(SeaTunnelRow row) {
String key = keyExtractor.apply(row);
- Map<String, Object> document = toDocumentMap(row);
+ String document = new String(serializationSchema.serialize(row));
Review Comment:
```suggestion
String document = new String(serializationSchema.serialize(row),
StandardCharsets.UTF_8);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]