duckdb: DuckDB JDBC doesnt seem to work with timestamps in Tableau
What happens?
I’ve connected tableau desktop (Mac) to duckdb via ‘Other Database (JDBC)’ as described here https://brocktibert.medium.com/use-tableau-to-connect-to-duckdb-e92daad6e7b4
The connection works, and I can see the schema. However when I preview the data I get this error:

In tableau workbook I can work with the varchar fields as dimensions, however whenever I try to use the timestamp fields (truncated to some lower granularity like hour or year) I get the following error

Are there any known issues with working with timestamps in tableau using the jdbc connector? I am using the ~SQL92~ Postgres dialect in the JDBC datasource setup wizard in tableau. I have also tried setting it up using the ~Postgres~ SQL92 dialect, and got a different error in the worksheet when trying to work with the timestamp field.
My duckdb database reads from parquet files stored locally I am on
- MacOS 13.3.1
- duckdb v0.7.1 b00b93f0b1
- tableau desktop 2023.1
To Reproduce
duckdb database.duckdb CREATE TABLE f_cj_events_v2 AS SELECT * FROM read_parquet(‘/path/to/*.parquet’); CHECKPOINT;
(the database needs to include a timestamp field)
(copy duckdb_jdbc-0.7.1 to ~/Library/Tableau/Drivers) MacOS
(in tableau desktop) Create datasource -> other JDBC -> jdbc:duckdb:///path_to/database.duckdb Drag the timestamp field to a column, set the granularity to ‘Hour’
OS:
MacOS 13.3.1
DuckDB Version:
0.7.1
DuckDB Client:
Tableau (JDBC)
Full Name:
Ryan Rozich
Affiliation:
Self
Have you tried this on the latest master branch?
- I agree
Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?
- I agree
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 21 (13 by maintainers)
Commits related to this issue
- Issue #7013: Implement TRUNC Note that there are integral implementations too, because the use case in the bug is Tableau wrapping EXTRACT in TRUNC to force integral values. Since our EXTRACT functio... — committed to hawkfish/duckdb by deleted user a year ago
- Issue #7013: TRUNC Improvements * Use ScalarFunction::NopFunction for the integral types * Test special values — committed to hawkfish/duckdb by deleted user a year ago
- Merge pull request #7036 from hawkfish/trunc-numeric Issue #7013: Implement TRUNC — committed to duckdb/duckdb by Mytherin a year ago
- Issue #7013: Implement getTimestamp Calendar We already have the data in universal time, so I think all we need to do is just return is (scaled appropriately). It seems to fix the Tableau problem. — committed to hawkfish/duckdb by deleted user a year ago
- Issue #7013: Implement getTimestamp Calendar PR feedback. — committed to hawkfish/duckdb by deleted user a year ago
- Issue #7013: Implement getTimestamp Calendar Fix millis/micros confusion. — committed to hawkfish/duckdb by deleted user a year ago
- Merge pull request #7276 from hawkfish/jdbc-time Issue #7013: Implement getTimestamp Calendar — committed to duckdb/duckdb by Mytherin a year ago
I got the latest nightly JDBC installed and also CLI, and looks like the errors I was seeing with the truncation timestamp aggregation are fixed!
quick note if anyone else wants to run from the latest: you will likely need to rebuild your database files from the same nightly build as the JDBC driver.
Also, if you want the bleeding edge build from master, just go to the installation page and choose macOS/Github master. It will download the binaries that you can directly execute.