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 file date format is not recognised as set in driver properties - default is used

See original GitHub issue

System information:

  • Operating system: WINDOWS 10 Latest
  • DBeaver version: 21.0.0.202103021012
  • Additional extensions: none

Connection specification:

  • Database name and version: Flat Files / CSV
  • Driver name: Flat files / CSV

Describe the problem you’re observing:

I have data file where date is in dd/MM/yyyy format; dbeaver default format is yyyy-MM-dd I created 2 test tables and connected to dbeaver (both files in same directory): caseload2

"CreatedDate","ClientID"
01/08/1971,127207
02/04/1966,1443709
03/02/1969,144759
08/02/1987,1111932
19/01/1969,116062

and caseload1

"CreatedDate","ClientID"
1971-08-01,127207
1966-04-02,1443709
1969-02-03,144759
1987-02-08,1111932
1969-12-19,116062

I have specified column types and date format in driver properties: dateFormat: dd/MM/yyyy charset: UTF-8 columnTypes: date/integer fileExtension: .csv

above are the only bold/non-default changes to driver properties.

CreatedDate is not read at all from caseload2 CreatedDate is read from caseload1 even though I have specified other format (with slashes) in driver properties.

Steps to reproduce, if exist:

e.g. make above 2 CSV files, make CSV connection to the directory and run:

select MAX(CreatedDate) 
FROM caseload2 
;
MAX([CreatedDate])|
------------------|
                  |

and

select MAX(CreatedDate) 
FROM caseload1 
;
MAX([CreatedDate])|
------------------|
        1987-02-08|

Include any warning/errors/backtraces from the logs

No errors are produced in logs.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
simoccommented, Mar 27, 2021

The SQL queries listed in this issue work correctly for me using DBeaver 21.0.1.202103211229 on Windows 10.

The SQL queries also worked correctly for me using CsvJdbc directly in a Java test program.

In the DBeaver Driver properties tab under Connection Settings, I added dateFormat dd/MM/yyyy to the User Properties list, like in the screenshot below.

dbeaver-connection-settings-user-properties

It is also possible to edit dateFormat directly under Driver properties, like in the screenshot below. When I do this, the SQL queries do not work, because DBeaver does not pass the dateFormat dd/MM/yyyy property down to CsvJdbc. Could this be the problem?

dbeaver-connection-settings-driver-properties

0reactions
uslsscommented, Mar 31, 2021

verified

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSV date format - excel - Stack Overflow
A CSV file only contains text. That is the data is not in date format but in a text format. So when you...
Read more >
Formatting Dates for CSV Imports - Administration - Echo360
The CSV file will have the proper date format. Just don't open the CSV file in Excel and expect the dates to be...
Read more >
Date format recognition on sequential file - Forums - IBM
I have a csv file that I am picking up from the server using a "sequential file" stage and am having some trouble...
Read more >
How import CSV file to Dbeaver - GitHub
In Driver Properties add dateFormat as in the csv file, i.e. M/dd/yyyy in our ... is not recognised as set in driver properties...
Read more >
Date Properties for a Data Source - Tableau Help
You can set date properties for a data source. To do so, right-click (control-click on Mac) a data source in the Data pane...
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