Skip to content

[pgimport] Wrong imported bytes #370

Description

@turicas

The progress bar is not updated correctly: number of imported bytes is lower
than file size (at least for uncompressed CSV files).

Giving the file test.csv (305 bytes):

Project,Client,Description,Duration
P23,Client ÁÁÁÀçç,Some task num. 01,01:08:56
Project N. 12,Client num. 1,Some task number 02,00:55:00
Proj 2,Client num. 1,Some task number 123456789012,06:31:17
Project 2,Client num. 1,Some task number 123456,01:18:49
Project 2,Client num. 1,Task n. 12,02:04:23

By running:

rows pgimport -s :text: -d excel -e utf-8 test.csv $DATABASE_URL test

I got the result:

5 rows imported:  88%|████████████████████████████████████████▌     | 269/305 [00:00<00:00, 6.28kbytes/s]

It seems the header size is not being counted. We may change the header, so we need to add to progress the original header size (currently even the written header size is not being added to imported bytes).

Note: the file is in UTF-8 and even if it haven't special chars, the imported
bytes will still be less than file size.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions