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

$from Documentation is Incorrect #115

Closed
PeterZaitsev opened this issue Feb 25, 2019 · 1 comment · Fixed by #218
Closed

$from Documentation is Incorrect #115

PeterZaitsev opened this issue Feb 25, 2019 · 1 comment · Fixed by #218

Comments

@PeterZaitsev
Copy link

"Help" Says the following:

$from - replaced with timestamp/1000 value of selected "Time Range:From"

While I see $from in my case as UnixTimestamp value of the start date with no division:

SELECT toDate(1393289997)

┌─toDate(1393289997)─┐
│ 2014-02-25 │
└────────────────────┘

1 rows in set. Elapsed: 0.001 sec.

@Slach
Copy link
Collaborator

Slach commented Jul 3, 2020

@PeterZaitsev there is not a bug, there is a misunderstanding between documentation and interpretation of term "timestamp"

timestamp in Grafana JavaScript it's a UnixTime + ms momentjs

please look at
https://github.com/Vertamedia/clickhouse-grafana/blob/master/src/sql_query.ts#L475
https://github.com/Vertamedia/clickhouse-grafana/blob/master/src/datasource.ts#L138

dateMatch.parse convert string to momentjs.com DateTime format which contains microseconds "2013-02-08 24:00:00.000"
so, I will change documentation for more clear

@Slach Slach closed this as completed in #218 Jul 3, 2020
Slach added a commit that referenced this issue Jul 3, 2020
clear documentation about timestamp term for $from and $to, fix #115
Slach added a commit to Altinity/grafana-plugin-repository that referenced this issue Jul 7, 2020
# 2.0.2 (2020-07-07)

## Enhancements:
* add alerts support for Windows and MacOSX
* improve ad-hoc filters for query field values as `SELECT DISTINCT field AS value FROM db.table LIMIT 300`, Altinity/clickhouse-grafana#222
* add the ability to multiple JOIN parsing Altinity/clickhouse-grafana#206
* multiple improvements for docker-compose environments, add automatic dashboards and data source provisions which help to reproduce most of the corner cases which happens in Grafana + ClickHouse

## Fixes:
* apply a workaround for UTC timezone for Date and DateTime columns in grafana dashboards Altinity/clickhouse-grafana#117
* clear documentation about timestamp term for $from and $to Altinity/clickhouse-grafana#115
* fix AST parsing corner case in `WHERE [test, 'test']` "," was skipped, fix ah-doc AST FROM recursive parsing Altinity/clickhouse-grafana#99
* fix corner cases for table functions parsing when Adhoc filter applied Altinity/clickhouse-grafana#130
* fix multiple grammar issues in README.md
* fix convert rules for Float, Decimal columns from Clickhouse to Grafana Table plugin Altinity/clickhouse-grafana#199
* fix corner cases when Grafana Template variable value represented as an array of strings Altinity/clickhouse-grafana#169
* fix AST parsing corner cases for $macroFunctions correct position for FROM statement Altinity/clickhouse-grafana#187

Signed-off-by: Eugene Klimov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants