gj-zhang commented on code in PR #33:
URL: 
https://github.com/apache/incubator-doris-flink-connector/pull/33#discussion_r890801739


##########
flink-doris-connector/src/main/java/org/apache/doris/flink/serialization/RowBatch.java:
##########
@@ -243,8 +249,34 @@ public void convertArrowToRowBatch() throws DorisException 
{
                         }
                         break;
                     case "DATE":
-                    case "LARGEINT":
+                        
Preconditions.checkArgument(mt.equals(Types.MinorType.VARCHAR),
+                                typeMismatchMessage(currentType, mt));
+                        VarCharVector date = (VarCharVector) curFieldVector;
+                        for (int rowIndex = 0; rowIndex < rowCountInOneBatch; 
rowIndex++) {
+                            if (date.isNull(rowIndex)) {
+                                addValueToRow(rowIndex, null);
+                                continue;
+                            }
+                            String value = new String(date.get(rowIndex));
+                            LocalDate localDate = LocalDate.parse(value, 
dateFormatter);
+                            addValueToRow(rowIndex, localDate);
+                        }
+                        break;
                     case "DATETIME":
+                        
Preconditions.checkArgument(mt.equals(Types.MinorType.VARCHAR),
+                                typeMismatchMessage(currentType, mt));
+                        VarCharVector timeStampSecVector = (VarCharVector) 
curFieldVector;
+                        for (int rowIndex = 0; rowIndex < rowCountInOneBatch; 
rowIndex++) {
+                            if (timeStampSecVector.isNull(rowIndex)) {
+                                addValueToRow(rowIndex, null);
+                                continue;
+                            }
+                            String value = new 
String(timeStampSecVector.get(rowIndex));
+                            LocalDateTime parse = LocalDateTime.parse(value, 
dateTimeFormatter);
+                            addValueToRow(rowIndex, parse);
+                        }
+                        break;
+                    case "LARGEINT":

Review Comment:
   i didn't think so. because this operation is convert arrow to rowbatch. 
   `org.apache.doris.flink.deserialization.converter.DorisRowConverter` convert 
rowbatch to flink row.



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to