EricJoy2048 commented on code in PR #6144:
URL: https://github.com/apache/seatunnel/pull/6144#discussion_r1444145252
##########
seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/config/BaseFileSinkConfig.java:
##########
@@ -47,6 +47,10 @@ public class BaseFileSinkConfig implements DelimiterConfig,
Serializable {
protected DateTimeUtils.Formatter datetimeFormat =
DateTimeUtils.Formatter.YYYY_MM_DD_HH_MM_SS;
protected TimeUtils.Formatter timeFormat = TimeUtils.Formatter.HH_MM_SS;
protected Boolean enableHeaderWriter = false;
+ protected Boolean enableHiveCollectionType =
Review Comment:
Hive config can not put in `BaseFileSinkConfig`.
I think determining how to write a file through the upstream field types
`Array, Map, Row` is a general function rather than a Hive-specific feature.
##########
seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/sink/writer/TextWriteStrategy.java:
##########
@@ -76,6 +82,9 @@ public void setSeaTunnelRowTypeInfo(SeaTunnelRowType
seaTunnelRowType) {
.dateFormatter(dateFormat)
.dateTimeFormatter(dateTimeFormat)
.timeFormatter(timeFormat)
+ .enableHiveCollectionType(enableHiveCollectionType)
Review Comment:
I think you can create a `HiveTextSerializationSchema` here when the sink is
`Hive`.
##########
seatunnel-formats/seatunnel-format-text/src/main/java/org/apache/seatunnel/format/text/TextSerializationSchema.java:
##########
@@ -150,11 +186,43 @@ private String convert(Object field, SeaTunnelDataType<?>
fieldType, int level)
case BYTES:
return new String((byte[]) field);
case ARRAY:
+ if (enableHiveCollectionType) {
Review Comment:
Add a `HiveTextSerializationSchema` is better.
--
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]