{"action":"created","issue":{"url":"https://api.github.com/repos/Vertamedia/clickhouse-grafana/issues/42","repository_url":"https://api.github.com/repos/Vertamedia/clickhouse-grafana","labels_url":"https://api.github.com/repos/Vertamedia/clickhouse-grafana/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/Vertamedia/clickhouse-grafana/issues/42/comments","events_url":"https://api.github.com/repos/Vertamedia/clickhouse-grafana/issues/42/events","html_url":"https://github.com/Vertamedia/clickhouse-grafana/issues/42","id":306189223,"number":42,"title":"Latest version broke some of queries","user":{"login":"kak-tus","id":3152421,"avatar_url":"https://avatars2.githubusercontent.com/u/3152421?v=4","gravatar_id":"","url":"https://api.github.com/users/kak-tus","html_url":"https://github.com/kak-tus","followers_url":"https://api.github.com/users/kak-tus/followers","following_url":"https://api.github.com/users/kak-tus/following{/other_user}","gists_url":"https://api.github.com/users/kak-tus/gists{/gist_id}","starred_url":"https://api.github.com/users/kak-tus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kak-tus/subscriptions","organizations_url":"https://api.github.com/users/kak-tus/orgs","repos_url":"https://api.github.com/users/kak-tus/repos","events_url":"https://api.github.com/users/kak-tus/events{/privacy}","received_events_url":"https://api.github.com/users/kak-tus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"hagen1778","id":2902918,"avatar_url":"https://avatars2.githubusercontent.com/u/2902918?v=4","gravatar_id":"","url":"https://api.github.com/users/hagen1778","html_url":"https://github.com/hagen1778","followers_url":"https://api.github.com/users/hagen1778/followers","following_url":"https://api.github.com/users/hagen1778/following{/other_user}","gists_url":"https://api.github.com/users/hagen1778/gists{/gist_id}","starred_url":"https://api.github.com/users/hagen1778/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hagen1778/subscriptions","organizations_url":"https://api.github.com/users/hagen1778/orgs","repos_url":"https://api.github.com/users/hagen1778/repos","events_url":"https://api.github.com/users/hagen1778/events{/privacy}","received_events_url":"https://api.github.com/users/hagen1778/received_events","type":"User","site_admin":false},"assignees":[{"login":"hagen1778","id":2902918,"avatar_url":"https://avatars2.githubusercontent.com/u/2902918?v=4","gravatar_id":"","url":"https://api.github.com/users/hagen1778","html_url":"https://github.com/hagen1778","followers_url":"https://api.github.com/users/hagen1778/followers","following_url":"https://api.github.com/users/hagen1778/following{/other_user}","gists_url":"https://api.github.com/users/hagen1778/gists{/gist_id}","starred_url":"https://api.github.com/users/hagen1778/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hagen1778/subscriptions","organizations_url":"https://api.github.com/users/hagen1778/orgs","repos_url":"https://api.github.com/users/hagen1778/repos","events_url":"https://api.github.com/users/hagen1778/events{/privacy}","received_events_url":"https://api.github.com/users/hagen1778/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2018-03-17T20:49:08Z","updated_at":"2018-03-18T12:37:21Z","closed_at":null,"author_association":"NONE","body":"May be it was broken in 1.4.1 or in 1.4.0.\r\n\r\nPlugin got query and send it to Clickhouse without some symbols.\r\nSee resulting query. There is no comma here \"AS t     toRelativeMinuteNum\"\r\n\r\nSettings\r\n![image](https://user-images.githubusercontent.com/3152421/37559820-8611490a-2a3d-11e8-94dc-437be21e40bf.png)\r\n\r\nQuery\r\n```\r\nSELECT\r\n    concat( smsc_id, ' (', server, ')' ) AS t,\r\n    toRelativeMinuteNum(now()) - toRelativeMinuteNum(max(dt)) AS c\r\nFROM $table\r\nWHERE\r\n    dt_part >= toDate(now()) - 1\r\n    AND dt >= now() - 86400 * 1\r\n    AND status = 'online'\r\nGROUP BY t\r\nHAVING c > 10\r\nUNION ALL\r\nSELECT\r\n  concat( smsc_id, ' (', server, ')' ) AS t,\r\n  toRelativeMinuteNum(now()) - toRelativeMinuteNum(min(dt)) AS c \r\nFROM $table WHERE dt_part >= toDate(now()) - 7 AND dt >= now() - 86400 * 7 AND smsc_id NOT IN (\r\n    SELECT smsc_id\r\n    FROM $table\r\n    WHERE\r\n        dt_part >= toDate(now()) - 7\r\n        AND dt >= now() - 86400 * 7\r\n        AND status = 'online'\r\n    GROUP BY smsc_id)\r\n    GROUP BY t\r\n```\r\n\r\nResulting query\r\n```\r\nSELECT     concat(smsc_id, ' (', server, ')') AS t,     toRelativeMinuteNum(now()) - toRelativeMinuteNum(max(dt)) AS c FROM gate.kannel_status WHERE     dt_part >= toDate(now()) - 1     AND dt >= now() - 86400 * 1     AND status = 'online' GROUP BY t HAVING c > 10 UNION ALL     SELECT concat(smsc_id, ' (', server, ')') AS t     toRelativeMinuteNum(now()) - toRelativeMinuteNum(min(dt)) AS c FROM gate.kannel_status WHERE dt_part >= toDate(now()) - 7 AND dt >= now() - 86400 * 7 AND smsc_id NOT IN (     SELECT smsc_id     FROM gate.kannel_status     WHERE         dt_part >= toDate(now()) - 7         AND dt >= now() - 86400 * 7         AND status = 'online'     GROUP BY smsc_id)     GROUP BY t\r\n```\r\n\r\nTarget table\r\n```\r\nCREATE TABLE gate.kannel_status ( dt_part Date,  dt DateTime,  server String,  smsc_id String,  status Enum8(\\'online\\' = 1, \\'connecting\\' = 2, \\'reconnecting\\' = 3, \\'dead\\' = 4)) ENGINE = MergeTree(dt_part, dt, 8192)\r\n```"},"comment":{"url":"https://api.github.com/repos/Vertamedia/clickhouse-grafana/issues/comments/373995212","html_url":"https://github.com/Vertamedia/clickhouse-grafana/issues/42#issuecomment-373995212","issue_url":"https://api.github.com/repos/Vertamedia/clickhouse-grafana/issues/42","id":373995212,"user":{"login":"kak-tus","id":3152421,"avatar_url":"https://avatars2.githubusercontent.com/u/3152421?v=4","gravatar_id":"","url":"https://api.github.com/users/kak-tus","html_url":"https://github.com/kak-tus","followers_url":"https://api.github.com/users/kak-tus/followers","following_url":"https://api.github.com/users/kak-tus/following{/other_user}","gists_url":"https://api.github.com/users/kak-tus/gists{/gist_id}","starred_url":"https://api.github.com/users/kak-tus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kak-tus/subscriptions","organizations_url":"https://api.github.com/users/kak-tus/orgs","repos_url":"https://api.github.com/users/kak-tus/repos","events_url":"https://api.github.com/users/kak-tus/events{/privacy}","received_events_url":"https://api.github.com/users/kak-tus/received_events","type":"User","site_admin":false},"created_at":"2018-03-18T12:37:21Z","updated_at":"2018-03-18T12:37:21Z","author_association":"NONE","body":"Thank you, it's fine now.\r\n\r\nI've tried broken query - it's ok.\r\nAnd for test query like this\r\n```\r\nselect 1,2,3\r\nunion all\r\nselect 4,5,6\r\nunion all\r\nselect 7,8,9\r\n```\r\nIt's also ok."}}
{"actor":{"display_login":"kak-tus"}}