Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QRDS can't parse certain date formats that Redash understands #4672

Open
susodapop opened this issue Feb 21, 2020 · 1 comment
Open

QRDS can't parse certain date formats that Redash understands #4672

susodapop opened this issue Feb 21, 2020 · 1 comment

Comments

@susodapop
Copy link
Contributor

Issue Summary

One of our customers found a date format that React understands but SQLite does not. This mismatch makes SQLite's date functions fail inexplicably. The only workaround is to perform shot-in-the-dark string manipulation on a field you can't see.

Steps to Reproduce

Execute this SQLite against QRDS

WITH verbose_date AS (
SELECT '2019-12-01T00:02:00.000+0000' as dt
)

SELECT
    '**' || dt || '**' "Original Timestamp (wrapped to prevent Redash parsing)",
    dt "Original timestamp (Redash Parses)",
    date(dt) "SQLite Can't Parse",
    strftime('%Y', dt) "SQLite can't format original timestamp",
    strftime('%Y', '2019-12-01 00:02') "SQLite can format a proper date"
FROM verbose_date

Output

Screen Shot 2020-02-21 at 09 10 29

Comments

SQLite can't parse the date when it includes all that timezone information. The disconnect between what React displays and what SQLite understands puzzles the user. When strftime returns null it means you didn't pass it a date. But the app makes it seem that a proper date was returned by the database.

Casting dt as a string makes no difference either since the front-end still guesses the data-type. And forcing the column-type to Text from the Visualization Editor displays a Unix timestamp (1575158520000) instead of the raw result of the query.

The only way to see the raw data from the DB is to add characters that break the front-end parse behavior. Only developers will guess this troubleshooting step.

Technical details:

  • Redash Version: v9 Alpha
  • Browser/OS: FF / Chrome / Safari
  • How did you install Redash: SaaS
@susodapop
Copy link
Contributor Author

Hat tip to @arikfr for reproducing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant