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

Is it possible to add unix timestamp support for time column #1036

Closed
sanpingz opened this issue Aug 30, 2016 · 10 comments
Closed

Is it possible to add unix timestamp support for time column #1036

sanpingz opened this issue Aug 30, 2016 · 10 comments

Comments

@sanpingz
Copy link

It looks Caravel heavily relies on time column for query. For my case, the existing tables are using unix timestamp as time column. Unfortunately, Caravel can't recognize unix timestamp, is it possible to support that?

In my mysql table, the time column is a double type, the value looks like 1472526903.358829.

@dugjason
Copy link

Possibly linked to issue #998

@xrmx
Copy link
Contributor

xrmx commented Aug 30, 2016

@sanpingz have you marked your column as dttm and it doesn't work?

@xrmx
Copy link
Contributor

xrmx commented Aug 30, 2016

@dugjason looks unrelated to me :)

@xrmx xrmx added the question label Aug 30, 2016
@sanpingz
Copy link
Author

@xrmx Yes, I marked unix timestamp column to temporal, it doesn't work.
I noticed the generated query is:

SELECT COUNT(*) AS count
FROM `G_HT_UUT`
WHERE `UPDATE_TIME` >= '2015-08-31 06:41:28.000000'
  AND `UPDATE_TIME` <= '2016-08-31 06:41:28.000000' LIMIT 5000

The UPDATE_TIME column is double type as unix timestamp. It would work if the query is:

SELECT COUNT(*) AS count
FROM `G_HT_UUT`
WHERE from_unixtime(UPDATE_TIME) >= '2015-08-31 06:41:28.000000'
  AND from_unixtime(UPDATE_TIME) <= '2016-08-31 06:41:28.000000' LIMIT 5000

@xrmx
Copy link
Contributor

xrmx commented Aug 31, 2016

@dugjason now it indeed looks like yours :)
@sanpingz can you try to do a custom field with an expression as Dug is doing in #998?

@sanpingz
Copy link
Author

@xrmx @dugjason well, that's a workaround, need disable temporal column, and use custom query, definitely works.

Unfortunately, our users may know nothing about SQL, they are nontechnical guys.

@xrmx
Copy link
Contributor

xrmx commented Aug 31, 2016

@sanpingz from the end user perspective it's matter of using field B instead of field A, no? If by end user you mean admins that can setup the tables they should have a clue about these kind of issues.

@sanpingz
Copy link
Author

@xrmx I meant end users, not admins, they need know something like what happened in the past 1 day, 1 week, etc. No way for them to use custom query. Even though admins help to create slices based on custom query, the datetime is hardcoded if I'm not wrong?

@xrmx
Copy link
Contributor

xrmx commented Aug 31, 2016

@sanpingz Dug is using a custom field where the value of the field is casted to another type not a custom query

@sanpingz
Copy link
Author

@xrmx Sorry I missed, custom field works for me, thanks a lot.

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

3 participants