You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/10/17 07:12:18 UTC

[GitHub] [iotdb] RYH61 opened a new pull request, #7636: [IOTDB-4647] Fix CSV import error when import header name with type

RYH61 opened a new pull request, #7636:
URL: https://github.com/apache/iotdb/pull/7636

   see: [https://github.com/apache/iotdb/pull/7600](https://github.com/apache/iotdb/pull/7600)
   
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

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


[GitHub] [iotdb] RYH61 commented on a diff in pull request #7636: [IOTDB-4647] Fix CSV import error when import header name with type

Posted by GitBox <gi...@apache.org>.
RYH61 commented on code in PR #7636:
URL: https://github.com/apache/iotdb/pull/7636#discussion_r997917789


##########
cli/src/main/java/org/apache/iotdb/tool/ImportCsv.java:
##########
@@ -587,11 +587,11 @@ private static void writeDataAlignedByDevice(
           AtomicReference<Boolean> isFail = new AtomicReference<>(false);
 
           // read data from record
-          for (String measurement : headerNameMap.values()) {
-            String value = record.get(measurement);
+          for (Map.Entry<String, String> headerName : headerNameMap.entrySet()) {
+            String value = record.get(headerName.getValue());

Review Comment:
   fix~



-- 
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: reviews-unsubscribe@iotdb.apache.org

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


[GitHub] [iotdb] neuyilan merged pull request #7636: [IOTDB-4647] Fix CSV import error when import header name with type

Posted by GitBox <gi...@apache.org>.
neuyilan merged PR #7636:
URL: https://github.com/apache/iotdb/pull/7636


-- 
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: reviews-unsubscribe@iotdb.apache.org

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


[GitHub] [iotdb] neuyilan commented on a diff in pull request #7636: [IOTDB-4647] Fix CSV import error when import header name with type

Posted by GitBox <gi...@apache.org>.
neuyilan commented on code in PR #7636:
URL: https://github.com/apache/iotdb/pull/7636#discussion_r997879184


##########
cli/src/main/java/org/apache/iotdb/tool/ImportCsv.java:
##########
@@ -587,11 +587,11 @@ private static void writeDataAlignedByDevice(
           AtomicReference<Boolean> isFail = new AtomicReference<>(false);
 
           // read data from record
-          for (String measurement : headerNameMap.values()) {
-            String value = record.get(measurement);
+          for (Map.Entry<String, String> headerName : headerNameMap.entrySet()) {
+            String value = record.get(headerName.getValue());

Review Comment:
   It's better to use two variables to indict the headerName.getValue() and headerName.getKey(), this would be more readble.
   
   eg:
   
   `Map.Entry<String, String> headerNameEntry : headerNameMap.entrySet()
   
   // headerNameWithoutType is equal to headerName if the CSV coloum do not have data type.
   String  headerNameWithoutType =  headerNameEntry.getKey();
   String  headerName =  headerNameEntry.getValue(); `
   



-- 
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: reviews-unsubscribe@iotdb.apache.org

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