Skip to content

[Bug] Tree CSV import loses TIMESTAMP measurements from the default export and exits successfully #19537

Backlog

Description

@DaZuiZui

The tree-model CSV importer loses a TIMESTAMP measurement when reading the default CSV produced by export-data. The command writes the other measurement and exits 0, which makes a scripted restore look successful.

I reproduced this with the CLI from 476524933a and an IoTDB Edge 2.0.12 instance using millisecond precision.

  1. Create a tree device with root.treecsv.d.event_ts (TIMESTAMP) and root.treecsv.d.v (INT32). Insert one row with (time, event_ts, v) = (1, 1796355197083, 7).

  2. Export select event_ts,v from root.treecsv.d using export-data -sql_dialect tree -ft csv -tz +00:00 and the default time format. The CSV contains:

    Time,root.treecsv.d.event_ts,root.treecsv.d.v
    1970-01-01T00:00:00.001Z,2026-12-04T03:33:17.083Z,7
  3. In this test device, delete the row while keeping the two time series, then import the exported file with import-data -sql_dialect tree -ft csv -tz +00:00 -s <exported-file>.

Actual: The importer reports that it cannot convert event_ts to TIMESTAMP, writes the row to .failed_0, prints Import completely!, and exits 0. Querying the device returns (1, NULL, 7).

Expected: Importing this CSV restores (1, 1796355197083, 7) and exits 0. A genuinely malformed timestamp should preserve valid measurements, produce a failed-row file, and return a nonzero exit status.

Tree-model follow-up to #19533, as discussed in the PR review.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions