FlechazoW commented on code in PR #5548:
URL: https://github.com/apache/seatunnel/pull/5548#discussion_r1336556958
##########
seatunnel-connectors-v2/connector-cdc/connector-cdc-sqlserver/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/sqlserver/source/utils/SqlServerTypeUtils.java:
##########
@@ -32,7 +32,15 @@
/** Utilities for converting from SqlServer types to SeaTunnel types. */
public class SqlServerTypeUtils {
+ private static final String DATETIME_OFFSET = "datetimeoffset";
+
public static SeaTunnelDataType<?> convertFromColumn(Column column) {
+
+ switch (column.typeExpression()) {
+ case DATETIME_OFFSET:
+ return LocalTimeType.LOCAL_DATE_TIME_TYPE;
+ }
Review Comment:
Agree with Eric. I don't understand why the "switch-cases" construct is used
when there is only one case. Why not using "if - return"?
##########
seatunnel-connectors-v2/connector-cdc/connector-cdc-sqlserver/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/sqlserver/source/utils/SqlServerTypeUtils.java:
##########
@@ -32,7 +32,15 @@
/** Utilities for converting from SqlServer types to SeaTunnel types. */
public class SqlServerTypeUtils {
+ private static final String DATETIME_OFFSET = "datetimeoffset";
+
public static SeaTunnelDataType<?> convertFromColumn(Column column) {
+
+ switch (column.typeExpression()) {
+ case DATETIME_OFFSET:
+ return LocalTimeType.LOCAL_DATE_TIME_TYPE;
+ }
Review Comment:
Agree with Eric. I don't understand why the "switch-cases" construct is used
when there is only one case. Why not just using "if - return"?
--
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]