question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CSV mapping ignored and entered in CSV header order

See original GitHub issue

System information:

  • Ubuntu 18.04.3 LTS
  • DBeaver 6.3.3.202001191557

Connection specification:

  • Local MySQL database
  • com.mysql.jdbc.Driver

Describe the problem you’re observing:

Mappings for CSV import does not work. The CSV order overrides the mapping. In my case the columns in the CSV are: id, cid, ip_from, ip_to and the DB columns are id, ip_from, ip_to, cid. The mapping wont go in the correct order.

Steps to reproduce, if exist:

Import a CSV with different order than that of the table?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
serge-ridercommented, Feb 20, 2020

This bug was caused by commit 14c5f1d6681650125c50f5ddbc52970a78d5bfc7 Fixed

1reaction
patrickmdnetcommented, Jan 30, 2020

I can reproduce in 6.3.4 Community. This bug does not happen in 6.3.3 EE.

System information:

  • Windows 10 x64
  • 6.3.4.202001291506

Connection specification:

  • SQLLite (org.xerial.sqlite-jdbc:RELEASE)

To repro, make a small CSV and call it “sample.csv”

"ID",Visits,"Location"
"00123",1123,"Many Places"
"132567",1213,"Tinseltown"
"00999",3333,"LAX"

Make a tiny SQLite DB (or whatever DB, it doesn’t matter) where the order of the first two columns is swapped:

# sqlite script to create table for sample.csv
# sqlite-tools-win32-x86-3310100\sqlite3 < sample.sqllite
create table sample(visits int, id varchar(10), location varchar(20));
.save sample.db
.quit
  1. In DBeaver, connect to the SQLlite DB.
  2. Choose “Import Data” for the SQLLite table sample.
  3. At “Source type and format”, choose CSV then Next
  4. At “Input file(s)”, choose “sample.csv”, then Next
  5. At “Settings (Files to Database, CSV”) choose Next
  6. At Preview Data Import, set visits to be bound to ID, and id to be bound to Visits. You will notice that the “Preview data” pane doesn’t change in order. On 6.3.3 EE the preview pane does change. So the bad behavior is here, somewhere.

image

  1. Hit Next, then Start.
  2. You will get the following in the sample table:
visits id location
123 1123 Many Places
132567 1213 Tinseltown
999 3333 LAX

which is wrong.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jackson CSV deserialization ignoring header order
I tried editing the csv(tsv) file's headers changing the name to something not annotated, but no error occurs. @JsonCreator(mode = JsonCreator. ...
Read more >
Solutions to common product CSV import problems
Troubleshooting product CSV files. Identify missing fields or headers, illegal formatting or identifier duplications before contacting support.
Read more >
Import-Csv (Microsoft.PowerShell.Utility)
If any row has more values than the header row, the additional values are ignored. If the column header row is missing a...
Read more >
CSV file format and examples - IBM
Important: If a cell that contains content for a column does not match the specified artifact type, as denoted by the Type value,...
Read more >
Mapping timescale during import and ignoring some columns
... know how do I ignore several columns from the source CSV file while importing ... When I map the Time to Column...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found