CritasWang commented on PR #18828:
URL: https://github.com/apache/iotdb/pull/18828#issuecomment-6306663078

   I reviewed commit `e5db31f1a860c19ba1a872f0b222e0612f5bb746` and reproduced 
two issues that should be addressed before merging:
   
   1. **[P1] Archive filename collisions can silently discard a source file.**
   
      In [AbstractImportData.java, lines 
166–180](https://github.com/apache/iotdb/blob/e5db31f1a860c19ba1a872f0b222e0612f5bb746/iotdb-client/cli/src/main/java/org/apache/iotdb/tool/data/AbstractImportData.java#L166-L180),
 replacing every path separator with `_` is not an injective mapping. For 
example, `input/a/b.tsfile` and `input/a_b.tsfile` both become 
`<successDir>/a_b.tsfile`. The subsequent file operations use 
`REPLACE_EXISTING`, so the second archive operation silently overwrites the 
first. With `-os mv`, both original paths disappear, but only one file remains 
in the archive, and no error is propagated. A local regression test expecting 
both files to survive instead found only one. Please preserve the relative 
directory structure, or use collision-safe names and reject unintended 
overwrites.
   
   2. **[P2] Typed CSV export breaks round trips for column names containing 
spaces.**
   
      This PR starts honoring typed CSV headers, but [ImportDataTable.java, 
lines 
395–401](https://github.com/apache/iotdb/blob/e5db31f1a860c19ba1a872f0b222e0612f5bb746/iotdb-client/cli/src/main/java/org/apache/iotdb/tool/data/ImportDataTable.java#L395-L401)
 still removes all whitespace from the column name when parsing a typed header. 
For a legal column named `value with space`, `-dt true` exports `value with 
space(DOUBLE)`, which the importer turns into `valuewithspace`. 
`Tablet.addValue` then throws an `IllegalArgumentException` because that 
measurement does not exist. I reproduced this by exporting and importing the 
same row: the untyped CSV imported successfully, while the typed CSV failed. 
Please strip only the type suffix and preserve whitespace within the identifier.
   
   Validation was performed in an isolated checkout: the PR's existing 21 
targeted tests passed, and two additional regression tests reproduced the 
issues above. The tests used the locally cached TsFile `2.4.1-261009-SNAPSHOT` 
because `2.4.1-260915-SNAPSHOT` was unavailable locally. No live-cluster 
integration tests were run.
   


-- 
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]

Reply via email to