manesioz commented on code in PR #377:
URL:
https://github.com/apache/doris-spark-connector/pull/377#discussion_r3914810406
##########
spark-doris-connector/spark-doris-connector-base/src/main/java/org/apache/doris/spark/client/read/RowBatch.java:
##########
@@ -424,46 +424,48 @@ public void convertArrowToRowBatch() throws
DorisException {
break;
case "DATETIME":
case "DATETIMEV2":
- case "TIMESTAMPTZ":
-
if (mt.equals(MinorType.VARCHAR)) {
- VarCharVector varCharVector = (VarCharVector)
curFieldVector;
- for (int rowIndex = 0; rowIndex <
rowCountInOneBatch; rowIndex++) {
- if (varCharVector.isNull(rowIndex)) {
- addValueToRow(rowIndex, null);
- continue;
- }
- String stringValue = completeMilliseconds(new
String(varCharVector.get(rowIndex),
- StandardCharsets.UTF_8));
- LocalDateTime dateTime =
LocalDateTime.parse(stringValue, dateTimeV2Formatter);
- if (datetimeJava8ApiEnabled) {
- Instant instant =
dateTime.atZone(DEFAULT_ZONE_ID).toInstant();
- addValueToRow(rowIndex, instant);
- } else {
- addValueToRow(rowIndex,
Timestamp.valueOf(dateTime));
- }
- }
+ convertVarcharDateTime((VarCharVector)
curFieldVector);
Review Comment:
This is only a helper extraction of the existing VARCHAR conversion so the
now separated DATETIME* and TIMESTAMPTZ branches can share it. No behaviour
changed but I’m happy to inline it again if you’d prefer a smaller diff.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]