From 9c0774ec2ca4228f353a3fb64a714392cd17136e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Vavru=C5=A1a?= Date: Wed, 30 May 2018 13:13:52 -0700 Subject: [PATCH] configurable default database, improved ad-hoc filters, parse key columns from query (#60) * configurable default database, less restrictive ad-hoc filters * parse dimensions from GROUP BY expression --- README.md | 63 +++++++++++++++++-------------------- dist/README.md | 63 +++++++++++++++++-------------------- dist/adhoc.js | 24 +++++++++++--- dist/adhoc.js.map | 2 +- dist/adhoc.ts | 22 +++++++++++-- dist/clickhouse-info.js.map | 2 +- dist/datasource.d.ts | 1 + dist/datasource.js | 19 +++++++++-- dist/datasource.js.map | 2 +- dist/datasource.ts | 15 ++++++++- dist/partials/config.html | 18 ++++++++--- dist/query_ctrl.js | 10 +++++- dist/query_ctrl.js.map | 2 +- dist/query_ctrl.ts | 11 ++++++- dist/scanner.d.ts | 2 +- dist/scanner.ts | 2 +- dist/sql_query.js | 11 ++++++- dist/sql_query.js.map | 2 +- dist/sql_query.ts | 11 ++++++- dist/sql_series.d.ts | 1 + dist/sql_series.js | 16 ++++++++++ dist/sql_series.js.map | 2 +- dist/sql_series.ts | 18 +++++++++++ src/adhoc.ts | 22 +++++++++++-- src/datasource.ts | 15 ++++++++- src/partials/config.html | 18 ++++++++--- src/query_ctrl.ts | 11 ++++++- src/sql_query.ts | 9 ++++++ src/sql_series.ts | 18 +++++++++++ 29 files changed, 308 insertions(+), 104 deletions(-) diff --git a/README.md b/README.md index a8bdaf7cb..5141ede54 100644 --- a/README.md +++ b/README.md @@ -220,43 +220,32 @@ Top5: ``` SELECT 1, /* fake timestamp value */ - groupArray((UserName, Reqs)) -FROM -( - SELECT - UserName, - sum(Reqs) AS Reqs - FROM requests - GROUP BY UserName - ORDER BY Reqs desc - LIMIT 5 -) + UserName, + sum(Reqs) AS Reqs +FROM requests +GROUP BY UserName +ORDER BY Reqs desc +LIMIT 5 ``` Other: ``` SELECT 1, /* fake timestamp value */ - tuple(tuple('Other', sum(Reqs))) -FROM -( - SELECT - UserName, - sum(Reqs) AS Reqs - FROM requests - GROUP BY UserName - ORDER BY Reqs desc - LIMIT 5,10000000000000 /* select some ridiculous number after first 5 */ -) + UserName, + sum(Reqs) AS Reqs +FROM requests +GROUP BY UserName +ORDER BY Reqs +LIMIT 5,10000000000000 /* select some ridiculous number after first 5 */ ``` #### Table (https://grafana.com/plugins/table) -There are no any tricks in displaying time-series data. But to display some summary we will need to fake timestamp data: +There are no any tricks in displaying time-series data. To print summary data, omit time column, and format the result as "Table". ``` SELECT - rand() Time, /* fake timestamp value */ UserName, sum(Reqs) as Reqs FROM requests @@ -266,9 +255,6 @@ ORDER BY Reqs ``` -Better to hide `Time` column at `Options` tab while editing panel - - #### Vertical histogram (https://grafana.com/plugins/graph) ![vertical histogram](https://cloud.githubusercontent.com/assets/2902918/25392561/9f3777e0-29e1-11e7-8b23-2ea9ae46a029.png) @@ -296,10 +282,6 @@ If you have a table with country/city codes: ``` SELECT 1, - groupArray((c, Reqs)) AS groupArr -FROM -( - SELECT CountryCode AS c, sum(requests) AS Reqs FROM requests @@ -312,7 +294,6 @@ WHERE $timeFilter GROUP BY c ORDER BY Reqs DESC -) ``` If you are using [geohash](https://github.com/grafana/worldmap-panel#geohashes-as-the-data-source) set following options: @@ -327,11 +308,12 @@ And make following query with `Table` formatting: ### Ad-hoc filters If there is an Ad-hoc variable, plugin will fetch all columns of all tables of all databases (except system database) as tags. -So in dropdown menu will be options like `database.table.column`. If there are ENUM columns, +So in dropdown menu will be options like `database.table.column`. If the default database is specified, it will only fetch tables and columns from that database, and the dropdown menu will have option like `table.column`. If there are ENUM columns, plugin will fetch their options and use them as tag values. Plugin will apply Ad-hoc filters to all queries on the dashboard if their settings `$database` and `$table` are the same -as Ad-hoc's `database.table` +as Ad-hoc's `database.table`. If the ad-hoc filter doesn't specify table, it will apply to all queries regardless of the table. +This is useful if the dashboard contains queries to multiple different tables. ![ad-hoc](https://user-images.githubusercontent.com/2902918/37139531-ed67f222-22b6-11e8-8815-9268850f16fb.png) @@ -353,6 +335,19 @@ That's why plugin checks prev datapoints and tries to predict last datapoint val Alerts feature requires changes in `Grafana`'s backend, which can't be extended for now. `Grafana`'s maintainers are working on this feature. +### Build + +The build works with either NPM or Yarn: + +``` +yarn run build +``` + +Tests can be run with Karma: + +``` +yarn run test +``` ### Contribute diff --git a/dist/README.md b/dist/README.md index a8bdaf7cb..5141ede54 100644 --- a/dist/README.md +++ b/dist/README.md @@ -220,43 +220,32 @@ Top5: ``` SELECT 1, /* fake timestamp value */ - groupArray((UserName, Reqs)) -FROM -( - SELECT - UserName, - sum(Reqs) AS Reqs - FROM requests - GROUP BY UserName - ORDER BY Reqs desc - LIMIT 5 -) + UserName, + sum(Reqs) AS Reqs +FROM requests +GROUP BY UserName +ORDER BY Reqs desc +LIMIT 5 ``` Other: ``` SELECT 1, /* fake timestamp value */ - tuple(tuple('Other', sum(Reqs))) -FROM -( - SELECT - UserName, - sum(Reqs) AS Reqs - FROM requests - GROUP BY UserName - ORDER BY Reqs desc - LIMIT 5,10000000000000 /* select some ridiculous number after first 5 */ -) + UserName, + sum(Reqs) AS Reqs +FROM requests +GROUP BY UserName +ORDER BY Reqs +LIMIT 5,10000000000000 /* select some ridiculous number after first 5 */ ``` #### Table (https://grafana.com/plugins/table) -There are no any tricks in displaying time-series data. But to display some summary we will need to fake timestamp data: +There are no any tricks in displaying time-series data. To print summary data, omit time column, and format the result as "Table". ``` SELECT - rand() Time, /* fake timestamp value */ UserName, sum(Reqs) as Reqs FROM requests @@ -266,9 +255,6 @@ ORDER BY Reqs ``` -Better to hide `Time` column at `Options` tab while editing panel - - #### Vertical histogram (https://grafana.com/plugins/graph) ![vertical histogram](https://cloud.githubusercontent.com/assets/2902918/25392561/9f3777e0-29e1-11e7-8b23-2ea9ae46a029.png) @@ -296,10 +282,6 @@ If you have a table with country/city codes: ``` SELECT 1, - groupArray((c, Reqs)) AS groupArr -FROM -( - SELECT CountryCode AS c, sum(requests) AS Reqs FROM requests @@ -312,7 +294,6 @@ WHERE $timeFilter GROUP BY c ORDER BY Reqs DESC -) ``` If you are using [geohash](https://github.com/grafana/worldmap-panel#geohashes-as-the-data-source) set following options: @@ -327,11 +308,12 @@ And make following query with `Table` formatting: ### Ad-hoc filters If there is an Ad-hoc variable, plugin will fetch all columns of all tables of all databases (except system database) as tags. -So in dropdown menu will be options like `database.table.column`. If there are ENUM columns, +So in dropdown menu will be options like `database.table.column`. If the default database is specified, it will only fetch tables and columns from that database, and the dropdown menu will have option like `table.column`. If there are ENUM columns, plugin will fetch their options and use them as tag values. Plugin will apply Ad-hoc filters to all queries on the dashboard if their settings `$database` and `$table` are the same -as Ad-hoc's `database.table` +as Ad-hoc's `database.table`. If the ad-hoc filter doesn't specify table, it will apply to all queries regardless of the table. +This is useful if the dashboard contains queries to multiple different tables. ![ad-hoc](https://user-images.githubusercontent.com/2902918/37139531-ed67f222-22b6-11e8-8815-9268850f16fb.png) @@ -353,6 +335,19 @@ That's why plugin checks prev datapoints and tries to predict last datapoint val Alerts feature requires changes in `Grafana`'s backend, which can't be extended for now. `Grafana`'s maintainers are working on this feature. +### Build + +The build works with either NPM or Yarn: + +``` +yarn run build +``` + +Tests can be run with Karma: + +``` +yarn run test +``` ### Contribute diff --git a/dist/adhoc.js b/dist/adhoc.js index 221d0e708..ee1deb3bf 100644 --- a/dist/adhoc.js +++ b/dist/adhoc.js @@ -1,9 +1,10 @@ System.register([], function(exports_1) { - var columnsQuery, regexEnum, AdhocCtrl; + var queryFilter, columnsQuery, regexEnum, AdhocCtrl; return { setters:[], execute: function() { - columnsQuery = "SELECT database, table, name, type FROM system.columns where database != 'system' ORDER BY database, table"; + queryFilter = "database != 'system'"; + columnsQuery = "SELECT database, table, name, type FROM system.columns WHERE {filter} ORDER BY database, table"; regexEnum = /'(?:[^']+|'')+'/gmi; AdhocCtrl = (function () { /** @ngInject */ @@ -16,10 +17,19 @@ System.register([], function(exports_1) { if (this.tagKeys.length > 0) { return Promise.resolve(this.tagKeys); } - return datasource.metricFindQuery(columnsQuery) + var filter = queryFilter; + if (datasource.defaultDatabase.length > 0) { + filter = "database = '" + datasource.defaultDatabase + "' AND " + queryFilter; + } + var query = columnsQuery.replace('{filter}', queryFilter); + return datasource.metricFindQuery(query) .then(function (response) { + var columnNames = {}; response.forEach(function (item) { - var text = item.database + '.' + item.table + '.' + item.name; + var text = item.table + '.' + item.name; + if (datasource.defaultDatabase.length == 0) { + text = item.database + '.' + text; + } var value = item.name; self.tagKeys.push({ text: text, value: value }); if (item.type.slice(0, 4) === 'Enum') { @@ -29,8 +39,14 @@ System.register([], function(exports_1) { options.forEach(function (o) { self.tagValues[text].push({ text: o, value: o }); }); + self.tagValues[item.name] = self.tagValues[text]; } } + columnNames[item.name] = true; + }); + /* Store unique column names with wildcard table */ + Object.keys(columnNames).forEach(function (columnName) { + self.tagKeys.push({ text: columnName, value: columnName }); }); return Promise.resolve(self.tagKeys); }); diff --git a/dist/adhoc.js.map b/dist/adhoc.js.map index 54f2ac413..12af56d27 100644 --- a/dist/adhoc.js.map +++ b/dist/adhoc.js.map @@ -1 +1 @@ -{"version":3,"file":"adhoc.js","sourceRoot":"","sources":["adhoc.ts"],"names":["AdhocCtrl","AdhocCtrl.constructor","AdhocCtrl.GetTagKeys","AdhocCtrl.GetTagValues"],"mappings":";QAAM,YAAY,EACZ,SAAS;;;;YADT,YAAY,GAAG,4GAA4G,CAAC;YAC5H,SAAS,GAAG,oBAAoB,CAAC;YAEvC;gBAIIA,gBAAgBA;gBAChBA;oBACIC,IAAIA,CAACA,OAAOA,GAAGA,EAAEA,CAACA;oBAClBA,IAAIA,CAACA,SAASA,GAAGA,EAAEA,CAACA;gBACxBA,CAACA;gBAEDD,8BAAUA,GAAVA,UAAWA,UAAeA;oBACtBE,IAAIA,IAAIA,GAAGA,IAAIA,CAACA;oBAChBA,EAAEA,CAACA,CAACA,IAAIA,CAACA,OAAOA,CAACA,MAAMA,GAAGA,CAACA,CAACA,CAACA,CAACA;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A,UAAaA,OAAOA;oBAChBG,EAAEA,CAACA,CAACA,IAAIA,CAACA,SAASA,CAACA,cAAcA,CAACA,OAAOA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA;wBAC7CA,MAAMA,CAACA,OAAOA,CAACA,OAAOA,CAACA,IAAIA,CAACA,SAASA,CAACA,OAAOA,CAACA,GAAGA,CAACA,CAACA,CAACA;oBACxDA,CAACA;oBACDA,MAAMA,CAACA,OAAOA,CAACA,OAAOA,CAACA,EAAEA,CAACA,CAAAA;gBAC9BA,CAACA;gBACLH,gBAACA;YAADA,CAACA,AA1CD,IA0CC;YA1CD,+BA0CC,CAAA"} \ No newline at end of file +{"version":3,"file":"adhoc.js","sourceRoot":"","sources":["adhoc.ts"],"names":["AdhocCtrl","AdhocCtrl.constructor","AdhocCtrl.GetTagKeys","AdhocCtrl.GetTagValues"],"mappings":";QAAM,WAAW,EACX,YAAY,EACZ,SAAS;;;;YAFT,WAAW,GAAG,sBAAsB,CAAA;YACpC,YAAY,GAAG,gGAAgG,CAAC;YAChH,SAAS,GAAG,oBAAoB,CAAC;YAEvC;gBAIIA,gBAAgBA;gBAChBA;oBACIC,IAAIA,CAACA,OAAOA,GAAGA,EAAEA,CAACA;oBAClBA,IAAIA,CAACA,SAASA,GAAGA,EAAEA,CAACA;gBACxBA,CAACA;gBAEDD,8BAAUA,GAAVA,UAAWA,UAAeA;oBACtBE,IAAIA,IAAIA,GAAGA,IAAIA,CAACA;oBAChBA,EAAEA,CAACA,CAACA,IAAIA,CAACA,OAAOA,CAACA,MAAMA,GAAGA,CAACA,CAACA,CAACA,CAACA;wBAC1BA,MAAMA,CAACA,OAAOA,CAACA,OAAOA,CAACA,IAAIA,CAACA,OAAOA,CAACA,CAACA;oBACzCA,CAACA;oBACDA,IAAIA,MAAMA,GAAGA,WAAWA,CAACA;oBACzBA,EAAEA,CAACA,CAACA,UAAUA,CAACA,eAAeA,CAACA,MAAMA,GAAGA,CAACA,CAACA,CAACA,CAACA;wBAC3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AAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAC,CAAC,CAAA;oCAClD,CAAC,CAAC,CAAA;oCACF,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;gCACrD,CAAC;4BACL,CAAC;4BACD,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;wBACjC,CAAC,CAAC,CAAC;wBACH,mDAAmD;wBACnD,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,UAAA,UAAU;4BACvC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAC,CAAC,CAAC;wBAC7D,CAAC,CAAC,CAAC;wBACH,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;oBACzC,CAAC,CAACA,CAACA;gBAEXA,CAACA;gBAEDF,gCAAYA,GAAZA,UAAaA,OAAOA;oBAChBG,EAAEA,CAACA,CAACA,IAAIA,CAACA,SAASA,CAACA,cAAcA,CAACA,OAAOA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA;wBAC7CA,MAAMA,CAACA,OAAOA,CAACA,OAAOA,CAACA,IAAIA,CAACA,SAASA,CAACA,OAAOA,CAACA,GAAGA,CAACA,CAACA,CAACA;oBACxDA,CAACA;oBACDA,MAAMA,CAACA,OAAOA,CAACA,OAAOA,CAACA,EAAEA,CAACA,CAAAA;gBAC9BA,CAACA;gBACLH,gBAACA;YAADA,CAACA,AAzDD,IAyDC;YAzDD,+BAyDC,CAAA"} \ No newline at end of file diff --git a/dist/adhoc.ts b/dist/adhoc.ts index 6e7d7f88d..824155102 100644 --- a/dist/adhoc.ts +++ b/dist/adhoc.ts @@ -1,4 +1,5 @@ -const columnsQuery = "SELECT database, table, name, type FROM system.columns where database != 'system' ORDER BY database, table"; +const queryFilter = "database != 'system'" +const columnsQuery = "SELECT database, table, name, type FROM system.columns WHERE {filter} ORDER BY database, table"; const regexEnum = /'(?:[^']+|'')+'/gmi; export default class AdhocCtrl { @@ -16,10 +17,19 @@ export default class AdhocCtrl { if (this.tagKeys.length > 0) { return Promise.resolve(this.tagKeys); } - return datasource.metricFindQuery(columnsQuery) + let filter = queryFilter; + if (datasource.defaultDatabase.length > 0) { + filter = "database = '" + datasource.defaultDatabase + "' AND " + queryFilter; + } + let query = columnsQuery.replace('{filter}', queryFilter); + return datasource.metricFindQuery(query) .then(function(response){ + let columnNames = {}; response.forEach(function(item){ - let text = item.database + '.' + item.table + '.' + item.name; + let text = item.table + '.' + item.name; + if (datasource.defaultDatabase.length == 0) { + text = item.database + '.' + text; + } let value = item.name; self.tagKeys.push({text: text, value: value}); if (item.type.slice(0, 4) === 'Enum') { @@ -29,8 +39,14 @@ export default class AdhocCtrl { options.forEach(function(o) { self.tagValues[text].push({text: o, value: o}) }) + self.tagValues[item.name] = self.tagValues[text]; } } + columnNames[item.name] = true; + }); + /* Store unique column names with wildcard table */ + Object.keys(columnNames).forEach(columnName => { + self.tagKeys.push({text: columnName, value: columnName}); }); return Promise.resolve(self.tagKeys); }); diff --git a/dist/clickhouse-info.js.map b/dist/clickhouse-info.js.map index f0876c789..41a284098 100644 --- a/dist/clickhouse-info.js.map +++ b/dist/clickhouse-info.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/clickhouse-info.js"],"names":["ace","define","require","exports","module","p","Keywords","DataTypes","Constants","Funcs","Macros","KeywordsRe","re","ConstantsRe","FunctionsRe","concat","DataTypesRe","FunctionsCompletions","MacrosCompletions","list","join","ClickhouseInfo"],"mappings":";;;;;;;;AAAA;AACA;;AAEAA,gBAAIC,MAAJ,CAAW,0BAAX,EAAuC,CAAC,SAAD,EAAY,SAAZ,EAAuB,QAAvB,CAAvC,EAAyE,UAAUC,OAAV,EAAmBC,OAAnB,EAA4BC,MAA5B,EAAoC;AACzG;;AAEA,o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AAW;AAHf,qBADG,EAMH;AACI,gCAAQ,UADZ;AAEI,+BAAO,UAFX;AAGI,mCAAW;AAHf,qBANG,EAWH;AACI,gCAAQ,cADZ;AAEI,+BAAO,cAFX;AAGI,mCAAW;AAHf,qBAXG,EAgBH;AACI,gCAAQ,OADZ;AAEI,+BAAO,OAFX;AAGI,mCAAW;AAHf,qBAhBG,EAqBH;AACI,gCAAQ,KADZ;AAEI,+BAAO,KAFX;AAGI,mCAAW;AAHf,qBArBG,EA0BH;AACI,gCAAQ,WADZ;AAEI,+BAAO,WAFX;AAGI,mCAAW;AAHf,qBA1BG,EA+BH;AACI,gCAAQ,aADZ;AAEI,+BAAO,aAFX;AAGI,mCAAW;AAHf,qBA/BG,EAoCH;AACI,gCAAQ,aADZ;AAEI,+BAAO,aAFX;AAGI,mCAAW;AAHf,qBApCG,EAyCH;AACI,gCAAQ,OADZ;AAEI,+BAAO,gBAFX;AAGI,mCAAW,qGACX,IADW,GAEX;AALJ,qBAzCG,EAgDH;AACI,gCAAQ,UADZ;AAEI,+BAAO,sBAFX;AAGI,mCAAW,2HACX,IADW,GAEX;AALJ,qBAhDG,EAuDH;AACI,gCAAQ,cADZ;AAEI,+BAAO,0BAFX;AAGI,mCAAW,iDACX,IADW,GAEX;AALJ,qBAvDG,EA8DH;AACI,gCAAQ,WADZ;AAEI,+BAAO,sBAFX;AAGI,mCAAW,uDACX,IADW,GAEX;AALJ,qBA9DG,CAAP;AAsEH,iBAvED;;AAyEAb,kBAAEO,EAAF,GAAO,UAAUO,IAAV,EAAgB;AACnB,2BAAOA,KAAKC,IAAL,CAAU,GAAV,CAAP;AACH,iBAFD;;AAIAjB,wBAAQkB,cAAR,GAAyBhB,CAAzB;AACH,aAhlED","file":"clickhouse-info.js","sourcesContent":["// jshint ignore: start\n// jscs: disable\n\nace.define(\"ace/mode/clickhouse_info\", [\"require\", \"exports\", \"module\"], function (require, exports, module) {\n \"use strict\";\n\n var p = {};\n p.Keywords = [\n \"SELECT\",\n \"CASE\",\n \"THEN\",\n \"DISTINCT\",\n \"INSERT\",\n \"UPDATE\",\n \"DELETE\",\n \"WHERE\",\n \"AND\",\n \"OR\",\n \"OFFSET\",\n \"HAVING\",\n \"AS\",\n \"GLOBAL\",\n \"FROM\",\n \"WHEN\",\n \"ELSE\",\n \"END\",\n \"TYPE\",\n \"LEFT\",\n \"RIGHT\",\n \"USING\",\n \"JOIN\",\n \"ON\",\n \"OUTER\",\n \"DESC\",\n \"ASC\",\n \"UNION\",\n \"CREATE\",\n \"TABLE\",\n \"PRIMARY\",\n \"KEY\",\n \"FOREIGN\",\n \"NOT\",\n \"REFERENCES\",\n \"DEFAULT\",\n \"INNER\",\n \"CROSS\",\n \"NATURAL\",\n \"DATABASE\",\n \"DROP\",\n \"GRANT\",\n \"ANY\",\n \"BETWEEN\",\n \"ATTACH\",\n \"DETACH\",\n \"CAST\",\n \"WITH\",\n \"BIT_AND\",\n \"BIT_OR\",\n \"BIT_XOR\",\n \"DESCRIBE\",\n \"OPTIMIZE\",\n \"PREWHERE\",\n \"TOTALS\",\n \"DATABASES\",\n \"PROCESSLIST\",\n \"SHOW\",\n \"LIMIT\",\n \"IF\",\n \"IF NOT EXISTS\",\n \"IF EXISTS\",\n \"GROUP\",\n \"ORDER\",\n \"BY\",\n \"IN\",\n \"FORMAT\",\n \"GROUP BY\",\n \"ORDER BY\",\n \"UNION ALL\"\n ];\n p.DataTypes = [\n \"int\",\n \"numeric\",\n \"decimal\",\n \"date\",\n \"varchar\",\n \"char\",\n \"bigint\",\n \"float\",\n \"double\",\n \"bit\",\n \"binary\",\n \"text\",\n \"set\",\n \"timestamp\",\n \"uint8\",\n \"uint16\",\n \"uint32\",\n \"uint64\",\n \"int8\",\n \"int16\",\n \"int32\",\n \"int64\",\n \"float32\",\n \"float64\",\n \"datetime\",\n \"enum8\",\n \"enum16\",\n \"array\",\n \"tuple\",\n \"string\"\n ];\n p.Constants = [\n \"true\",\n \"false\",\n \"NULL\"\n ];\n p.Funcs = [\n \"IPv4NumToString\", \"IPv4NumToStringClassC\", \"IPv4StringToNum\", \"IPv6NumToString\", \"IPv6StringToNum\",\n \"MD5\", \"OSHierarchy\", \"OSIn\", \"OSToRoot\", \"SEHierarchy\", \"SEIn\", \"SEToRoot\", \"SHA1\", \"SHA224\", \"SHA256\",\n \"URLHash\", \"URLHierarchy\", \"URLPathHierarchy\", \"abs\", \"alphaTokens\", \"appendTrailingCharIfAbsent\",\n \"argMax\", \"argMin\", \"argMinIf\", \"arrayAll\", \"arrayCount\", \"arrayElement\", \"arrayEnumerate\", \"arrayEnumerateUniq\",\n \"arrayExists\", \"arrayFilter\", \"arrayFirst\", \"arrayJoin\", \"arrayMap\", \"arraySum\", \"avg\", \"avgIf\",\n \"bitAnd\", \"bitNot\", \"bitOr\", \"bitShiftLeft\", \"bitShiftRight\", \"bitXor\", \"bitmaskToArray\", \"bitmaskToList\",\n \"ceil\", \"cityHash64\", \"coalesce\", \"concat\", \"corr\", \"corrIf\", \"count\", \"countEqual\", \"countIf\", \"countIf\",\n \"covarPop\", \"covarPopIf\", \"covarSamp\", \"covarSampIf\", \"cutFragment\", \"cutQueryString\", \"cutQueryStringAndFragment\",\n \"cutToFirstSignificantSubdomain\", \"cutURLParameter\", \"cutWWW\", \"dictGetDate\", \"dictGetDateTime\", \"dictGetFloat32\",\n \"dictGetFloat64\", \"dictGetHierarchy\", \"dictGetInt16\", \"dictGetInt32\", \"dictGetInt64\", \"dictGetInt8\", \"dictGetString\",\n \"dictGetUInt16\", \"dictGetUInt32\", \"dictGetUInt64\", \"dictGetUInt8\", \"dictHas\", \"dictIsIn\", \"divide\", \"domainWithoutWWW\",\n \"empty\", \"extract\", \"extractAll\", \"extractURLParameter\", \"extractURLParameterNames\", \"extractURLParameters\",\n \"first\", \"firstSignificantSubdomain\", \"floor\", \"groupArray\", \"groupUniqArray\", \"halfMD5\", \"has\", \"hex\", \"ifnull\",\n \"indexOf\", \"intDiv\", \"intDivOrZero\", \"intHash32\", \"intHash64\", \"isnull\", \"last\", \"lcase\", \"length\", \"lengthUTF8\",\n \"like\", \"lower\", \"lowerUTF8\", \"match\", \"max\", \"median\", \"medianIf\", \"mid\", \"min\", \"minus\", \"modulo\", \"multiply\",\n \"negate\", \"notEmpty\", \"notLike\", \"now\", \"now\", \"nvl\", \"plus\", \"position\", \"positionUTF8\", \"quantile\",\n \"quantileDeterministic\", \"quantileExact\", \"quantileExactWeighted\", \"quantileTDigest\", \"quantileTiming\",\n \"quantileTimingWeighted\", \"quantiles\", \"quantilesIf\", \"quantilesTimingArrayIf\", \"quantilesTimingIf\", \"queryString\",\n \"queryStringAndFragment\", \"rand\", \"rand64\", \"range\", \"rank\", \"regionHierarchy\", \"regionIn\", \"regionToContinent\",\n \"regionToCountry\", \"regionToName\", \"regionToPopulation\", \"reinterpretAsDate\", \"reinterpretAsDateTime\", \"reinterpretAsFloat32\",\n \"reinterpretAsFloat64\", \"reinterpretAsInt16\", \"reinterpretAsInt32\", \"reinterpretAsInt64\", \"reinterpretAsInt8\", \"reinterpretAsString\",\n \"reinterpretAsUInt16\", \"reinterpretAsUInt32\", \"reinterpretAsUInt64\", \"reinterpretAsUInt8\", \"replaceAll\", \"replaceOne\",\n \"replaceRegexpOne\", \"reverse\", \"reverseUTF8\", \"round\", \"round\", \"roundAge\", \"roundDuration\", \"roundToExp2\", \"sequenceCount\",\n \"sequenceMatch\", \"sipHash128\", \"sipHash64\", \"splitByChar\", \"splitByString\", \"stddevPop\", \"stddevPopIf\", \"stddevSamp\",\n \"stddevSampIf\", \"substring\", \"substringUTF8\", \"sum\", \"sumArray\", \"sumArrayIf\", \"sumIf\", \"timeSlot\", \"toDate\", \"toDateTime\",\n \"toDayOfMonth\", \"toDayOfWeek\", \"toFixedString\", \"toFloat32\", \"toFloat64\", \"toHour\", \"toInt16\", \"toInt32\", \"toInt64\", \"toInt8\",\n \"toMinute\", \"toMonday\", \"toMonth\", \"toRelativeDayNum\", \"toRelativeHourNum\", \"toRelativeMinuteNum\", \"toRelativeMonthNum\",\n \"toRelativeSecondNum\", \"toRelativeWeekNum\", \"toRelativeYearNum\", \"toSecond\", \"toStartOfFiveMinute\", \"toStartOfHour\",\n \"toStartOfMinute\", \"toStartOfMonth\", \"toStartOfQuarter\", \"toStartOfYear\", \"toString\", \"toStringCutToZero\", \"toTime\", \"toUInt16\",\n \"toUInt32\", \"toUInt64\", \"toUInt8\", \"toYear\", \"today\", \"topLevelDomain\", \"ucase\", \"unhex\", \"uniq\", \"uniqArray\", \"uniqArrayIf\",\n \"uniqArrayIf\", \"uniqCombined\", \"uniqCombinedIf\", \"uniqExact\", \"uniqExactIf\", \"uniqHLL12\", \"uniqUpTo\", \"upper\", \"upperUTF8\", \"varPop\", \"varPopIf\",\n \"varSamp\", \"varSampIf\", \"yesterday\"\n ];\n p.Macros = [\n \"$table\",\n \"$dateCol\",\n \"$dateTimeCol\",\n \"$from\",\n \"$to\",\n \"$interval\",\n \"$timeFilter\",\n \"$timeSeries\",\n \"$rate\",\n \"$columns\",\n \"$rateColumns\",\n \"$unescape\"\n ];\n p.KeywordsRe = function () {\n return this.re(p.Keywords)\n };\n p.ConstantsRe = function () {\n return this.re(p.Constants)\n };\n p.FunctionsRe = function () {\n return this.re(p.Funcs).concat(this.re(p.Macros))\n };\n p.DataTypesRe = function () {\n return this.re(p.DataTypes);\n };\n p.FunctionsCompletions = function () {\n return [\n {\n \"name\": \"corr\",\n \"def\": \"corr(x, y)\",\n \"docText\": \"Calculates the Pearson correlation coefficient: Σ((x - x̅)(y - y̅)) / sqrt(Σ((x - x̅)2) * Σ((y - y̅)2)).\"\n },\n {\n \"name\": \"stddevPop\",\n \"def\": \"stddevPop(x)\",\n \"docText\": \"The result is equal to the square root of `varPop(x)`.\"\n },\n {\n \"name\": \"varPop\",\n \"def\": \"varPop(x, y)\",\n \"docText\": \"Calculates the value of `Σ((x - x̅)(y - y̅)) / n`.\"\n },\n {\n \"name\": \"argMin\",\n \"def\": \"argMin(arg, val)\",\n \"docText\": \"Calculates the `arg` value for a minimal `val` value. If there are several different values of `arg` for minimal values of `val`, the first of these values encountered is output.\"\n },\n {\n \"name\": \"quantileExactWeighted\",\n \"def\": \"quantileExactWeighted(level)(x, weight)\",\n \"docText\": \"Computes the level quantile exactly. In this case, each value is taken into account with the weight weight - as if it is present weight once. The arguments of the function can be considered as histograms, where the value \\\"x\\\" corresponds to the \\\"column\\\" of the histogram of the height weight, and the function itself can be considered as the summation of histograms.\\n\" +\n \"\\n\" +\n \"The algorithm is a hash table. Because of this, in case the transmitted values ​​are often repeated, the function consumes less RAM than the quantileExact. You can use this function instead of quantileExact, specifying the number 1 as the weight.\"\n },\n {\n \"name\": \"min\",\n \"def\": \"min(v)\",\n \"docText\": \"Minimal execution speed in rows per second. Checked on every data block when `timeout_before_checking_execution_speed` expires. If the execution speed is lower, an exception is thrown.\"\n },\n {\n \"name\": \"varSamp\",\n \"def\": \"varSamp(x)\",\n \"docText\": \"Calculates the amount Σ((x - x̅)2) / (n - 1), where 'n' is the sample size and 'x̅' is the average value of 'x'.\\n\" +\n \"\\n\" +\n \"It represents an unbiased estimate of the variance of a random variable, if the values passed to the function are a sample of this random amount.\\n\" +\n \"\\n\" +\n \"Returns Float64. If n <= 1, it returns +∞.\"\n },\n {\n \"name\": \"anyLast\",\n \"def\": \"anyLast(x)\",\n \"docText\": \"Selects the last value encountered. \\n\" +\n \"\\n\" +\n \" The result is just as indeterminate as for the `any` function.\"\n },\n {\n \"name\": \"argMax\",\n \"def\": \"argMax(arg, val)\",\n \"docText\": \"Calculates the `arg` value for a maximum `val` value. If there are several different values of `arg` for maximum values of `val`, the first of these values encountered is output.\"\n },\n {\n \"name\": \"count\",\n \"def\": \"count()\",\n \"docText\": \"Counts the number of rows. \"\n },\n {\n \"name\": \"any\",\n \"def\": \"any(x)\",\n \"docText\": \"Selects the last value encountered. \\n\" +\n \"\\n\" +\n \" The result is just as indeterminate as for the `any` function.\"\n },\n {\n \"name\": \"avg\",\n \"def\": \"avg(x)\",\n \"docText\": \"Calculates the average. \\n\" +\n \"\\n\" +\n \" Only works for numbers. \\n\" +\n \"\\n\" +\n \" The result is always Float64.\"\n },\n {\n \"name\": \"sequenceMatch\",\n \"def\": \"sequenceMatch(pattern)(time, cond1, cond2, ...)\",\n \"docText\": \"Pattern matching for event chains.\\n\" +\n \"\\n\" +\n \"'pattern' is a string containing a pattern to match. The pattern is similar to a regular expression. 'time' is the event time of the DateTime type. 'cond1, cond2 ...' are from one to 32 arguments of the UInt8 type that indicate whether an event condition was met.\\n\" +\n \"\\n\" +\n \"The function collects a sequence of events in RAM. Then it checks whether this sequence matches the pattern. It returns UInt8 - 0 if the pattern isn't matched, or 1 if it matches.\\n\" +\n \"\\n\" +\n \"Example: sequenceMatch('(?1).*(?2)')(EventTime, URL LIKE '%company%', URL LIKE '%cart%') - whether there was a chain of events in which pages with the address in company were visited earlier than pages with the address in cart.\"\n },\n {\n \"name\": \"stddevSamp\",\n \"def\": \"stddevSamp(x)\",\n \"docText\": \"The result is equal to the square root of `varSamp(x)`.\"\n },\n {\n \"name\": \"medianDeterministic\",\n \"def\": \"medianDeterministic(x, determinator)\",\n \"docText\": \"This function works similarly to the `median` function - it approximates the median.\"\n },\n {\n \"name\": \"quantilesTimingWeighted\",\n \"def\": \"quantilesTimingWeighted(level1, level2, ...)(x, weight)\",\n \"docText\": \"Calculates the quantiles of all specified levels using the same algorithm as the `medianTimingWeighted` function.\"\n },\n {\n \"name\": \"uniq\",\n \"def\": \"uniq(N)(x)\",\n \"docText\": \"Calculates the number of different argument values, if it is less than or equal to N. \\n\" +\n \"\\n\" +\n \" If the number of different argument values is greater than N, it returns N + 1.\"\n },\n {\n \"name\": \"covarSamp\",\n \"def\": \"covarSamp(x, y)\",\n \"docText\": \"Calculates the value of `Σ((x - x̅)(y - y̅)) / (n - 1)`. \" +\n \"Returns Float64. If n <= 1, it returns +∞.\"\n },\n {\n \"name\": \"max\",\n \"def\": \"max(v)\",\n \"docText\": \"Maximum number of bytes (uncompressed data) that can be passed to a remote server or saved in a temporary table when using GLOBAL IN.\"\n },\n {\n \"name\": \"quantileTDigest\",\n \"def\": \"quantileTDigest(level)(x)\",\n \"docText\": \"t-digest\"\n },\n {\n \"name\": \"quantilesTiming\",\n \"def\": \"quantilesTiming(level1, level2, ...)(x, weight)\",\n \"docText\": \"Calculates the quantiles of all specified levels using the same algorithm as the `medianTimingWeighted` function.\"\n },\n {\n \"name\": \"quantiles\",\n \"def\": \"quantiles(level1, level2, ...)(x, determinator)\",\n \"docText\": \"Calculates the quantiles of all specified levels using the same algorithm as the `medianDeterministic` function.\"\n },\n {\n \"name\": \"quantile\",\n \"def\": \"quantile(level1, level2, ...)(x, determinator)\",\n \"docText\": \"Calculates the quantiles of all specified levels using the same algorithm as the `medianDeterministic` function.\"\n },\n {\n \"name\": \"groupArray\",\n \"def\": \"groupArray(x)\",\n \"docText\": \"Creates an array of argument values. \\n\" +\n \"\\n\" +\n \" Values can be added to the array in any (indeterminate) order. \\n\" +\n \"\\n\" +\n \" In some cases, you can rely on the order of execution. This applies to cases when SELECT comes from a subquery that uses ORDER BY.\"\n },\n {\n \"name\": \"sum\",\n \"def\": \"sum(x)\",\n \"docText\": \"Calculates the sum. \\n\" +\n \"\\n\" +\n \" Only works for numbers.\"\n },\n {\n \"name\": \"median\",\n \"def\": \"median(x, weight)\",\n \"docText\": \"Differs from the `medianTiming` function in that it has a second argument - `weights`. Weight is a non-negative integer. \\n\" +\n \"\\n\" +\n \" The result is calculated as if the `x` value were passed `weight` number of times to the `medianTiming` function.\"\n },\n {\n \"name\": \"quantileTiming\",\n \"def\": \"quantileTiming(level)(x, weight)\",\n \"docText\": \"Calculates the quantile of `level` using the same algorithm as the `medianTimingWeighted` function.\"\n },\n {\n \"name\": \"quantileTimingWeighted\",\n \"def\": \"quantileTimingWeighted(level)(x, weight)\",\n \"docText\": \"Calculates the quantile of `level` using the same algorithm as the `medianTimingWeighted` function.\"\n },\n {\n \"name\": \"groupUniqArray\",\n \"def\": \"groupUniqArray(x)\",\n \"docText\": \"Creates an array from different argument values. Memory consumption is the same as for the `uniqExact` function.\"\n },\n {\n \"name\": \"uniqHLL12\",\n \"def\": \"uniqHLL12(x)\",\n \"docText\": \"Uses the HyperLogLog algorithm to approximate the number of different values of the argument. \"\n },\n {\n \"name\": \"covarPop\",\n \"def\": \"covarPop(x, y)\",\n \"docText\": \"Calculates the value of `Σ((x - x̅)(y - y̅)) / n`.\"\n },\n {\n \"name\": \"sequenceCount\",\n \"def\": \"sequenceCount(pattern)(time, cond1, cond2, ...)\",\n \"docText\": \"sequenceMatch\"\n },\n {\n \"name\": \"quantileDeterministic\",\n \"def\": \"quantileDeterministic(level)(x, determinator)\",\n \"docText\": \"Calculates the quantile of `level` using the same algorithm as the `medianDeterministic` function.\"\n },\n {\n \"name\": \"quantileExact\",\n \"def\": \"quantileExact(level)(x, weight)\",\n \"docText\": \"\"\n },\n {\n \"name\": \"quantilesDeterministic\",\n \"def\": \"quantilesDeterministic(level1, level2, ...)(x, determinator)\",\n \"docText\": \"Calculates the quantiles of all specified levels using the same algorithm as the `medianDeterministic` function.\"\n },\n {\n \"name\": \"medianTiming\",\n \"def\": \"medianTiming(x, weight)\",\n \"docText\": \"Differs from the `medianTiming` function in that it has a second argument - `weights`.\"\n },\n {\n \"name\": \"medianTimingWeighted\",\n \"def\": \"medianTimingWeighted(x, weight)\",\n \"docText\": \"Differs from the `medianTiming` function in that it has a second argument - `weights`.\"\n },\n {\n \"name\": \"uniqExact\",\n \"def\": \"uniqExact(x)\",\n \"docText\": \"Calculates the number of different values of the argument, exactly. \\n\" +\n \"\\n\" +\n \" There is no reason to fear approximations, so it`s better to use the `uniq` function. \\n\" +\n \"\\n\" +\n \" You should use the `uniqExact` function if you definitely need an exact result. \"\n },\n {\n \"name\": \"uniqCombined\",\n \"def\": \"uniqCombined(x)\",\n \"docText\": \"\"\n },\n {\n \"name\": \"uniqCombinedIf\",\n \"def\": \"uniqCombinedIf(x,v)\",\n \"docText\": \"\"\n },\n {\n \"name\": \"uniqUpTo\",\n \"def\": \"uniqUpTo(N)(x)\",\n \"docText\": \"Calculates the number of different argument values, if it is less than or equal to N. \\n\" +\n \"\\n\" +\n \" If the number of different argument values is greater than N, it returns N + 1.\"\n },\n {\n \"name\": \"substring\",\n \"def\": \"substring(s, offset, length)\",\n \"docText\": \"The same as `substring`, but for Unicode code points. Works under the assumption that the string contains a set of bytes representing a UTF-8 encoded text. If this assumption is not met, it returns some result (it doesn`t throw an exception).\"\n },\n {\n \"name\": \"notLike\",\n \"def\": \"notLike(haystack, pattern), haystack NOT LIKE pattern operator\",\n \"docText\": \"The same thing as `like`, but negative.\"\n },\n {\n \"name\": \"hostName\",\n \"def\": \"hostName()\",\n \"docText\": \"Returns a string with the name of the host that this function was performed on. For distributed processing, this is the name of the remote server host, if the function is performed on a remote server.\"\n },\n {\n \"name\": \"globalNotIn\",\n \"def\": \"globalNotIn(v)\",\n \"docText\": \"See the section `IN operators`.\"\n },\n {\n \"name\": \"or\",\n \"def\": \"or(v)\",\n \"docText\": \"The same thing as `max_temporary_columns`, but without counting constant columns. \\n\" +\n \"\\n\" +\n \" Note that constant columns are formed fairly often when running a query, but they require approximately zero computing resources.\"\n },\n {\n \"name\": \"extractAll\",\n \"def\": \"extractAll(haystack, pattern)\",\n \"docText\": \"Extracts all the fragments of a string using a regular expression. If `haystack` doesn`t match the `pattern` regex, an empty string is returned. Returns an array of strings consisting of all matches to the regex.\"\n },\n {\n \"name\": \"arrayFirst\",\n \"def\": \"arrayFirst(func, arr1, ...)\",\n \"docText\": \"Returns the index of the first element in the `arr1` array for which `func` returns something other than 0.\"\n },\n {\n \"name\": \"arrayExists\",\n \"def\": \"arrayExists([func,] arr1, ...)\",\n \"docText\": \"Returns 1 if there is at least one element in `arr` for which `func` returns something other than 0. Otherwise, it returns 0.\"\n },\n {\n \"name\": \"arrayCount\",\n \"def\": \"arrayCount([func,] arr1, ...)\",\n \"docText\": \"Returns the number of elements in `arr` for which `func` returns something other than 0. If `func` is not specified, it returns the number of non-zero items in the array.\"\n },\n {\n \"name\": \"arrayMap\",\n \"def\": \"arrayMap(func, arr1, ...)\",\n \"docText\": \"Returns an array obtained from the original application of the `func` function to each element in the `arr` array.\"\n },\n {\n \"name\": \"now\",\n \"def\": \"now(v)\",\n \"docText\": \"If the parameter is true, INSERT operation will skip columns with unknown names from input. \\n\" +\n \"\\n\" +\n \" Otherwise, an exception will be generated, it is default behavior. \\n\" +\n \"\\n\" +\n \" The parameter works only for JSONEachRow and TSKV input formats.\"\n },\n {\n \"name\": \"intDiv\",\n \"def\": \"intDiv(a, b)\",\n \"docText\": \"Differs from `intDiv` in that it returns zero when dividing by zero or when dividing a minimal negative number by minus one.\"\n },\n {\n \"name\": \"topLevelDomain\",\n \"def\": \"topLevelDomain(v)\",\n \"docText\": \"Selects the top-level domain. Example: .ru.\"\n },\n {\n \"name\": \"intHash32\",\n \"def\": \"intHash32(v)\",\n \"docText\": \"Calculates a 32-bit hash code from any type of integer. \\n\" +\n \"\\n\" +\n \" This is a relatively fast non-cryptographic hash function of average quality for numbers.\"\n },\n {\n \"name\": \"replaceOne\",\n \"def\": \"replaceOne(haystack, pattern, replacement)\",\n \"docText\": \"Replaces the first occurrence, if it exists, of the `pattern` substring in `haystack` with the `replacement` substring. \\n\" +\n \"\\n\" +\n \" Hereafter, `pattern` and `replacement` must be constants.\"\n },\n {\n \"name\": \"cityHash64\",\n \"def\": \"cityHash64(v)\",\n \"docText\": \"Calculates CityHash64 from a string or a similar hash function for any number of any type of arguments. \\n\" +\n \"\\n\" +\n \" For String-type arguments, CityHash is used. This is a fast non-cryptographic hash function for strings with decent quality\"\n },\n {\n \"name\": \"OSToRoot\",\n \"def\": \"OSToRoot(v)\",\n \"docText\": \"Accepts a UInt8 number - the ID of the operating system from the Yandex.Metrica dictionary. If any OS matches the passed number, it returns a UInt8 number - the ID of the corresponding root OS (for example, it converts Windows Vista to Windows). Otherwise, returns 0.\"\n },\n {\n \"name\": \"sipHash128\",\n \"def\": \"sipHash128(v)\",\n \"docText\": \"Calculates SipHash from a string. \\n\" +\n \"\\n\" +\n \" Accepts a String-type argument. Returns FixedString(16). \\n\" +\n \"\\n\" +\n \" Differs from sipHash64 in that the final xor-folding state is only done up to 128 bits.\"\n },\n {\n \"name\": \"SHA1\",\n \"def\": \"SHA1(v)\",\n \"docText\": \"Calculates SHA-1, SHA-224, or SHA-256 from a string and returns the resulting set of bytes as FixedString(20), FixedString(28), or FixedString(32).\"\n },\n {\n \"name\": \"asin\",\n \"def\": \"asin(x)\",\n \"docText\": \"The arc sine.\"\n },\n {\n \"name\": \"SHA256\",\n \"def\": \"SHA256(v)\",\n \"docText\": \"Calculates SHA-1, SHA-224, or SHA-256 from a string and returns the resulting set of bytes as FixedString(20), FixedString(28), or FixedString(32).\"\n },\n {\n \"name\": \"MD5\",\n \"def\": \"MD5(v)\",\n \"docText\": \"Calculates the MD5 from a string and returns the resulting set of bytes as FixedString(16).\"\n },\n {\n \"name\": \"bitmaskToList\",\n \"def\": \"bitmaskToList(num)\",\n \"docText\": \"Accepts an integer. Returns a string containing the list of powers of two that total the source number when summed. They are comma-separated without spaces in text format, in ascending order.\"\n },\n {\n \"name\": \"array\",\n \"def\": \"array(v)\",\n \"docText\": \"The -`Array` suffix can be appended to any aggregate function. In this case, the aggregate function takes arguments of the `Array(T)` type (arrays) instead of `T` type arguments. If the aggregate function accepts multiple arguments, this must be arrays of equal lengths. \"\n },\n {\n \"name\": \"dictGetStringOrDefault\",\n \"def\": \"dictGetStringOrDefault(v)\",\n \"docText\": \"dictGetT('dict_name', 'attr_name', id) Gets the value of the 'attr_name' attribute from the 'dict_name' dictionary by the 'id' key. 'dict_name' and 'attr_name' are constant strings. 'id' must be UInt64. If the 'id' key is not in the dictionary, it returns the default value set in the dictionary definition.\"\n },\n {\n \"name\": \"greaterOrEquals\",\n \"def\": \"greaterOrEquals(v)\",\n \"docText\": \"\"\n },\n {\n \"name\": \"e\",\n \"def\": \"e(v)\",\n \"docText\": \"What to do when the amount of data exceeds one of the limits: `throw` or `break`. By default, throw.\"\n },\n {\n \"name\": \"runningDifference\",\n \"def\": \"runningDifference(x)\",\n \"docText\": \"Calculates the difference between consecutive values in the data block. \\n\" +\n \"\\n\" +\n \" Result of the function depends on the order of the data in the blocks. \\n\" +\n \"\\n\" +\n \" It works only inside of the each processed block of data. Data splitting in the blocks is not explicitly controlled by the user. \"\n },\n {\n \"name\": \"not\",\n \"def\": \"not(v)\",\n \"docText\": \"See the section `IN operators`.\"\n },\n {\n \"name\": \"intHash64\",\n \"def\": \"intHash64(v)\",\n \"docText\": \"Calculates a 64-bit hash code from any type of integer. \\n\" +\n \"\\n\" +\n \" It works faster than intHash32. Average quality.\"\n },\n {\n \"name\": \"acos\",\n \"def\": \"acos(x)\",\n \"docText\": \"The arc cosine.\"\n },\n {\n \"name\": \"dictGetString\",\n \"def\": \"dictGetString(v)\",\n \"docText\": \"\"\n },\n {\n \"name\": \"and\",\n \"def\": \"and(x, determinator)\",\n \"docText\": \"This function works similarly to the `median` function - it approximates the median. However, in contrast to `median`, the result is deterministic and does not depend on the order of query execution. \\n\" +\n \"\\n\" +\n \" To achieve this, the function takes a second argument - the `determinator`. \"\n },\n {\n \"name\": \"dictGetDate\",\n \"def\": \"dictGetDate(v)\",\n \"docText\": \"dictGetT('dict_name', 'attr_name', id) Gets the value of the 'attr_name' attribute from the 'dict_name' dictionary by the 'id' key. 'dict_name' and 'attr_name' are constant strings. 'id' must be UInt64. If the 'id' key is not in the dictionary, it returns the default value set in the dictionary definition.\"\n },\n {\n \"name\": \"dictGetFloat32\",\n \"def\": \"dictGetFloat32(v)\",\n \"docText\": \"dictGetT('dict_name', 'attr_name', id) Gets the value of the 'attr_name' attribute from the 'dict_name' dictionary by the 'id' key. 'dict_name' and 'attr_name' are constant strings. 'id' must be UInt64. If the 'id' key is not in the dictionary, it returns the default value set in the dictionary definition.\"\n },\n {\n \"name\": \"dictGetInt8\",\n \"def\": \"dictGetInt8(v)\",\n \"docText\": \"dictGetT('dict_name', 'attr_name', id) Gets the value of the 'attr_name' attribute from the 'dict_name' dictionary by the 'id' key. 'dict_name' and 'attr_name' are constant strings. 'id' must be UInt64. If the 'id' key is not in the dictionary, it returns the default value set in the dictionary definition.\"\n },\n {\n \"name\": \"dictGetUInt32\",\n \"def\": \"dictGetUInt32(v)\",\n \"docText\": \"dictGetT('dict_name', 'attr_name', id) Gets the value of the 'attr_name' attribute from the 'dict_name' dictionary by the 'id' key. 'dict_name' and 'attr_name' are constant strings. 'id' must be UInt64. If the 'id' key is not in the dictionary, it returns the default value set in the dictionary definition.\"\n },\n {\n \"name\": \"OSIn\",\n \"def\": \"OSIn(lhs, rhs)\",\n \"docText\": \"Checks whether the `lhs` operating system belongs to the `rhs` operating system.\"\n },\n {\n \"name\": \"arrayFirstIndex\",\n \"def\": \"arrayFirstIndex(func, arr1, ...)\",\n \"docText\": \"Returns the index of the first element in the `arr1` array for which `func` returns something other than 0.\"\n },\n {\n \"name\": \"ceil\",\n \"def\": \"ceil(x[, N])\",\n \"docText\": \"Returns the smallest round number that is greater than or equal to `x`. In every other way, it is the same as the `floor` function (see above).\"\n },\n {\n \"name\": \"fragment\",\n \"def\": \"fragment(v)\",\n \"docText\": \"Removes the query-string and fragment identifier. The question mark and number sign are also removed.\"\n },\n {\n \"name\": \"dictGetUInt8\",\n \"def\": \"dictGetUInt8(v)\",\n \"docText\": \"dictGetT('dict_name', 'attr_name', id) Gets the value of the 'attr_name' attribute from the 'dict_name' dictionary by the 'id' key. 'dict_name' and 'attr_name' are constant strings. 'id' must be UInt64. If the 'id' key is not in the dictionary, it returns the default value set in the dictionary definition.\"\n },\n {\n \"name\": \"dictHas\",\n \"def\": \"dictHas(v)\",\n \"docText\": \"dictHas('dict_name', id) check the presence of a key in the dictionary. Returns a value of type UInt8, equal to 0, if there is no key and 1 if there is a key.\"\n },\n {\n \"name\": \"arraySum\",\n \"def\": \"arraySum([func,] arr1, ...)\",\n \"docText\": \"Returns the sum of the `func` values. If the function is omitted, it just returns the sum of the array elements.\"\n },\n {\n \"name\": \"emptyArrayDateTime\",\n \"def\": \"emptyArrayDateTime(v)\",\n \"docText\": \"Accepts zero arguments and returns an empty array of the appropriate type.\"\n },\n {\n \"name\": \"intDivOrZero\",\n \"def\": \"intDivOrZero(a, b)\",\n \"docText\": \"Differs from `intDiv` in that it returns zero when dividing by zero or when dividing a minimal negative number by minus one.\"\n },\n {\n \"name\": \"SEHierarchy\",\n \"def\": \"SEHierarchy(v)\",\n \"docText\": \"Accepts a UInt8 number - the ID of the search engine from the Yandex.Metrica dictionary. Returns an array with a hierarchy of search engines. Similar to the `regionHierarchy` function.\"\n },\n {\n \"name\": \"regionToContinent\",\n \"def\": \"regionToContinent(id[, geobase])\",\n \"docText\": \"Converts a region to a continent. In every other way, this function is the same as `regionToCity`. \\n\" +\n \"\\n\" +\n \" Example: `regionToContinent(toUInt32(213)) = 10001` converts Moscow (213) to Eurasia (10001).\"\n },\n {\n \"name\": \"dictGetInt32\",\n \"def\": \"dictGetInt32(v)\",\n \"docText\": \"dictGetT('dict_name', 'attr_name', id) Gets the value of the 'attr_name' attribute from the 'dict_name' dictionary by the 'id' key. 'dict_name' and 'attr_name' are constant strings. 'id' must be UInt64. If the 'id' key is not in the dictionary, it returns the default value set in the dictionary definition.\"\n },\n {\n \"name\": \"toInt8\",\n \"def\": \"toInt8(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"materialize\",\n \"def\": \"materialize(x)\",\n \"docText\": \"Turns a constant into a full column containing just one value. \\n\" +\n \"\\n\" +\n \" In ClickHouse, full columns and constants are represented differently in memory. Functions work differently for constant arguments and normal arguments (different code is executed), although the result is almost always the same. This function is for debugging this behavior.\"\n },\n {\n \"name\": \"regionToCountry\",\n \"def\": \"regionToCountry(id[, geobase])\",\n \"docText\": \"Converts a region to a country. In every other way, this function is the same as `regionToCity`. \\n\" +\n \"\\n\" +\n \" Example: `regionToCountry(toUInt32(213)) = 225` converts Moscow (213) to Russia (225).\"\n },\n {\n \"name\": \"dictGetDateTime\",\n \"def\": \"dictGetDateTime(v)\",\n \"docText\": \"dictGetT('dict_name', 'attr_name', id) Gets the value of the 'attr_name' attribute from the 'dict_name' dictionary by the 'id' key. 'dict_name' and 'attr_name' are constant strings. 'id' must be UInt64. If the 'id' key is not in the dictionary, it returns the default value set in the dictionary definition.\"\n },\n {\n \"name\": \"xor\",\n \"def\": \"xor(v)\",\n \"docText\": \"\"\n },\n {\n \"name\": \"regionToCity\",\n \"def\": \"regionToCity(id[, geobase])\",\n \"docText\": \"Accepts a UInt32 number - the region ID from the Yandex geobase. If this region is a city or part of a city, it returns the region ID for the appropriate city. Otherwise, returns 0.\"\n },\n {\n \"name\": \"dictGetFloat64\",\n \"def\": \"dictGetFloat64(v)\",\n \"docText\": \"dictGetT('dict_name', 'attr_name', id) Gets the value of the 'attr_name' attribute from the 'dict_name' dictionary by the 'id' key. 'dict_name' and 'attr_name' are constant strings. 'id' must be UInt64. If the 'id' key is not in the dictionary, it returns the default value set in the dictionary definition.\"\n },\n {\n \"name\": \"timeSlot\",\n \"def\": \"timeSlot(StartTime, Duration)\",\n \"docText\": \"For a time interval starting at `StartTime` and continuing for `Duration` seconds, it returns an array of moments in time, consisting of points from this interval rounded down to the half hour.\"\n },\n {\n \"name\": \"toTime\",\n \"def\": \"toTime(v)\",\n \"docText\": \"Converts a date with time to the date of the start of the Unix Epoch, while preserving the time.\"\n },\n {\n \"name\": \"log2\",\n \"def\": \"log2(x)\",\n \"docText\": \"Accepts a numeric argument and returns a Float64 number close to the binary logarithm of the argument.\"\n },\n {\n \"name\": \"toRelativeHourNum\",\n \"def\": \"toRelativeHourNum(v)\",\n \"docText\": \"Converts a date with time or date to the number of the hour, starting from a certain fixed point in the past.\"\n },\n {\n \"name\": \"toRelativeDayNum\",\n \"def\": \"toRelativeDayNum(v)\",\n \"docText\": \"Converts a date with time or date to the number of the day, starting from a certain fixed point in the past.\"\n },\n {\n \"name\": \"toRelativeWeekNum\",\n \"def\": \"toRelativeWeekNum(v)\",\n \"docText\": \"Converts a date with time or date to the number of the week, starting from a certain fixed point in the past.\"\n },\n {\n \"name\": \"splitByString\",\n \"def\": \"splitByString(separator, s)\",\n \"docText\": \"The same as above, but it uses a string of multiple characters as the separator. The string must be non-empty.\"\n },\n {\n \"name\": \"currentDatabase\",\n \"def\": \"currentDatabase()\",\n \"docText\": \"Returns the name of the current database. \\n\" +\n \"\\n\" +\n \" You can use this function in table engine parameters in a CREATE TABLE query where you need to specify the database.\"\n },\n {\n \"name\": \"toRelativeMonthNum\",\n \"def\": \"toRelativeMonthNum(v)\",\n \"docText\": \"Converts a date with time or date to the number of the month, starting from a certain fixed point in the past.\"\n },\n {\n \"name\": \"visibleWidth\",\n \"def\": \"visibleWidth(x)\",\n \"docText\": \"Calculates the approximate width when outputting values to the console in text format (tab-separated). This function is used by the system for implementing Pretty formats.\"\n },\n {\n \"name\": \"bitShiftRight\",\n \"def\": \"bitShiftRight(a, b)\",\n \"docText\": \"\"\n },\n {\n \"name\": \"toRelativeYearNum\",\n \"def\": \"toRelativeYearNum(v)\",\n \"docText\": \"Converts a date with time or date to the number of the year, starting from a certain fixed point in the past.\"\n },\n {\n \"name\": \"toStartOfHour\",\n \"def\": \"toStartOfHour(v)\",\n \"docText\": \"Rounds down a date with time to the start of the hour.\"\n },\n {\n \"name\": \"halfMD5\",\n \"def\": \"halfMD5(v)\",\n \"docText\": \"Calculates the MD5 from a string. Then it takes the first 8 bytes of the hash and interprets them as UInt64 in big endian.\"\n },\n {\n \"name\": \"toStartOfFiveMinute\",\n \"def\": \"toStartOfFiveMinute(v)\",\n \"docText\": \"Rounds down a date with time to the start of the 5 minute (00:00, 00:05, 00:10...).\"\n },\n {\n \"name\": \"toUInt16OrZero\",\n \"def\": \"toUInt16OrZero(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument.\"\n },\n {\n \"name\": \"toMonday\",\n \"def\": \"toMonday(v)\",\n \"docText\": \"Rounds down a date or date with time to the nearest Monday. \\n\" +\n \"\\n\" +\n \" Returns the date.\"\n },\n {\n \"name\": \"IPv6NumToString\",\n \"def\": \"IPv6NumToString(x)\",\n \"docText\": \"Accepts a FixedString(16) value containing the IPv6 address in binary format. Returns a string containing this address in text format. \"\n },\n {\n \"name\": \"indexOf\",\n \"def\": \"indexOf(arr, x)\",\n \"docText\": \"Returns the index of the `x` element (starting from 1) if it is in the array, or 0 if it is not.\"\n },\n {\n \"name\": \"today\",\n \"def\": \"today(v)\",\n \"docText\": \"Accepts zero arguments and returns the current date at one of the moments of request execution. \\n\" +\n \"\\n\" +\n \" The same as `toDate(now())`.\"\n },\n {\n \"name\": \"emptyArrayToSingle\",\n \"def\": \"emptyArrayToSingle(v)\",\n \"docText\": \"Accepts an empty array as argument and returns an array of one element equal to the default value.\"\n },\n {\n \"name\": \"sleep\",\n \"def\": \"sleep(seconds)\",\n \"docText\": \"Sleeps `seconds` seconds on each data block. You can specify an integer or a floating-point number.\"\n },\n {\n \"name\": \"extract\",\n \"def\": \"extract(params, name)\",\n \"docText\": \"Parses the string in double quotes. The value is unescaped. If unescaping failed, it returns an empty string. Examples: \"\n },\n {\n \"name\": \"emptyArrayInt8\",\n \"def\": \"emptyArrayInt8(v)\",\n \"docText\": \"Accepts zero arguments and returns an empty array of the appropriate type.\"\n },\n {\n \"name\": \"regionToName\",\n \"def\": \"regionToName(id[, lang])\",\n \"docText\": \"Accepts a UInt32 number - the region ID from the Yandex geobase. A string with the name of the language can be passed as a second argument. Supported languages are: ru, en, ua, uk, by, kz, tr. If the second argument is omitted, the language `ru` is used. \"\n },\n {\n \"name\": \"concat\",\n \"def\": \"concat(arr[, separator])\",\n \"docText\": \"Concatenates strings from the array elements, using `separator` as the separator. \\n\" +\n \"\\n\" +\n \" `separator` is a string constant, an optional parameter. By default it is an empty string. \\n\" +\n \"\\n\" +\n \" Returns a string.\"\n },\n {\n \"name\": \"convertCharset\",\n \"def\": \"convertCharset(s, from, to)\",\n \"docText\": \"Returns a string with the data `s` (encoded as `from` charset) that was converted to the `to` charset.\"\n },\n {\n \"name\": \"toMonth\",\n \"def\": \"toMonth(v)\",\n \"docText\": \"Converts a date or date with time to a UInt8 number containing the month number (1-12).\"\n },\n {\n \"name\": \"IPv6StringToNum\",\n \"def\": \"IPv6StringToNum(s)\",\n \"docText\": \"The reverse function of IPv6NumToString. If the IPv6 address has an invalid format, it returns a string of null bytes. \\n\" +\n \"\\n\" +\n \" HEX can be uppercase or lowercase.\"\n },\n {\n \"name\": \"emptyArrayString\",\n \"def\": \"emptyArrayString(v)\",\n \"docText\": \"Accepts zero arguments and returns an empty array of the appropriate type.\"\n },\n {\n \"name\": \"uptime\",\n \"def\": \"uptime()\",\n \"docText\": \"Returns server's uptime in seconds.\"\n },\n {\n \"name\": \"blockSize\",\n \"def\": \"blockSize()\",\n \"docText\": \"Gets the size of the block. \\n\" +\n \"\\n\" +\n \" In ClickHouse, queries are always run on blocks (sets of column parts). This function allows getting the size of the block that you called it for.\"\n },\n {\n \"name\": \"toInt64OrZero\",\n \"def\": \"toInt64OrZero(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"pathFull\",\n \"def\": \"pathFull(v)\",\n \"docText\": \"Selects the path, but including query-string and fragment. Example: /top/news.html?page=2#comments\"\n },\n {\n \"name\": \"emptyArrayDate\",\n \"def\": \"emptyArrayDate(v)\",\n \"docText\": \"Accepts zero arguments and returns an empty array of the appropriate type.\"\n },\n {\n \"name\": \"emptyArrayInt64\",\n \"def\": \"emptyArrayInt64(v)\",\n \"docText\": \"Accepts zero arguments and returns an empty array of the appropriate type.\"\n },\n {\n \"name\": \"toInt32OrZero\",\n \"def\": \"toInt32OrZero(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"greater\",\n \"def\": \"greater(v)\",\n \"docText\": \"\"\n },\n {\n \"name\": \"emptyArrayInt32\",\n \"def\": \"emptyArrayInt32(v)\",\n \"docText\": \"Accepts zero arguments and returns an empty array of the appropriate type.\"\n },\n {\n \"name\": \"toString\",\n \"def\": \"toString(str)\",\n \"docText\": \"Accepts a FixedString(16) value containing the UUID in the binary format. Returns a readable string containing the UUID in the text format.\"\n },\n {\n \"name\": \"greatest\",\n \"def\": \"greatest(a, b)\",\n \"docText\": \"Returns the greatest element of a and b.\"\n },\n {\n \"name\": \"emptyArrayUInt64\",\n \"def\": \"emptyArrayUInt64(v)\",\n \"docText\": \"Accepts zero arguments and returns an empty array of the appropriate type.\"\n },\n {\n \"name\": \"emptyArrayUInt32\",\n \"def\": \"emptyArrayUInt32(v)\",\n \"docText\": \"Accepts zero arguments and returns an empty array of the appropriate type.\"\n },\n {\n \"name\": \"formatReadableSize\",\n \"def\": \"formatReadableSize(x)\",\n \"docText\": \"Gets a size (number of bytes). Returns a string that contains rounded size with the suffix (KiB, MiB etc.).\\n\" +\n \"\\n\" +\n \"Example:\\n\" +\n \"\\n\" +\n \"SELECT\\n\" +\n \" arrayJoin([1, 1024, 1024*1024, 192851925]) AS f_bytes,\\n\" +\n \" formatReadableSize(filesize_bytes) AS filesize\\n\" +\n \"┌─f_bytes-─┬─filesize───┐\\n\" +\n \"│ 1 │ 1.00 B │\\n\" +\n \"│ 1024 │ 1.00 KiB │\\n\" +\n \"│ 1048576 │ 1.00 MiB │\\n\" +\n \"│192851925 │ 183.92 MiB │\\n\" +\n \"└──────────┴────────────┘\\n\"\n },\n {\n \"name\": \"toInt16OrZero\",\n \"def\": \"toInt16OrZero(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"emptyArrayUInt8\",\n \"def\": \"emptyArrayUInt8(v)\",\n \"docText\": \"Accepts zero arguments and returns an empty array of the appropriate type.\"\n },\n {\n \"name\": \"protocol\",\n \"def\": \"protocol(v)\",\n \"docText\": \"Selects the protocol. Examples: http, ftp, mailto, magnet...\"\n },\n {\n \"name\": \"regionToPopulation\",\n \"def\": \"regionToPopulation(id[, geobase])\",\n \"docText\": \"Gets the population for a region. \\n\" +\n \"\\n\" +\n \" The population can be recorded in files with the geobase. See the section `External dictionaries`. \\n\" +\n \"\\n\" +\n \" If the population is not recorded for the region, it returns 0. \\n\" +\n \"\\n\" +\n \" In the Yandex geobase, the population might be recorded for child regions, but not for parent regions.\"\n },\n {\n \"name\": \"notIn\",\n \"def\": \"notIn(v)\",\n \"docText\": \"See the section `IN operators`.\"\n },\n {\n \"name\": \"position\",\n \"def\": \"position(haystack, needle)\",\n \"docText\": \"The same as `position`, but the position is returned in Unicode code points. Works under the assumption that the string contains a set of bytes representing a UTF-8 encoded text. If this assumption is not met, it returns some result (it doesn`t throw an exception). \\n\" +\n \"\\n\" +\n \" There's also positionCaseInsensitiveUTF8 function.\"\n },\n {\n \"name\": \"arrayElement\",\n \"def\": \"arrayElement(arr, n), arr[n] operator\",\n \"docText\": \"Get the element with the index `n` from the array `arr`. \\n\" +\n \"\\n\" +\n \" `n` should be any integer type. \\n\" +\n \"\\n\" +\n \" Indexes in an array begin from one. \\n\" +\n \"\\n\" +\n \" Negative indexes are supported - in this case, it selects the corresponding element numbered from the end. \"\n },\n {\n \"name\": \"toStringCutToZero\",\n \"def\": \"toStringCutToZero(s)\",\n \"docText\": \"Accepts a String or FixedString argument. Returns a String that is cut to a first null byte occurrence.\"\n },\n {\n \"name\": \"log\",\n \"def\": \"log(x)\",\n \"docText\": \"Accepts a numeric argument and returns a Float64 number close to the decimal logarithm of the argument.\"\n },\n {\n \"name\": \"SEIn\",\n \"def\": \"SEIn(lhs, rhs)\",\n \"docText\": \"Checks whether the `lhs` search engine belongs to the `rhs` search engine.\"\n },\n {\n \"name\": \"replicate\",\n \"def\": \"replicate(v)\",\n \"docText\": \"Create a MergeTree table with a different name. Move all the data from the directory with the ReplicatedMergeTree table data to the new table`s data directory.\"\n },\n {\n \"name\": \"sipHash64\",\n \"def\": \"sipHash64(v)\",\n \"docText\": \"Calculates SipHash from a string. \\n\" +\n \"\\n\" +\n \" Accepts a String-type argument. Returns UInt64. \\n\" +\n \"\\n\" +\n \" SipHash is a cryptographic hash function. It works at least three times faster than MD5. For more information, see https://131002.net/siphash/\"\n },\n {\n \"name\": \"emptyArrayUInt16\",\n \"def\": \"emptyArrayUInt16(v)\",\n \"docText\": \"Accepts zero arguments and returns an empty array of the appropriate type.\"\n },\n {\n \"name\": \"hex\",\n \"def\": \"hex(str)\",\n \"docText\": \"Accepts a string containing any number of hexadecimal digits, and returns a string containing the corresponding bytes. Supports both uppercase and lowercase letters A-F. The number of hexadecimal digits doesn`t have to be even.\"\n },\n {\n \"name\": \"regionToDistrict\",\n \"def\": \"regionToDistrict(id[, geobase])\",\n \"docText\": \"Converts a region to a federal district (type 4 in the geobase). In every other way, this function is the same as `regionToCity`. \"\n },\n {\n \"name\": \"arrayFilter\",\n \"def\": \"arrayFilter(func, arr1, ...)\",\n \"docText\": \"Returns an array containing only the elements in `arr1` for which `func` returns something other than 0. \\n\" +\n \"\\n\" +\n \" Examples: \\n\" +\n \"\\n\" +\n \" SELECT arrayFilter(x -> x LIKE `%World%`, [`Hello`, `abc World`]) AS res \"\n },\n {\n \"name\": \"toStartOfQuarter\",\n \"def\": \"toStartOfQuarter(v)\",\n \"docText\": \"Rounds down a date or date with time to the first day of the quarter. \\n\" +\n \"\\n\" +\n \" The first day of the quarter is either 1 January, 1 April, 1 July, or 1 October. Returns the date.\"\n },\n {\n \"name\": \"divide\",\n \"def\": \"divide(a, b), a / b operator\",\n \"docText\": \"Calculates the quotient of the numbers. The result type is always a floating-point type. \\n\" +\n \"\\n\" +\n \" It is not integer division. For integer division, use the `intDiv` function. \\n\" +\n \"\\n\" +\n \" When dividing by zero you get `inf`, `-inf`, or `nan`.\"\n },\n {\n \"name\": \"reverseUTF8\",\n \"def\": \"reverseUTF8(v)\",\n \"docText\": \"Reverses a sequence of Unicode code points, assuming that the string contains a set of bytes representing a UTF-8 text. Otherwise, it does something else (it doesn`t throw an exception).\"\n },\n {\n \"name\": \"toDate\",\n \"def\": \"toDate(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"emptyArrayFloat64\",\n \"def\": \"emptyArrayFloat64(v)\",\n \"docText\": \"Accepts zero arguments and returns an empty array of the appropriate type.\"\n },\n {\n \"name\": \"abs\",\n \"def\": \"abs(s, c)\",\n \"docText\": \"If the `s` string is non-empty and does not contain the `c` character at the end, it appends the `c` character to the end.\"\n },\n {\n \"name\": \"yesterday\",\n \"def\": \"yesterday(v)\",\n \"docText\": \"Accepts zero arguments and returns yesterday`s date at one of the moments of request execution. \\n\" +\n \"\\n\" +\n \" The same as `today() - 1`.\"\n },\n {\n \"name\": \"toMinute\",\n \"def\": \"toMinute(v)\",\n \"docText\": \"Converts a date with time to a UInt8 number containing the number of the minute of the hour (0-59).\"\n },\n {\n \"name\": \"bitXor\",\n \"def\": \"bitXor(a, b)\",\n \"docText\": \"\"\n },\n {\n \"name\": \"minus\",\n \"def\": \"minus(a, b), a - b operator\",\n \"docText\": \"Calculates the difference. The result is always signed. \\n\" +\n \"\\n\" +\n \" You can also calculate whole numbers from a date or date with time. The idea is the same - see above for `plus`.\"\n },\n {\n \"name\": \"toDateTime\",\n \"def\": \"toDateTime(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"modulo\",\n \"def\": \"modulo(a, b), a % b operator\",\n \"docText\": \"Calculates the remainder after division. \\n\" +\n \"\\n\" +\n \" If arguments are floating-point numbers, they are pre-converted to integers by dropping the decimal portion. The remainder is taken in the same sense as in C++. Truncated division is used for negative numbers. \\n\" +\n \"\\n\" +\n \" An exception is thrown when dividing by zero or when dividing a minimal negative number by minus one.\"\n },\n {\n \"name\": \"bitmaskToArray\",\n \"def\": \"bitmaskToArray(num)\",\n \"docText\": \"Accepts an integer. Returns an array of UInt64 numbers containing the list of powers of two that total the source number when summed. Numbers in the array are in ascending order.\"\n },\n {\n \"name\": \"negate\",\n \"def\": \"negate(a), -a operator\",\n \"docText\": \"Calculates a number with the reverse sign. The result is always signed.\"\n },\n {\n \"name\": \"emptyArrayFloat32\",\n \"def\": \"emptyArrayFloat32(v)\",\n \"docText\": \"Accepts zero arguments and returns an empty array of the appropriate type.\"\n },\n {\n \"name\": \"range\",\n \"def\": \"range(N)\",\n \"docText\": \"Returns an array of numbers from 0 to N-1. \\n\" +\n \"\\n\" +\n \" Just in case, an exception is thrown if arrays with a total length of more than 100,000,000 elements are created in a data block.\"\n },\n {\n \"name\": \"arrayAll\",\n \"def\": \"arrayAll([func,] arr1, ...)\",\n \"docText\": \"Returns 1 if `func` returns something other than 0 for all the elements in `arr`. Otherwise, it returns 0.\"\n },\n {\n \"name\": \"toInt32\",\n \"def\": \"toInt32(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"unhex\",\n \"def\": \"unhex(str)\",\n \"docText\": \"Accepts a string containing any number of hexadecimal digits, and returns a string containing the corresponding bytes. Supports both uppercase and lowercase letters A-F. The number of hexadecimal digits doesn`t have to be even. If it is odd, the last digit is interpreted as the younger half of the 00-0F byte. If the argument string contains anything other than hexadecimal digits, some implementation-defined result is returned (an exception isn`t thrown). \\n\" +\n \"\\n\" +\n \" If you want to convert the result to a number, you can use the functions `reverse` and `reinterpretAsType`.\"\n },\n {\n \"name\": \"toFloat64\",\n \"def\": \"toFloat64(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"bitAnd\",\n \"def\": \"bitAnd(a, b)\",\n \"docText\": \"\"\n },\n {\n \"name\": \"toStartOfYear\",\n \"def\": \"toStartOfYear(v)\",\n \"docText\": \"Rounds down a date or date with time to the first day of the year. \\n\" +\n \"\\n\" +\n \" Returns the date.\"\n },\n {\n \"name\": \"bitOr\",\n \"def\": \"bitOr(a, b)\",\n \"docText\": \"\"\n },\n {\n \"name\": \"SEToRoot\",\n \"def\": \"SEToRoot(v)\",\n \"docText\": \"Accepts a UInt8 number - the ID of the search engine from the Yandex.Metrica dictionary. If any search engine matches the passed number, it returns a UInt8 number - the ID of the corresponding root search engine (for example, it converts Yandex.Images to Yandex). Otherwise, returns 0.\"\n },\n {\n \"name\": \"toRelativeMinuteNum\",\n \"def\": \"toRelativeMinuteNum(v)\",\n \"docText\": \"Converts a date with time or date to the number of the minute, starting from a certain fixed point in the past.\"\n },\n {\n \"name\": \"visitParamExtractInt\",\n \"def\": \"visitParamExtractInt(params, name)\",\n \"docText\": \"The same as for Int64.\"\n },\n {\n \"name\": \"emptyArrayInt16\",\n \"def\": \"emptyArrayInt16(v)\",\n \"docText\": \"Accepts zero arguments and returns an empty array of the appropriate type.\"\n },\n {\n \"name\": \"visitParamExtractString\",\n \"def\": \"visitParamExtractString(params, name)\",\n \"docText\": \"Parses the string in double quotes. The value is unescaped. If unescaping failed, it returns an empty string. \"\n },\n {\n \"name\": \"arrayEnumerateUniq\",\n \"def\": \"arrayEnumerateUniq(arr, ...)\",\n \"docText\": \"Returns an array the same size as the source array, indicating for each element what its position is among elements with the same value. \"\n },\n {\n \"name\": \"visitParamExtractUInt\",\n \"def\": \"visitParamExtractUInt(params, name)\",\n \"docText\": \"Parses UInt64 from the value of the field named `name`. If this is a string field, it tries to parse a number from the beginning of the string. If the field doesn`t exist, or it exists but doesn`t contain a number, it returns 0.\"\n },\n {\n \"name\": \"toTypeName\",\n \"def\": \"toTypeName(x)\",\n \"docText\": \"Gets the type name. Returns a string containing the type name of the passed argument.\"\n },\n {\n \"name\": \"empty\",\n \"def\": \"empty(v)\",\n \"docText\": \"Accepts an empty array as argument and returns an array of one element equal to the default value.\"\n },\n {\n \"name\": \"multiply\",\n \"def\": \"multiply(a, b), a * b operator\",\n \"docText\": \"Calculates the product of the numbers.\"\n },\n {\n \"name\": \"has\",\n \"def\": \"has('database', 'table', 'column')\",\n \"docText\": \"Accepts constant String columns - database name, table name and column name. Returns constant UInt8 value, equal to 1 if column exists, otherwise 0.\\n\" +\n \"\\n\" +\n \" If table doesn't exist than exception is thrown. \\n\" +\n \"\\n\" +\n \" For elements of nested data structure function checks existence of column. For nested data structure 0 is returned.\"\n },\n {\n \"name\": \"bitNot\",\n \"def\": \"bitNot(a)\",\n \"docText\": \"\"\n },\n {\n \"name\": \"lessOrEquals\",\n \"def\": \"lessOrEquals(v)\",\n \"docText\": \"greaterOrEquals, >= operator\"\n },\n {\n \"name\": \"reinterpretAsInt64\",\n \"def\": \"reinterpretAsInt64(v)\",\n \"docText\": \"Functions accept a string and interpret the bytes placed at the beginning of the string as a number in host order (little endian). If the string isn't long enough, the functions work as if the string is padded with the necessary number of null bytes. If the string is longer than needed, the extra bytes are ignored. A date is interpreted as the number of days since the beginning of the Unix Epoch, and a date with time is interpreted as the number of seconds since the beginning of the Unix Epoch.\"\n },\n {\n \"name\": \"IPv4NumToString\",\n \"def\": \"IPv4NumToString(num)\",\n \"docText\": \"Similar to IPv4NumToString, but using `xxx` instead of the last octet. \"\n },\n {\n \"name\": \"bitShiftLeft\",\n \"def\": \"bitShiftLeft(a, b)\",\n \"docText\": \"\"\n },\n {\n \"name\": \"dictGetInt16\",\n \"def\": \"dictGetInt16(v)\",\n \"docText\": \"dictGetT('dict_name', 'attr_name', id) Gets the value of the 'attr_name' attribute from the 'dict_name' dictionary by the 'id' key. 'dict_name' and 'attr_name' are constant strings. 'id' must be UInt64. If the 'id' key is not in the dictionary, it returns the default value set in the dictionary definition.\"\n },\n {\n \"name\": \"toUInt32OrZero\",\n \"def\": \"toUInt32OrZero(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"regionIn\",\n \"def\": \"regionIn(lhs, rhs[, geobase])\",\n \"docText\": \"Checks whether a `lhs` region belongs to a `rhs` region. Returns a UInt8 number equal to 1 if it belongs, or 0 if it doesn`t belong. \\n\" +\n \"\\n\" +\n \" The relationship is reflexive - any region also belongs to itself.\"\n },\n {\n \"name\": \"reinterpretAsUInt8\",\n \"def\": \"reinterpretAsUInt8(v)\",\n \"docText\": \"Functions accept a string and interpret the bytes placed at the beginning of the string as a number in host order (little endian). If the string isn't long enough, the functions work as if the string is padded with the necessary number of null bytes. If the string is longer than needed, the extra bytes are ignored. A date is interpreted as the number of days since the beginning of the Unix Epoch, and a date with time is interpreted as the number of seconds since the beginning of the Unix Epoch.\"\n },\n {\n \"name\": \"dictIsIn\",\n \"def\": \"dictIsIn(v)\",\n \"docText\": \"`dictIsIn(`dict_name`, child_id, ancestor_id)` \\n\" +\n \"\\n\" +\n \" - For the `dict_name` hierarchical dictionary, finds out whether the `child_id` key is located inside `ancestor_id` (or matches `ancestor_id`). Returns UInt8.\"\n },\n {\n \"name\": \"toSecond\",\n \"def\": \"toSecond(v)\",\n \"docText\": \"Converts a date with time to a UInt8 number containing the number of the second in the minute (0-59). \\n\" +\n \"\\n\" +\n \" Leap seconds are not accounted for.\"\n },\n {\n \"name\": \"least\",\n \"def\": \"least(a, b)\",\n \"docText\": \"Returns the least element of a and b.\"\n },\n {\n \"name\": \"countEqual\",\n \"def\": \"countEqual(arr, x)\",\n \"docText\": \"Returns the number of elements in the array equal to `x`. Equivalent to arrayCount(elem -> elem = x, arr).\"\n },\n {\n \"name\": \"IPv4StringToNum\",\n \"def\": \"IPv4StringToNum(s)\",\n \"docText\": \"The reverse function of IPv4NumToString. If the IPv4 address has an invalid format, it returns 0.\"\n },\n {\n \"name\": \"replaceRegexpAll\",\n \"def\": \"replaceRegexpAll(haystack, pattern, replacement)\",\n \"docText\": \"This does the same thing, but replaces all the occurrences\"\n },\n {\n \"name\": \"SHA224\",\n \"def\": \"SHA224(v)\",\n \"docText\": \"Calculates SHA-1, SHA-224, or SHA-256 from a string and returns the resulting set of bytes as FixedString(20), FixedString(28), or FixedString(32). \\n\" +\n \"\\n\" +\n \" The function works fairly slowly (SHA-1 processes about 5 million short strings per second per processor core, while SHA-224 and SHA-256 process about 2.2 million). \"\n },\n {\n \"name\": \"URLHash\",\n \"def\": \"URLHash(url[, N])\",\n \"docText\": \"A fast, decent-quality non-cryptographic hash function for a string obtained from a URL using some type of normalization. \\n\" +\n \"\\n\" +\n \" URLHash(s) - Calculates a hash from a string without one of the trailing symbols /,? or # at the end, if present\"\n },\n {\n \"name\": \"equals\",\n \"def\": \"equals(v)\",\n \"docText\": \"

greaterOrEquals, >= operator

\"\n },\n {\n \"name\": \"plus\",\n \"def\": \"plus(a, b), a + b operator\",\n \"docText\": \"Calculates the sum of the numbers. \\n\" +\n \"\\n\" +\n \" You can also add whole numbers with a date or date and time. In the case of a date, adding a whole number means adding the corresponding number of days. For a date with time, it means adding the corresponding number of seconds.\"\n },\n {\n \"name\": \"less\",\n \"def\": \"less(v)\",\n \"docText\": \"

greaterOrEquals, >= operator

\"\n },\n {\n \"name\": \"regionHierarchy\",\n \"def\": \"regionHierarchy(id[, geobase])\",\n \"docText\": \"Accepts a UInt32 number - the region ID from the Yandex geobase. Returns an array of region IDs consisting of the passed region and all parents along the chain. \\n\" +\n \"\\n\" +\n \" Example: `regionHierarchy(toUInt32(213)) = [213,1,3,225,10001,10000]`.\"\n },\n {\n \"name\": \"toUInt64OrZero\",\n \"def\": \"toUInt64OrZero(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"rowNumberInAllBlocks\",\n \"def\": \"rowNumberInAllBlocks()\",\n \"docText\": \"Returns an incremental row number within all blocks that were processed by this function.\"\n },\n {\n \"name\": \"toDayOfWeek\",\n \"def\": \"toDayOfWeek(v)\",\n \"docText\": \"Converts a date or date with time to a UInt8 number containing the number of the day of the week (Monday is 1, and Sunday is 7).\"\n },\n {\n \"name\": \"bar\",\n \"def\": \"bar(v)\",\n \"docText\": \"Allows building a unicode-art diagram. \\n\" +\n \"\\n\" +\n \" bar(x, min, max, width) - Draws a band with a width proportional to (x - min) and equal to `width` characters when x\"\n },\n {\n \"name\": \"if\",\n \"def\": \"if(v)\",\n \"docText\": \"The suffix -`If` can be appended to the name of any aggregate function. In this case, the aggregate function accepts an extra argument - a condition (Uint8 type). \"\n },\n {\n \"name\": \"regionToArea\",\n \"def\": \"regionToArea(id[, geobase])\",\n \"docText\": \"Converts a region to an area (type 5 in the geobase). In every other way, this function is the same as `regionToCity`.\"\n },\n {\n \"name\": \"dictGetUInt16\",\n \"def\": \"dictGetUInt16(v)\",\n \"docText\": \"dictGetT('dict_name', 'attr_name', id) Gets the value of the 'attr_name' attribute from the 'dict_name' dictionary by the 'id' key. 'dict_name' and 'attr_name' are constant strings. 'id' must be UInt64. If the 'id' key is not in the dictionary, it returns the default value set in the dictionary definition.\"\n },\n {\n \"name\": \"toUInt8\",\n \"def\": \"toUInt8(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"toUInt16\",\n \"def\": \"toUInt16(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"path\",\n \"def\": \"path(URL)\",\n \"docText\": \"- The same thing, but without the protocol and host in the result. The / element (root) is not included.\"\n },\n {\n \"name\": \"extractURLParameters\",\n \"def\": \"extractURLParameters(URL)\",\n \"docText\": \"- Gets an array of name=value strings corresponding to the URL parameters. The values are not decoded in any way.\"\n },\n {\n \"name\": \"OSHierarchy\",\n \"def\": \"OSHierarchy(v)\",\n \"docText\": \"Accepts a UInt8 number - the ID of the operating system from the Yandex.Metrica dictionary. Returns an array with a hierarchy of operating systems. Similar to the `regionHierarchy` function.\"\n },\n {\n \"name\": \"cutQueryStringAndFragment\",\n \"def\": \"cutQueryStringAndFragment(v)\",\n \"docText\": \"Removes the query-string and fragment identifier. The question mark and number sign are also removed.\"\n },\n {\n \"name\": \"timeSlots\",\n \"def\": \"timeSlots(StartTime, Duration)\",\n \"docText\": \"For a time interval starting at `StartTime` and continuing for `Duration` seconds, it returns an array of moments in time, consisting of points from this interval rounded down to the half hour. \\n\" +\n \"\\n\" +\n \" For example, `timeSlots(toDateTime(`2012-01-01 12:20:00`), toUInt32(600)) = [toDateTime(`2012-01-01 12:00:00`), toDateTime(`2012-01-01 12:30:00`)]`. \\n\" +\n \"\\n\" +\n \" This is necessary for searching for pageviews in the corresponding session.\"\n },\n {\n \"name\": \"toUInt32\",\n \"def\": \"toUInt32(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"toStartOfMinute\",\n \"def\": \"toStartOfMinute(v)\",\n \"docText\": \"Rounds down a date with time to the start of the minute.\"\n },\n {\n \"name\": \"version\",\n \"def\": \"version()\",\n \"docText\": \"Returns server's version as a string.\"\n },\n {\n \"name\": \"toUInt64\",\n \"def\": \"toUInt64(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"toInt16\",\n \"def\": \"toInt16(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"reinterpretAsInt16\",\n \"def\": \"reinterpretAsInt16(v)\",\n \"docText\": \"Functions accept a string and interpret the bytes placed at the beginning of the string as a number in host order (little endian). If the string isn't long enough, the functions work as if the string is padded with the necessary number of null bytes. If the string is longer than needed, the extra bytes are ignored. A date is interpreted as the number of days since the beginning of the Unix Epoch, and a date with time is interpreted as the number of seconds since the beginning of the Unix Epoch.\"\n },\n {\n \"name\": \"toInt64\",\n \"def\": \"toInt64(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"toFixedString\",\n \"def\": \"toFixedString(s, N)\",\n \"docText\": \"Converts a String type argument to a FixedString(N) type (a string with fixed length N). N must be a constant. If the string has fewer bytes than N, it is passed with null bytes to the right. If the string has more bytes than N, an exception is thrown.\"\n },\n {\n \"name\": \"toFloat32\",\n \"def\": \"toFloat32(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"dictGetHierarchy\",\n \"def\": \"dictGetHierarchy(v)\",\n \"docText\": \"`dictGetHierarchy(`dict_name`, id)` \\n\" +\n \"\\n\" +\n \" - For the `dict_name` hierarchical dictionary, returns an array of dictionary keys starting from `id` and continuing along the chain of parent elements. Returns Array(UInt64).\"\n },\n {\n \"name\": \"dictGetInt64\",\n \"def\": \"dictGetInt64(v)\",\n \"docText\": \"dictGetT('dict_name', 'attr_name', id) Gets the value of the 'attr_name' attribute from the 'dict_name' dictionary by the 'id' key. 'dict_name' and 'attr_name' are constant strings. 'id' must be UInt64. If the 'id' key is not in the dictionary, it returns the default value set in the dictionary definition.\"\n },\n {\n \"name\": \"CAST\",\n \"def\": \"CAST(x, t)\",\n \"docText\": \"Casts `x` to the `t` data type. \\n\" +\n \"\\n\" +\n \" The syntax `CAST(x AS t)` is also supported. \\n\"\n },\n {\n \"name\": \"toRelativeSecondNum\",\n \"def\": \"toRelativeSecondNum(v)\",\n \"docText\": \"Converts a date with time or date to the number of the second, starting from a certain fixed point in the past.\"\n },\n {\n \"name\": \"toUInt8OrZero\",\n \"def\": \"toUInt8OrZero(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"toStartOfMonth\",\n \"def\": \"toStartOfMonth(v)\",\n \"docText\": \"Rounds down a date or date with time to the first day of the month. \\n\" +\n \"\\n\" +\n \" Returns the date.\"\n },\n {\n \"name\": \"rand64\",\n \"def\": \"rand64(v)\",\n \"docText\": \"Returns a pseudo-random UInt64 number, evenly distributed among all UInt64-type numbers. \\n\" +\n \"\\n\" +\n \" Uses a linear congruential generator.\"\n },\n {\n \"name\": \"toInt8OrZero\",\n \"def\": \"toInt8OrZero(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"toFloat32OrZero\",\n \"def\": \"toFloat32OrZero(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"toYear\",\n \"def\": \"toYear(v)\",\n \"docText\": \"Converts a date or date with time to a UInt16 number containing the year number (AD).\"\n },\n {\n \"name\": \"atan\",\n \"def\": \"atan(x)\",\n \"docText\": \"The arc tangent.\"\n },\n {\n \"name\": \"toFloat64OrZero\",\n \"def\": \"toFloat64OrZero(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"arrayEnumerate\",\n \"def\": \"arrayEnumerate(arr, ...)\",\n \"docText\": \"Returns an array the same size as the source array, indicating for each element what its position is among elements with the same value.\"\n },\n {\n \"name\": \"toDayOfMonth\",\n \"def\": \"toDayOfMonth(v)\",\n \"docText\": \"Converts a date or date with time to a UInt8 number containing the number of the day of the month (1-31).\"\n },\n {\n \"name\": \"dictGetUInt64\",\n \"def\": \"dictGetUInt64(v)\",\n \"docText\": \"dictGetT('dict_name', 'attr_name', id) Gets the value of the 'attr_name' attribute from the 'dict_name' dictionary by the 'id' key. 'dict_name' and 'attr_name' are constant strings. 'id' must be UInt64. If the 'id' key is not in the dictionary, it returns the default value set in the dictionary definition.\"\n },\n {\n \"name\": \"IPv4NumToStringClassC\",\n \"def\": \"IPv4NumToStringClassC(num)\",\n \"docText\": \"Similar to IPv4NumToString, but using `xxx` instead of the last octet. \"\n },\n {\n \"name\": \"reinterpretAsString\",\n \"def\": \"reinterpretAsString(v)\",\n \"docText\": \"This function accepts a number or date or date with time, and returns a string containing bytes representing the corresponding value in host order (little endian). Null bytes are dropped from the end. For example, a UInt32 type value of 255 is a string that is one byte long.\"\n },\n {\n \"name\": \"toHour\",\n \"def\": \"toHour(v)\",\n \"docText\": \"Converts a date with time to a UInt8 number containing the number of the hour in 24-hour time (0-23). \\n\" +\n \"\\n\" +\n \" This function assumes that if clocks are moved ahead, it is by one hour and occurs at 2 a.m., and if clocks are moved back, it is by one hour and occurs at 3 a.m. (which is not always true - even in Moscow the clocks were once changed at a different time).\"\n },\n {\n \"name\": \"ignore\",\n \"def\": \"ignore(...)\",\n \"docText\": \"A function that accepts any arguments and always returns 0. \\n\" +\n \"\\n\" +\n \" However, the argument is still calculated. This can be used for benchmarks.\"\n },\n {\n \"name\": \"arrayJoin\",\n \"def\": \"arrayJoin(v)\",\n \"docText\": \"This is a very unusual function.\\n\" +\n \"\\n\" +\n \"Normal functions don't change a set of rows, but just change the values in each row (map). Aggregate functions compress a set of rows (fold or reduce). The 'arrayJoin' function takes each row and generates a set of rows (unfold).\\n\" +\n \"\\n\" +\n \"This function takes an array as an argument, and propagates the source row to multiple rows for the number of elements in the array. All the values in columns are simply copied, except the values in the column where this function is applied - it is replaced with the corresponding array value.\\n\" +\n \"\\n\" +\n \"A query can use multiple 'arrayJoin' functions. In this case, the transformation is performed multiple times.\\n\" +\n \"\\n\" +\n \"Note the ARRAY JOIN syntax in the SELECT query, which provides broader possibilities.\"\n },\n {\n \"name\": \"length\",\n \"def\": \"length(v)\",\n \"docText\": \"Returns the length of a string in Unicode code points (not in characters), assuming that the string contains a set of bytes that make up UTF-8 encoded text. If this assumption is not met, it returns some result (it doesn`t throw an exception). \\n\" +\n \"\\n\" +\n \" The result type is UInt64.\"\n },\n {\n \"name\": \"tuple\",\n \"def\": \"tuple(tuple, n), operator x.N\",\n \"docText\": \"A function that allows getting columns from a tuple. \\n\" +\n \"\\n\" +\n \" `N` is the column index, starting from 1. `N` must be a constant. `N` must be a strict postive integer no greater than the size of the tuple. \\n\" +\n \"\\n\" +\n \" There is no cost to execute the function.\"\n },\n {\n \"name\": \"extractURLParameterNames\",\n \"def\": \"extractURLParameterNames(URL)\",\n \"docText\": \"- Gets an array of name=value strings corresponding to the names of URL parameters. The values are not decoded in any way.\"\n },\n {\n \"name\": \"tupleElement\",\n \"def\": \"tupleElement(tuple, n), operator x.N\",\n \"docText\": \"A function that allows getting columns from a tuple. \\n\" +\n \"\\n\" +\n \" `N` is the column index, starting from 1. `N` must be a constant. `N` must be a strict postive integer no greater than the size of the tuple. \\n\" +\n \"\\n\" +\n \" There is no cost to execute the function.\"\n },\n {\n \"name\": \"in\",\n \"def\": \"in(v)\",\n \"docText\": \"What to do when the amount of data exceeds one of the limits: `throw` or `break`. By default, throw.\"\n },\n {\n \"name\": \"globalIn\",\n \"def\": \"globalIn(v)\",\n \"docText\": \"See the section `IN operators`.\"\n },\n {\n \"name\": \"isFinite\",\n \"def\": \"isFinite(x)\",\n \"docText\": \"Accepts Float32 and Float64 and returns UInt8 equal to 1 if the argument is not infinite and not a NaN, otherwise 0.\"\n },\n {\n \"name\": \"isNaN\",\n \"def\": \"isNaN(x)\",\n \"docText\": \"Accepts Float32 and Float64 and returns UInt8 equal to 1 if the argument is a NaN, otherwise 0.\"\n },\n {\n \"name\": \"isInfinite\",\n \"def\": \"isInfinite(x)\",\n \"docText\": \"Accepts Float32 and Float64 and returns UInt8 equal to 1 if the argument is infinite, otherwise 0. \\n\" +\n \"\\n\" +\n \" Note that 0 is returned for a NaN.\"\n },\n {\n \"name\": \"transform\",\n \"def\": \"transform(v)\",\n \"docText\": \"Transforms a value according to the explicitly defined mapping of some elements to other ones. \\n\" +\n \"\\n\" +\n \" There are two variations of this function: \\n\" +\n \"\\n\" +\n \" 1. `transform(x, array_from, array_to, default)` \"\n },\n {\n \"name\": \"rand\",\n \"def\": \"rand(v)\",\n \"docText\": \"Returns a pseudo-random UInt64 number, evenly distributed among all UInt64-type numbers. \\n\" +\n \"\\n\" +\n \" Uses a linear congruential generator.\"\n },\n {\n \"name\": \"reinterpretAsUInt16\",\n \"def\": \"reinterpretAsUInt16(v)\",\n \"docText\": \"Functions accept a string and interpret the bytes placed at the beginning of the string as a number in host order (little endian). If the string isn't long enough, the functions work as if the string is padded with the necessary number of null bytes. If the string is longer than needed, the extra bytes are ignored. A date is interpreted as the number of days since the beginning of the Unix Epoch, and a date with time is interpreted as the number of seconds since the beginning of the Unix Epoch.\"\n },\n {\n \"name\": \"pi\",\n \"def\": \"pi(v)\",\n \"docText\": \"Maximum pipeline depth. Corresponds to the number of transformations that each data block goes through during query processing. Counted within the limits of a single server. If the pipeline depth is greater, an exception is thrown. By default, 1000.\"\n },\n {\n \"name\": \"reinterpretAsUInt32\",\n \"def\": \"reinterpretAsUInt32(v)\",\n \"docText\": \"Functions accept a string and interpret the bytes placed at the beginning of the string as a number in host order (little endian). If the string isn't long enough, the functions work as if the string is padded with the necessary number of null bytes. If the string is longer than needed, the extra bytes are ignored. A date is interpreted as the number of days since the beginning of the Unix Epoch, and a date with time is interpreted as the number of seconds since the beginning of the Unix Epoch.\"\n },\n {\n \"name\": \"reinterpretAsUInt64\",\n \"def\": \"reinterpretAsUInt64(v)\",\n \"docText\": \"Functions accept a string and interpret the bytes placed at the beginning of the string as a number in host order (little endian). If the string isn't long enough, the functions work as if the string is padded with the necessary number of null bytes. If the string is longer than needed, the extra bytes are ignored. A date is interpreted as the number of days since the beginning of the Unix Epoch, and a date with time is interpreted as the number of seconds since the beginning of the Unix Epoch.\"\n },\n {\n \"name\": \"reinterpretAsInt8\",\n \"def\": \"reinterpretAsInt8(v)\",\n \"docText\": \"Functions accept a string and interpret the bytes placed at the beginning of the string as a number in host order (little endian). If the string isn't long enough, the functions work as if the string is padded with the necessary number of null bytes. If the string is longer than needed, the extra bytes are ignored. A date is interpreted as the number of days since the beginning of the Unix Epoch, and a date with time is interpreted as the number of seconds since the beginning of the Unix Epoch.\"\n },\n {\n \"name\": \"upperUTF8\",\n \"def\": \"upperUTF8(v)\",\n \"docText\": \"Converts a string to uppercase, assuming the string contains a set of bytes that make up a UTF-8 encoded text. It doesn`t detect the language. So for Turkish the result might not be exactly correct. \"\n },\n {\n \"name\": \"reinterpretAsInt32\",\n \"def\": \"reinterpretAsInt32(v)\",\n \"docText\": \"Functions accept a string and interpret the bytes placed at the beginning of the string as a number in host order (little endian). If the string isn't long enough, the functions work as if the string is padded with the necessary number of null bytes. If the string is longer than needed, the extra bytes are ignored. A date is interpreted as the number of days since the beginning of the Unix Epoch, and a date with time is interpreted as the number of seconds since the beginning of the Unix Epoch.\"\n },\n {\n \"name\": \"reinterpretAsFloat32\",\n \"def\": \"reinterpretAsFloat32(v)\",\n \"docText\": \"Functions accept a string and interpret the bytes placed at the beginning of the string as a number in host order (little endian). If the string isn't long enough, the functions work as if the string is padded with the necessary number of null bytes. If the string is longer than needed, the extra bytes are ignored. A date is interpreted as the number of days since the beginning of the Unix Epoch, and a date with time is interpreted as the number of seconds since the beginning of the Unix Epoch.\"\n },\n {\n \"name\": \"reinterpretAsFloat64\",\n \"def\": \"reinterpretAsFloat64(v)\",\n \"docText\": \"Functions accept a string and interpret the bytes placed at the beginning of the string as a number in host order (little endian). If the string isn't long enough, the functions work as if the string is padded with the necessary number of null bytes. If the string is longer than needed, the extra bytes are ignored. A date is interpreted as the number of days since the beginning of the Unix Epoch, and a date with time is interpreted as the number of seconds since the beginning of the Unix Epoch.\"\n },\n {\n \"name\": \"reinterpretAsDate\",\n \"def\": \"reinterpretAsDate(v)\",\n \"docText\": \"Functions accept a string and interpret the bytes placed at the beginning of the string as a number in host order (little endian). If the string isn't long enough, the functions work as if the string is padded with the necessary number of null bytes. If the string is longer than needed, the extra bytes are ignored. A date is interpreted as the number of days since the beginning of the Unix Epoch, and a date with time is interpreted as the number of seconds since the beginning of the Unix Epoch.\"\n },\n {\n \"name\": \"reinterpretAsDateTime\",\n \"def\": \"reinterpretAsDateTime(v)\",\n \"docText\": \"Functions accept a string and interpret the bytes placed at the beginning of the string as a number in host order (little endian). If the string isn't long enough, the functions work as if the string is padded with the necessary number of null bytes. If the string is longer than needed, the extra bytes are ignored. A date is interpreted as the number of days since the beginning of the Unix Epoch, and a date with time is interpreted as the number of seconds since the beginning of the Unix Epoch.\"\n },\n {\n \"name\": \"roundToExp2\",\n \"def\": \"roundToExp2(num)\",\n \"docText\": \"Accepts a number. If the number is less than one, it returns 0. Otherwise, it rounds the number down to the nearest (whole non-negative) degree of two.\"\n },\n {\n \"name\": \"upper\",\n \"def\": \"upper(v)\",\n \"docText\": \"Converts a string to uppercase, assuming the string contains a set of bytes that make up a UTF-8 encoded text. It doesn`t detect the language. So for Turkish the result might not be exactly correct.\"\n },\n {\n \"name\": \"positionUTF8\",\n \"def\": \"positionUTF8(haystack, needle)\",\n \"docText\": \"The same as `position`, but the position is returned in Unicode code points. Works under the assumption that the string contains a set of bytes representing a UTF-8 encoded text. If this assumption is not met, it returns some result (it doesn`t throw an exception). \\n\" +\n \"\\n\" +\n \" There's also positionCaseInsensitiveUTF8 function.\"\n },\n {\n \"name\": \"roundDuration\",\n \"def\": \"roundDuration(num)\",\n \"docText\": \"Accepts a number. If the number is less than one, it returns 0. Otherwise, it rounds the number down to numbers from the set: 1, 10, 30, 60, 120, 180, 240, 300, 600, 1200, 1800, 3600, 7200, 18000, 36000. This function is specific to Yandex.Metrica and used for implementing the report on session length.\"\n },\n {\n \"name\": \"roundAge\",\n \"def\": \"roundAge(num)\",\n \"docText\": \"Accepts a number. If the number is less than 18, it returns 0. Otherwise, it rounds the number down to numbers from the set: 18, 25, 35, 45. This function is specific to Yandex.Metrica and used for implementing the report on user age.\"\n },\n {\n \"name\": \"round\",\n \"def\": \"round(num)\",\n \"docText\": \"Accepts a number. If the number is less than 18, it returns 0. Otherwise, it rounds the number down to numbers from the set: 18, 25, 35, 45. This function is specific to Yandex.Metrica and used for implementing the report on user age.\"\n },\n {\n \"name\": \"floor\",\n \"def\": \"floor(x[, N])\",\n \"docText\": \"Returns a rounder number that is less than or equal to `x`.\"\n },\n {\n \"name\": \"notEmpty\",\n \"def\": \"notEmpty(v)\",\n \"docText\": \"Returns 0 for an empty array, or 1 for a non-empty array. \\n\" +\n \"\\n\" +\n \" The result type is UInt8. \\n\" +\n \"\\n\" +\n \" The function also works for strings.\"\n },\n {\n \"name\": \"lengthUTF8\",\n \"def\": \"lengthUTF8(v)\",\n \"docText\": \"Returns the length of a string in Unicode code points (not in characters), assuming that the string contains a set of bytes that make up UTF-8 encoded text. If this assumption is not met, it returns some result (it doesn`t throw an exception). \\n\" +\n \"\\n\" +\n \" The result type is UInt64.\"\n },\n {\n \"name\": \"lower\",\n \"def\": \"lower(v)\",\n \"docText\": \"Converts a string to lowercase, assuming the string contains a set of bytes that make up a UTF-8 encoded text. It doesn`t detect the language. \"\n },\n {\n \"name\": \"lowerUTF8\",\n \"def\": \"lowerUTF8(v)\",\n \"docText\": \"Converts a string to lowercase, assuming the string contains a set of bytes that make up a UTF-8 encoded text. It doesn`t detect the language. \"\n },\n {\n \"name\": \"reverse\",\n \"def\": \"reverse(v)\",\n \"docText\": \"Reverses a sequence of Unicode code points, assuming that the string contains a set of bytes representing a UTF-8 text. Otherwise, it does something else (it doesn`t throw an exception).\"\n },\n {\n \"name\": \"URLPathHierarchy\",\n \"def\": \"URLPathHierarchy(URL)\",\n \"docText\": \"- The same thing, but without the protocol and host in the result. The / element (root) is not included. \"\n },\n {\n \"name\": \"substringUTF8\",\n \"def\": \"substringUTF8(s, offset, length)\",\n \"docText\": \"The same as `substring`, but for Unicode code points. Works under the assumption that the string contains a set of bytes representing a UTF-8 encoded text. If this assumption is not met, it returns some result (it doesn`t throw an exception).\"\n },\n {\n \"name\": \"appendTrailingCharIfAbsent\",\n \"def\": \"appendTrailingCharIfAbsent(s, c)\",\n \"docText\": \"If the `s` string is non-empty and does not contain the `c` character at the end, it appends the `c` character to the end.\"\n },\n {\n \"name\": \"alphaTokens\",\n \"def\": \"alphaTokens(s)\",\n \"docText\": \"Selects substrings of consecutive bytes from the range a-z and A-Z. \\n\" +\n \"\\n\" +\n \" Returns an array of selected substrings.\"\n },\n {\n \"name\": \"splitByChar\",\n \"def\": \"splitByChar(separator, s)\",\n \"docText\": \"Splits a string into substrings, using `separator` as the separator. \\n\" +\n \"\\n\" +\n \" `separator` must be a string constant consisting of exactly one character. \\n\" +\n \"\\n\" +\n \" Returns an array of selected substrings\"\n },\n {\n \"name\": \"arrayStringConcat\",\n \"def\": \"arrayStringConcat(arr[, separator])\",\n \"docText\": \"Concatenates strings from the array elements, using `separator` as the separator. \\n\" +\n \"\\n\" +\n \" `separator` is a string constant, an optional parameter. By default it is an empty string. \\n\" +\n \"\\n\" +\n \" Returns a string.\"\n },\n {\n \"name\": \"replaceAll\",\n \"def\": \"replaceAll(haystack, pattern, replacement)\",\n \"docText\": \"Replaces all occurrences of the `pattern` substring in `haystack` with the `replacement` substring.\"\n },\n {\n \"name\": \"replaceRegexpOne\",\n \"def\": \"replaceRegexpOne(haystack, pattern, replacement)\",\n \"docText\": \"Replacement using the `pattern` regular expression. A re2 regular expression. Replaces only the first occurrence, if it exists. \\n\" +\n \"\\n\" +\n \" A pattern can be specified as `replacement`. \"\n },\n {\n \"name\": \"cbrt\",\n \"def\": \"cbrt(x)\",\n \"docText\": \"Accepts a numeric argument and returns a Float64 number close to the cubic root of the argument.\"\n },\n {\n \"name\": \"match\",\n \"def\": \"match(pattern)(time, cond1, cond2, ...)\",\n \"docText\": \"Pattern matching for event chains. \\n\" +\n \"\\n\" +\n \" `pattern` is a string containing a pattern to match. The pattern is similar to a regular expression.\"\n },\n {\n \"name\": \"cutURLParameter\",\n \"def\": \"cutURLParameter(URL, name)\",\n \"docText\": \"Removes the URL parameter named `name`, if present. This function works under the assumption that the parameter name is encoded in the URL exactly the same way as in the passed argument.\"\n },\n {\n \"name\": \"like\",\n \"def\": \"like(haystack, pattern), haystack NOT LIKE pattern operator\",\n \"docText\": \"The same thing as `like`, but negative.\"\n },\n {\n \"name\": \"domain\",\n \"def\": \"domain(v)\",\n \"docText\": \"- Selects the part of the domain that includes top-level subdomains up to the `first significant subdomain` (see the explanation above). \\n\" +\n \"\\n\" +\n \" For example, cutToFirstSignificantSubdomain(`https://news.yandex.com.tr/`) = `yandex.com.tr`.\"\n },\n {\n \"name\": \"domainWithoutWWW\",\n \"def\": \"domainWithoutWWW(v)\",\n \"docText\": \"- Selects the domain and removes no more than one `www.` from the beginning of it, if present.\"\n },\n {\n \"name\": \"firstSignificantSubdomain\",\n \"def\": \"firstSignificantSubdomain(v)\",\n \"docText\": \"- Selects the part of the domain that includes top-level subdomains up to the `first significant subdomain` (see the explanation above). \\n\" +\n \"\\n\" +\n \" For example, cutToFirstSignificantSubdomain(`https://news.yandex.com.tr/`) = `yandex.com.tr`.\"\n },\n {\n \"name\": \"queryString\",\n \"def\": \"queryString(v)\",\n \"docText\": \"Removes the query-string and fragment identifier. The question mark and number sign are also removed.\"\n },\n {\n \"name\": \"queryStringAndFragment\",\n \"def\": \"queryStringAndFragment(v)\",\n \"docText\": \"Removes the query-string and fragment identifier. The question mark and number sign are also removed.\"\n },\n {\n \"name\": \"extractURLParameter\",\n \"def\": \"extractURLParameter(URL)\",\n \"docText\": \"- Gets an array of name=value strings corresponding to the names of URL parameters. The values are not decoded in any way.\"\n },\n {\n \"name\": \"URLHierarchy\",\n \"def\": \"URLHierarchy(URL)\",\n \"docText\": \"- Gets an array containing the URL trimmed to the `/`, `?` characters in the path and query-string. Consecutive separator characters are counted as one. The cut is made in the position after all the consecutive separator characters. Example:\"\n },\n {\n \"name\": \"cutToFirstSignificantSubdomain\",\n \"def\": \"cutToFirstSignificantSubdomain(v)\",\n \"docText\": \"- Selects the part of the domain that includes top-level subdomains up to the `first significant subdomain` (see the explanation above). \\n\" +\n \"\\n\" +\n \" For example, cutToFirstSignificantSubdomain(`https://news.yandex.com.tr/`) = `yandex.com.tr`.\"\n },\n {\n \"name\": \"cutWWW\",\n \"def\": \"cutWWW(v)\",\n \"docText\": \"Removes no more than one `www.` from the beginning of the URL`s domain, if present.\"\n },\n {\n \"name\": \"cutQueryString\",\n \"def\": \"cutQueryString(v)\",\n \"docText\": \"Removes the query-string and fragment identifier. The question mark and number sign are also removed.\"\n },\n {\n \"name\": \"cutFragment\",\n \"def\": \"cutFragment(v)\",\n \"docText\": \"Removes the fragment identifier. The number sign is also removed.\"\n },\n {\n \"name\": \"visitParamHas\",\n \"def\": \"visitParamHas(params, name)\",\n \"docText\": \"Checks whether there is a field with the `name` name.\"\n },\n {\n \"name\": \"visitParamExtractFloat\",\n \"def\": \"visitParamExtractFloat(params, name)\",\n \"docText\": \"The same as for Float64.\"\n },\n {\n \"name\": \"visitParamExtractBool\",\n \"def\": \"visitParamExtractBool(params, name)\",\n \"docText\": \"Parses a true/false value. The result is UInt8.\"\n },\n {\n \"name\": \"visitParamExtractRaw\",\n \"def\": \"visitParamExtractRaw(params, name)\",\n \"docText\": \"Returns the value of a field, including separators.\"\n },\n {\n \"name\": \"exp\",\n \"def\": \"exp(x)\",\n \"docText\": \"Accepts a numeric argument and returns a Float64 number close to 10 in power of x.\"\n },\n {\n \"name\": \"exp2\",\n \"def\": \"exp2(x)\",\n \"docText\": \"Accepts a numeric argument and returns a Float64 number close to 2 in power of x.\"\n },\n {\n \"name\": \"exp10\",\n \"def\": \"exp10(x)\",\n \"docText\": \"Accepts a numeric argument and returns a Float64 number close to 10 in power of x.\"\n },\n {\n \"name\": \"tgamma\",\n \"def\": \"tgamma(x)\",\n \"docText\": \"Gamma function.\"\n },\n {\n \"name\": \"log10\",\n \"def\": \"log10(x)\",\n \"docText\": \"Accepts a numeric argument and returns a Float64 number close to the decimal logarithm of the argument.\"\n },\n {\n \"name\": \"sqrt\",\n \"def\": \"sqrt(x)\",\n \"docText\": \"Accepts a numeric argument and returns a Float64 number close to the square root of the argument.\"\n },\n {\n \"name\": \"erf\",\n \"def\": \"erf(v)\",\n \"docText\": \"What to do when the amount of data exceeds one of the limits: `throw` or `break`. By default, throw.\"\n },\n {\n \"name\": \"erfc\",\n \"def\": \"erfc(x)\",\n \"docText\": \"Accepts a numeric argument and returns a Float64 number close to 1 - erf(x), but without loss of precision for large `x` values.\"\n },\n {\n \"name\": \"lgamma\",\n \"def\": \"lgamma(x)\",\n \"docText\": \"The logarithm of the gamma function.\"\n },\n {\n \"name\": \"sin\",\n \"def\": \"sin(x)\",\n \"docText\": \"Accepts Float32 and Float64 and returns UInt8 equal to 1 if the argument is infinite, otherwise 0. \\n\" +\n \"\\n\" +\n \" Note that 0 is returned for a NaN.\"\n },\n {\n \"name\": \"cos\",\n \"def\": \"cos(x)\",\n \"docText\": \"The arc cosine.\"\n },\n {\n \"name\": \"tan\",\n \"def\": \"tan(x)\",\n \"docText\": \"The arc tangent.\"\n },\n {\n \"name\": \"pow\",\n \"def\": \"pow(x, y)\",\n \"docText\": \"x in power of y.\"\n }\n ]\n };\n\n p.MacrosCompletions = function () {\n return [\n {\n \"name\": \"$table\",\n \"def\": \"$table\",\n \"docText\": \"Replaced with selected table name from Query Builder\"\n },\n {\n \"name\": \"$dateCol\",\n \"def\": \"$dateCol\",\n \"docText\": \"Replaced with `Date:Col` value from Query Builder\"\n },\n {\n \"name\": \"$dateTimeCol\",\n \"def\": \"$dateTimeCol\",\n \"docText\": \"Replaced with `Column:DateTime` or `Column:TimeStamp` value from Query Builder\"\n },\n {\n \"name\": \"$from\",\n \"def\": \"$from\",\n \"docText\": \"Replaced with timestamp/1000 value of selected `Time Range:From`\"\n },\n {\n \"name\": \"$to\",\n \"def\": \"$to\",\n \"docText\": \"Replaced with timestamp/1000 value of selected `Time Range:To`\"\n },\n {\n \"name\": \"$interval\",\n \"def\": \"$interval\",\n \"docText\": \"Replaced with selected `Group by time interval` value (as a number of seconds)\"\n },\n {\n \"name\": \"$timeFilter\",\n \"def\": \"$timeFilter\",\n \"docText\": \"Replaced with currently selected `Time Range`. Requires `Column:Date` and `Column:DateTime` or `Column:TimeStamp` to be selected\"\n },\n {\n \"name\": \"$timeSeries\",\n \"def\": \"$timeSeries\",\n \"docText\": \"Replaced with special ClickHouse construction to convert results as time-series data. Use it as `SELECT $timeSeries...`. Require `Column:DateTime` or `Column:TimeStamp` to be selected\"\n },\n {\n \"name\": \"$rate\",\n \"def\": \"$rate(cols...)\",\n \"docText\": \"Converts query results as `change rate per interval`. Can be used to display changes-per-second.\" +\n \"\\n\" +\n \"Example:\\n $rate(countIf(Type = 200) AS good, countIf(Type != 200) AS bad) FROM requests\"\n },\n {\n \"name\": \"$columns\",\n \"def\": \"$columns(key, value)\",\n \"docText\": \"Query values as array of [key, value], where key will be used as label. Can be used to display multiple lines at graph\" +\n \"\\n\" +\n \"Example:\\n $columns(OSName, count(*) c) FROM requests\"\n },\n {\n \"name\": \"$rateColumns\",\n \"def\": \"$rateColumns(key, value)\",\n \"docText\": \"Is a combination of `$columns` and `$rate` .\" +\n \"\\n\" +\n \"Example:\\n $rateColumns(OS, count(*) c) FROM requests\"\n },\n {\n \"name\": \"$unescape\",\n \"def\": \"$unescape($variable)\",\n \"docText\": \"Unescapes variable value by removing single quotes\" +\n \"\\n\" +\n \"Example:\\n SELECT $unescape($column) FROM requests WHERE $unescape($column) = 5\"\n }\n ];\n };\n\n p.re = function (list) {\n return list.join(\"|\")\n };\n\n exports.ClickhouseInfo = p;\n});"]} +{"version":3,"sources":["../src/clickhouse-info.js"],"names":["ace","define","require","exports","module","p","Keywords","DataTypes","Constants","Funcs","Macros","KeywordsRe","re","ConstantsRe","FunctionsRe","concat","DataTypesRe","FunctionsCompletions","MacrosCompletions","list","join","ClickhouseInfo"],"mappings":";;;;;;;;AAAA;AACA;;AAEAA,gBAAIC,MAAJ,CAAW,0BAAX,EAAuC,CAAC,SAAD,EAAY,SAAZ,EAAuB,QAAvB,CAAvC,EAAyE,UAAUC,OAAV,EAAmBC,OAAnB,EAA4BC,MAA5B,EAAoC;AACzG;;AAEA,oBAAIC,IAAI,EAAR;AACAA,kBAAEC,QAAF,GAAa,CACT,QADS,EAET,MAFS,EAGT,MAHS,EAIT,UAJS,EAKT,QALS,EAM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,cADZ;AAEI,+BAAO,cAFX;AAGI,mCAAW;AAHf,qBAXG,EAgBH;AACI,gCAAQ,OADZ;AAEI,+BAAO,OAFX;AAGI,mCAAW;AAHf,qBAhBG,EAqBH;AACI,gCAAQ,KADZ;AAEI,+BAAO,KAFX;AAGI,mCAAW;AAHf,qBArBG,EA0BH;AACI,gCAAQ,WADZ;AAEI,+BAAO,WAFX;AAGI,mCAAW;AAHf,qBA1BG,EA+BH;AACI,gCAAQ,aADZ;AAEI,+BAAO,aAFX;AAGI,mCAAW;AAHf,qBA/BG,EAoCH;AACI,gCAAQ,aADZ;AAEI,+BAAO,aAFX;AAGI,mCAAW;AAHf,qBApCG,EAyCH;AACI,gCAAQ,OADZ;AAEI,+BAAO,gBAFX;AAGI,mCAAW,qGACX,IADW,GAEX;AALJ,qBAzCG,EAgDH;AACI,gCAAQ,UADZ;AAEI,+BAAO,sBAFX;AAGI,mCAAW,2HACX,IADW,GAEX;AALJ,qBAhDG,EAuDH;AACI,gCAAQ,cADZ;AAEI,+BAAO,0BAFX;AAGI,mCAAW,iDACX,IADW,GAEX;AALJ,qBAvDG,EA8DH;AACI,gCAAQ,WADZ;AAEI,+BAAO,sBAFX;AAGI,mCAAW,uDACX,IADW,GAEX;AALJ,qBA9DG,CAAP;AAsEH,iBAvED;;AAyEAb,kBAAEO,EAAF,GAAO,UAAUO,IAAV,EAAgB;AACnB,2BAAOA,KAAKC,IAAL,CAAU,GAAV,CAAP;AACH,iBAFD;;AAIAjB,wBAAQkB,cAAR,GAAyBhB,CAAzB;AACH,aAhlED","file":"clickhouse-info.js","sourcesContent":["// jshint ignore: start\n// jscs: disable\n\nace.define(\"ace/mode/clickhouse_info\", [\"require\", \"exports\", \"module\"], function (require, exports, module) {\n \"use strict\";\n\n var p = {};\n p.Keywords = [\n \"SELECT\",\n \"CASE\",\n \"THEN\",\n \"DISTINCT\",\n \"INSERT\",\n \"UPDATE\",\n \"DELETE\",\n \"WHERE\",\n \"AND\",\n \"OR\",\n \"OFFSET\",\n \"HAVING\",\n \"AS\",\n \"GLOBAL\",\n \"FROM\",\n \"WHEN\",\n \"ELSE\",\n \"END\",\n \"TYPE\",\n \"LEFT\",\n \"RIGHT\",\n \"USING\",\n \"JOIN\",\n \"ON\",\n \"OUTER\",\n \"DESC\",\n \"ASC\",\n \"UNION\",\n \"CREATE\",\n \"TABLE\",\n \"PRIMARY\",\n \"KEY\",\n \"FOREIGN\",\n \"NOT\",\n \"REFERENCES\",\n \"DEFAULT\",\n \"INNER\",\n \"CROSS\",\n \"NATURAL\",\n \"DATABASE\",\n \"DROP\",\n \"GRANT\",\n \"ANY\",\n \"BETWEEN\",\n \"ATTACH\",\n \"DETACH\",\n \"CAST\",\n \"WITH\",\n \"BIT_AND\",\n \"BIT_OR\",\n \"BIT_XOR\",\n \"DESCRIBE\",\n \"OPTIMIZE\",\n \"PREWHERE\",\n \"TOTALS\",\n \"DATABASES\",\n \"PROCESSLIST\",\n \"SHOW\",\n \"LIMIT\",\n \"IF\",\n \"IF NOT EXISTS\",\n \"IF EXISTS\",\n \"GROUP\",\n \"ORDER\",\n \"BY\",\n \"IN\",\n \"FORMAT\",\n \"GROUP BY\",\n \"ORDER BY\",\n \"UNION ALL\"\n ];\n p.DataTypes = [\n \"int\",\n \"numeric\",\n \"decimal\",\n \"date\",\n \"varchar\",\n \"char\",\n \"bigint\",\n \"float\",\n \"double\",\n \"bit\",\n \"binary\",\n \"text\",\n \"set\",\n \"timestamp\",\n \"uint8\",\n \"uint16\",\n \"uint32\",\n \"uint64\",\n \"int8\",\n \"int16\",\n \"int32\",\n \"int64\",\n \"float32\",\n \"float64\",\n \"datetime\",\n \"enum8\",\n \"enum16\",\n \"array\",\n \"tuple\",\n \"string\"\n ];\n p.Constants = [\n \"true\",\n \"false\",\n \"NULL\"\n ];\n p.Funcs = [\n \"IPv4NumToString\", \"IPv4NumToStringClassC\", \"IPv4StringToNum\", \"IPv6NumToString\", \"IPv6StringToNum\",\n \"MD5\", \"OSHierarchy\", \"OSIn\", \"OSToRoot\", \"SEHierarchy\", \"SEIn\", \"SEToRoot\", \"SHA1\", \"SHA224\", \"SHA256\",\n \"URLHash\", \"URLHierarchy\", \"URLPathHierarchy\", \"abs\", \"alphaTokens\", \"appendTrailingCharIfAbsent\",\n \"argMax\", \"argMin\", \"argMinIf\", \"arrayAll\", \"arrayCount\", \"arrayElement\", \"arrayEnumerate\", \"arrayEnumerateUniq\",\n \"arrayExists\", \"arrayFilter\", \"arrayFirst\", \"arrayJoin\", \"arrayMap\", \"arraySum\", \"avg\", \"avgIf\",\n \"bitAnd\", \"bitNot\", \"bitOr\", \"bitShiftLeft\", \"bitShiftRight\", \"bitXor\", \"bitmaskToArray\", \"bitmaskToList\",\n \"ceil\", \"cityHash64\", \"coalesce\", \"concat\", \"corr\", \"corrIf\", \"count\", \"countEqual\", \"countIf\", \"countIf\",\n \"covarPop\", \"covarPopIf\", \"covarSamp\", \"covarSampIf\", \"cutFragment\", \"cutQueryString\", \"cutQueryStringAndFragment\",\n \"cutToFirstSignificantSubdomain\", \"cutURLParameter\", \"cutWWW\", \"dictGetDate\", \"dictGetDateTime\", \"dictGetFloat32\",\n \"dictGetFloat64\", \"dictGetHierarchy\", \"dictGetInt16\", \"dictGetInt32\", \"dictGetInt64\", \"dictGetInt8\", \"dictGetString\",\n \"dictGetUInt16\", \"dictGetUInt32\", \"dictGetUInt64\", \"dictGetUInt8\", \"dictHas\", \"dictIsIn\", \"divide\", \"domainWithoutWWW\",\n \"empty\", \"extract\", \"extractAll\", \"extractURLParameter\", \"extractURLParameterNames\", \"extractURLParameters\",\n \"first\", \"firstSignificantSubdomain\", \"floor\", \"groupArray\", \"groupUniqArray\", \"halfMD5\", \"has\", \"hex\", \"ifnull\",\n \"indexOf\", \"intDiv\", \"intDivOrZero\", \"intHash32\", \"intHash64\", \"isnull\", \"last\", \"lcase\", \"length\", \"lengthUTF8\",\n \"like\", \"lower\", \"lowerUTF8\", \"match\", \"max\", \"median\", \"medianIf\", \"mid\", \"min\", \"minus\", \"modulo\", \"multiply\",\n \"negate\", \"notEmpty\", \"notLike\", \"now\", \"now\", \"nvl\", \"plus\", \"position\", \"positionUTF8\", \"quantile\",\n \"quantileDeterministic\", \"quantileExact\", \"quantileExactWeighted\", \"quantileTDigest\", \"quantileTiming\",\n \"quantileTimingWeighted\", \"quantiles\", \"quantilesIf\", \"quantilesTimingArrayIf\", \"quantilesTimingIf\", \"queryString\",\n \"queryStringAndFragment\", \"rand\", \"rand64\", \"range\", \"rank\", \"regionHierarchy\", \"regionIn\", \"regionToContinent\",\n \"regionToCountry\", \"regionToName\", \"regionToPopulation\", \"reinterpretAsDate\", \"reinterpretAsDateTime\", \"reinterpretAsFloat32\",\n \"reinterpretAsFloat64\", \"reinterpretAsInt16\", \"reinterpretAsInt32\", \"reinterpretAsInt64\", \"reinterpretAsInt8\", \"reinterpretAsString\",\n \"reinterpretAsUInt16\", \"reinterpretAsUInt32\", \"reinterpretAsUInt64\", \"reinterpretAsUInt8\", \"replaceAll\", \"replaceOne\",\n \"replaceRegexpOne\", \"reverse\", \"reverseUTF8\", \"round\", \"round\", \"roundAge\", \"roundDuration\", \"roundToExp2\", \"sequenceCount\",\n \"sequenceMatch\", \"sipHash128\", \"sipHash64\", \"splitByChar\", \"splitByString\", \"stddevPop\", \"stddevPopIf\", \"stddevSamp\",\n \"stddevSampIf\", \"substring\", \"substringUTF8\", \"sum\", \"sumArray\", \"sumArrayIf\", \"sumIf\", \"timeSlot\", \"toDate\", \"toDateTime\",\n \"toDayOfMonth\", \"toDayOfWeek\", \"toFixedString\", \"toFloat32\", \"toFloat64\", \"toHour\", \"toInt16\", \"toInt32\", \"toInt64\", \"toInt8\",\n \"toMinute\", \"toMonday\", \"toMonth\", \"toRelativeDayNum\", \"toRelativeHourNum\", \"toRelativeMinuteNum\", \"toRelativeMonthNum\",\n \"toRelativeSecondNum\", \"toRelativeWeekNum\", \"toRelativeYearNum\", \"toSecond\", \"toStartOfFiveMinute\", \"toStartOfHour\",\n \"toStartOfMinute\", \"toStartOfMonth\", \"toStartOfQuarter\", \"toStartOfYear\", \"toString\", \"toStringCutToZero\", \"toTime\", \"toUInt16\",\n \"toUInt32\", \"toUInt64\", \"toUInt8\", \"toYear\", \"today\", \"topLevelDomain\", \"ucase\", \"unhex\", \"uniq\", \"uniqArray\", \"uniqArrayIf\",\n \"uniqArrayIf\", \"uniqCombined\", \"uniqCombinedIf\", \"uniqExact\", \"uniqExactIf\", \"uniqHLL12\", \"uniqUpTo\", \"upper\", \"upperUTF8\", \"varPop\", \"varPopIf\",\n \"varSamp\", \"varSampIf\", \"yesterday\"\n ];\n p.Macros = [\n \"$table\",\n \"$dateCol\",\n \"$dateTimeCol\",\n \"$from\",\n \"$to\",\n \"$interval\",\n \"$timeFilter\",\n \"$timeSeries\",\n \"$rate\",\n \"$columns\",\n \"$rateColumns\",\n \"$unescape\"\n ];\n p.KeywordsRe = function () {\n return this.re(p.Keywords)\n };\n p.ConstantsRe = function () {\n return this.re(p.Constants)\n };\n p.FunctionsRe = function () {\n return this.re(p.Funcs).concat(this.re(p.Macros))\n };\n p.DataTypesRe = function () {\n return this.re(p.DataTypes);\n };\n p.FunctionsCompletions = function () {\n return [\n {\n \"name\": \"corr\",\n \"def\": \"corr(x, y)\",\n \"docText\": \"Calculates the Pearson correlation coefficient: Σ((x - x̅)(y - y̅)) / sqrt(Σ((x - x̅)2) * Σ((y - y̅)2)).\"\n },\n {\n \"name\": \"stddevPop\",\n \"def\": \"stddevPop(x)\",\n \"docText\": \"The result is equal to the square root of `varPop(x)`.\"\n },\n {\n \"name\": \"varPop\",\n \"def\": \"varPop(x, y)\",\n \"docText\": \"Calculates the value of `Σ((x - x̅)(y - y̅)) / n`.\"\n },\n {\n \"name\": \"argMin\",\n \"def\": \"argMin(arg, val)\",\n \"docText\": \"Calculates the `arg` value for a minimal `val` value. If there are several different values of `arg` for minimal values of `val`, the first of these values encountered is output.\"\n },\n {\n \"name\": \"quantileExactWeighted\",\n \"def\": \"quantileExactWeighted(level)(x, weight)\",\n \"docText\": \"Computes the level quantile exactly. In this case, each value is taken into account with the weight weight - as if it is present weight once. The arguments of the function can be considered as histograms, where the value \\\"x\\\" corresponds to the \\\"column\\\" of the histogram of the height weight, and the function itself can be considered as the summation of histograms.\\n\" +\n \"\\n\" +\n \"The algorithm is a hash table. Because of this, in case the transmitted values ​​are often repeated, the function consumes less RAM than the quantileExact. You can use this function instead of quantileExact, specifying the number 1 as the weight.\"\n },\n {\n \"name\": \"min\",\n \"def\": \"min(v)\",\n \"docText\": \"Minimal execution speed in rows per second. Checked on every data block when `timeout_before_checking_execution_speed` expires. If the execution speed is lower, an exception is thrown.\"\n },\n {\n \"name\": \"varSamp\",\n \"def\": \"varSamp(x)\",\n \"docText\": \"Calculates the amount Σ((x - x̅)2) / (n - 1), where 'n' is the sample size and 'x̅' is the average value of 'x'.\\n\" +\n \"\\n\" +\n \"It represents an unbiased estimate of the variance of a random variable, if the values passed to the function are a sample of this random amount.\\n\" +\n \"\\n\" +\n \"Returns Float64. If n <= 1, it returns +∞.\"\n },\n {\n \"name\": \"anyLast\",\n \"def\": \"anyLast(x)\",\n \"docText\": \"Selects the last value encountered. \\n\" +\n \"\\n\" +\n \" The result is just as indeterminate as for the `any` function.\"\n },\n {\n \"name\": \"argMax\",\n \"def\": \"argMax(arg, val)\",\n \"docText\": \"Calculates the `arg` value for a maximum `val` value. If there are several different values of `arg` for maximum values of `val`, the first of these values encountered is output.\"\n },\n {\n \"name\": \"count\",\n \"def\": \"count()\",\n \"docText\": \"Counts the number of rows. \"\n },\n {\n \"name\": \"any\",\n \"def\": \"any(x)\",\n \"docText\": \"Selects the last value encountered. \\n\" +\n \"\\n\" +\n \" The result is just as indeterminate as for the `any` function.\"\n },\n {\n \"name\": \"avg\",\n \"def\": \"avg(x)\",\n \"docText\": \"Calculates the average. \\n\" +\n \"\\n\" +\n \" Only works for numbers. \\n\" +\n \"\\n\" +\n \" The result is always Float64.\"\n },\n {\n \"name\": \"sequenceMatch\",\n \"def\": \"sequenceMatch(pattern)(time, cond1, cond2, ...)\",\n \"docText\": \"Pattern matching for event chains.\\n\" +\n \"\\n\" +\n \"'pattern' is a string containing a pattern to match. The pattern is similar to a regular expression. 'time' is the event time of the DateTime type. 'cond1, cond2 ...' are from one to 32 arguments of the UInt8 type that indicate whether an event condition was met.\\n\" +\n \"\\n\" +\n \"The function collects a sequence of events in RAM. Then it checks whether this sequence matches the pattern. It returns UInt8 - 0 if the pattern isn't matched, or 1 if it matches.\\n\" +\n \"\\n\" +\n \"Example: sequenceMatch('(?1).*(?2)')(EventTime, URL LIKE '%company%', URL LIKE '%cart%') - whether there was a chain of events in which pages with the address in company were visited earlier than pages with the address in cart.\"\n },\n {\n \"name\": \"stddevSamp\",\n \"def\": \"stddevSamp(x)\",\n \"docText\": \"The result is equal to the square root of `varSamp(x)`.\"\n },\n {\n \"name\": \"medianDeterministic\",\n \"def\": \"medianDeterministic(x, determinator)\",\n \"docText\": \"This function works similarly to the `median` function - it approximates the median.\"\n },\n {\n \"name\": \"quantilesTimingWeighted\",\n \"def\": \"quantilesTimingWeighted(level1, level2, ...)(x, weight)\",\n \"docText\": \"Calculates the quantiles of all specified levels using the same algorithm as the `medianTimingWeighted` function.\"\n },\n {\n \"name\": \"uniq\",\n \"def\": \"uniq(N)(x)\",\n \"docText\": \"Calculates the number of different argument values, if it is less than or equal to N. \\n\" +\n \"\\n\" +\n \" If the number of different argument values is greater than N, it returns N + 1.\"\n },\n {\n \"name\": \"covarSamp\",\n \"def\": \"covarSamp(x, y)\",\n \"docText\": \"Calculates the value of `Σ((x - x̅)(y - y̅)) / (n - 1)`. \" +\n \"Returns Float64. If n <= 1, it returns +∞.\"\n },\n {\n \"name\": \"max\",\n \"def\": \"max(v)\",\n \"docText\": \"Maximum number of bytes (uncompressed data) that can be passed to a remote server or saved in a temporary table when using GLOBAL IN.\"\n },\n {\n \"name\": \"quantileTDigest\",\n \"def\": \"quantileTDigest(level)(x)\",\n \"docText\": \"t-digest\"\n },\n {\n \"name\": \"quantilesTiming\",\n \"def\": \"quantilesTiming(level1, level2, ...)(x, weight)\",\n \"docText\": \"Calculates the quantiles of all specified levels using the same algorithm as the `medianTimingWeighted` function.\"\n },\n {\n \"name\": \"quantiles\",\n \"def\": \"quantiles(level1, level2, ...)(x, determinator)\",\n \"docText\": \"Calculates the quantiles of all specified levels using the same algorithm as the `medianDeterministic` function.\"\n },\n {\n \"name\": \"quantile\",\n \"def\": \"quantile(level1, level2, ...)(x, determinator)\",\n \"docText\": \"Calculates the quantiles of all specified levels using the same algorithm as the `medianDeterministic` function.\"\n },\n {\n \"name\": \"groupArray\",\n \"def\": \"groupArray(x)\",\n \"docText\": \"Creates an array of argument values. \\n\" +\n \"\\n\" +\n \" Values can be added to the array in any (indeterminate) order. \\n\" +\n \"\\n\" +\n \" In some cases, you can rely on the order of execution. This applies to cases when SELECT comes from a subquery that uses ORDER BY.\"\n },\n {\n \"name\": \"sum\",\n \"def\": \"sum(x)\",\n \"docText\": \"Calculates the sum. \\n\" +\n \"\\n\" +\n \" Only works for numbers.\"\n },\n {\n \"name\": \"median\",\n \"def\": \"median(x, weight)\",\n \"docText\": \"Differs from the `medianTiming` function in that it has a second argument - `weights`. Weight is a non-negative integer. \\n\" +\n \"\\n\" +\n \" The result is calculated as if the `x` value were passed `weight` number of times to the `medianTiming` function.\"\n },\n {\n \"name\": \"quantileTiming\",\n \"def\": \"quantileTiming(level)(x, weight)\",\n \"docText\": \"Calculates the quantile of `level` using the same algorithm as the `medianTimingWeighted` function.\"\n },\n {\n \"name\": \"quantileTimingWeighted\",\n \"def\": \"quantileTimingWeighted(level)(x, weight)\",\n \"docText\": \"Calculates the quantile of `level` using the same algorithm as the `medianTimingWeighted` function.\"\n },\n {\n \"name\": \"groupUniqArray\",\n \"def\": \"groupUniqArray(x)\",\n \"docText\": \"Creates an array from different argument values. Memory consumption is the same as for the `uniqExact` function.\"\n },\n {\n \"name\": \"uniqHLL12\",\n \"def\": \"uniqHLL12(x)\",\n \"docText\": \"Uses the HyperLogLog algorithm to approximate the number of different values of the argument. \"\n },\n {\n \"name\": \"covarPop\",\n \"def\": \"covarPop(x, y)\",\n \"docText\": \"Calculates the value of `Σ((x - x̅)(y - y̅)) / n`.\"\n },\n {\n \"name\": \"sequenceCount\",\n \"def\": \"sequenceCount(pattern)(time, cond1, cond2, ...)\",\n \"docText\": \"sequenceMatch\"\n },\n {\n \"name\": \"quantileDeterministic\",\n \"def\": \"quantileDeterministic(level)(x, determinator)\",\n \"docText\": \"Calculates the quantile of `level` using the same algorithm as the `medianDeterministic` function.\"\n },\n {\n \"name\": \"quantileExact\",\n \"def\": \"quantileExact(level)(x, weight)\",\n \"docText\": \"\"\n },\n {\n \"name\": \"quantilesDeterministic\",\n \"def\": \"quantilesDeterministic(level1, level2, ...)(x, determinator)\",\n \"docText\": \"Calculates the quantiles of all specified levels using the same algorithm as the `medianDeterministic` function.\"\n },\n {\n \"name\": \"medianTiming\",\n \"def\": \"medianTiming(x, weight)\",\n \"docText\": \"Differs from the `medianTiming` function in that it has a second argument - `weights`.\"\n },\n {\n \"name\": \"medianTimingWeighted\",\n \"def\": \"medianTimingWeighted(x, weight)\",\n \"docText\": \"Differs from the `medianTiming` function in that it has a second argument - `weights`.\"\n },\n {\n \"name\": \"uniqExact\",\n \"def\": \"uniqExact(x)\",\n \"docText\": \"Calculates the number of different values of the argument, exactly. \\n\" +\n \"\\n\" +\n \" There is no reason to fear approximations, so it`s better to use the `uniq` function. \\n\" +\n \"\\n\" +\n \" You should use the `uniqExact` function if you definitely need an exact result. \"\n },\n {\n \"name\": \"uniqCombined\",\n \"def\": \"uniqCombined(x)\",\n \"docText\": \"\"\n },\n {\n \"name\": \"uniqCombinedIf\",\n \"def\": \"uniqCombinedIf(x,v)\",\n \"docText\": \"\"\n },\n {\n \"name\": \"uniqUpTo\",\n \"def\": \"uniqUpTo(N)(x)\",\n \"docText\": \"Calculates the number of different argument values, if it is less than or equal to N. \\n\" +\n \"\\n\" +\n \" If the number of different argument values is greater than N, it returns N + 1.\"\n },\n {\n \"name\": \"substring\",\n \"def\": \"substring(s, offset, length)\",\n \"docText\": \"The same as `substring`, but for Unicode code points. Works under the assumption that the string contains a set of bytes representing a UTF-8 encoded text. If this assumption is not met, it returns some result (it doesn`t throw an exception).\"\n },\n {\n \"name\": \"notLike\",\n \"def\": \"notLike(haystack, pattern), haystack NOT LIKE pattern operator\",\n \"docText\": \"The same thing as `like`, but negative.\"\n },\n {\n \"name\": \"hostName\",\n \"def\": \"hostName()\",\n \"docText\": \"Returns a string with the name of the host that this function was performed on. For distributed processing, this is the name of the remote server host, if the function is performed on a remote server.\"\n },\n {\n \"name\": \"globalNotIn\",\n \"def\": \"globalNotIn(v)\",\n \"docText\": \"See the section `IN operators`.\"\n },\n {\n \"name\": \"or\",\n \"def\": \"or(v)\",\n \"docText\": \"The same thing as `max_temporary_columns`, but without counting constant columns. \\n\" +\n \"\\n\" +\n \" Note that constant columns are formed fairly often when running a query, but they require approximately zero computing resources.\"\n },\n {\n \"name\": \"extractAll\",\n \"def\": \"extractAll(haystack, pattern)\",\n \"docText\": \"Extracts all the fragments of a string using a regular expression. If `haystack` doesn`t match the `pattern` regex, an empty string is returned. Returns an array of strings consisting of all matches to the regex.\"\n },\n {\n \"name\": \"arrayFirst\",\n \"def\": \"arrayFirst(func, arr1, ...)\",\n \"docText\": \"Returns the index of the first element in the `arr1` array for which `func` returns something other than 0.\"\n },\n {\n \"name\": \"arrayExists\",\n \"def\": \"arrayExists([func,] arr1, ...)\",\n \"docText\": \"Returns 1 if there is at least one element in `arr` for which `func` returns something other than 0. Otherwise, it returns 0.\"\n },\n {\n \"name\": \"arrayCount\",\n \"def\": \"arrayCount([func,] arr1, ...)\",\n \"docText\": \"Returns the number of elements in `arr` for which `func` returns something other than 0. If `func` is not specified, it returns the number of non-zero items in the array.\"\n },\n {\n \"name\": \"arrayMap\",\n \"def\": \"arrayMap(func, arr1, ...)\",\n \"docText\": \"Returns an array obtained from the original application of the `func` function to each element in the `arr` array.\"\n },\n {\n \"name\": \"now\",\n \"def\": \"now(v)\",\n \"docText\": \"If the parameter is true, INSERT operation will skip columns with unknown names from input. \\n\" +\n \"\\n\" +\n \" Otherwise, an exception will be generated, it is default behavior. \\n\" +\n \"\\n\" +\n \" The parameter works only for JSONEachRow and TSKV input formats.\"\n },\n {\n \"name\": \"intDiv\",\n \"def\": \"intDiv(a, b)\",\n \"docText\": \"Differs from `intDiv` in that it returns zero when dividing by zero or when dividing a minimal negative number by minus one.\"\n },\n {\n \"name\": \"topLevelDomain\",\n \"def\": \"topLevelDomain(v)\",\n \"docText\": \"Selects the top-level domain. Example: .ru.\"\n },\n {\n \"name\": \"intHash32\",\n \"def\": \"intHash32(v)\",\n \"docText\": \"Calculates a 32-bit hash code from any type of integer. \\n\" +\n \"\\n\" +\n \" This is a relatively fast non-cryptographic hash function of average quality for numbers.\"\n },\n {\n \"name\": \"replaceOne\",\n \"def\": \"replaceOne(haystack, pattern, replacement)\",\n \"docText\": \"Replaces the first occurrence, if it exists, of the `pattern` substring in `haystack` with the `replacement` substring. \\n\" +\n \"\\n\" +\n \" Hereafter, `pattern` and `replacement` must be constants.\"\n },\n {\n \"name\": \"cityHash64\",\n \"def\": \"cityHash64(v)\",\n \"docText\": \"Calculates CityHash64 from a string or a similar hash function for any number of any type of arguments. \\n\" +\n \"\\n\" +\n \" For String-type arguments, CityHash is used. This is a fast non-cryptographic hash function for strings with decent quality\"\n },\n {\n \"name\": \"OSToRoot\",\n \"def\": \"OSToRoot(v)\",\n \"docText\": \"Accepts a UInt8 number - the ID of the operating system from the Yandex.Metrica dictionary. If any OS matches the passed number, it returns a UInt8 number - the ID of the corresponding root OS (for example, it converts Windows Vista to Windows). Otherwise, returns 0.\"\n },\n {\n \"name\": \"sipHash128\",\n \"def\": \"sipHash128(v)\",\n \"docText\": \"Calculates SipHash from a string. \\n\" +\n \"\\n\" +\n \" Accepts a String-type argument. Returns FixedString(16). \\n\" +\n \"\\n\" +\n \" Differs from sipHash64 in that the final xor-folding state is only done up to 128 bits.\"\n },\n {\n \"name\": \"SHA1\",\n \"def\": \"SHA1(v)\",\n \"docText\": \"Calculates SHA-1, SHA-224, or SHA-256 from a string and returns the resulting set of bytes as FixedString(20), FixedString(28), or FixedString(32).\"\n },\n {\n \"name\": \"asin\",\n \"def\": \"asin(x)\",\n \"docText\": \"The arc sine.\"\n },\n {\n \"name\": \"SHA256\",\n \"def\": \"SHA256(v)\",\n \"docText\": \"Calculates SHA-1, SHA-224, or SHA-256 from a string and returns the resulting set of bytes as FixedString(20), FixedString(28), or FixedString(32).\"\n },\n {\n \"name\": \"MD5\",\n \"def\": \"MD5(v)\",\n \"docText\": \"Calculates the MD5 from a string and returns the resulting set of bytes as FixedString(16).\"\n },\n {\n \"name\": \"bitmaskToList\",\n \"def\": \"bitmaskToList(num)\",\n \"docText\": \"Accepts an integer. Returns a string containing the list of powers of two that total the source number when summed. They are comma-separated without spaces in text format, in ascending order.\"\n },\n {\n \"name\": \"array\",\n \"def\": \"array(v)\",\n \"docText\": \"The -`Array` suffix can be appended to any aggregate function. In this case, the aggregate function takes arguments of the `Array(T)` type (arrays) instead of `T` type arguments. If the aggregate function accepts multiple arguments, this must be arrays of equal lengths. \"\n },\n {\n \"name\": \"dictGetStringOrDefault\",\n \"def\": \"dictGetStringOrDefault(v)\",\n \"docText\": \"dictGetT('dict_name', 'attr_name', id) Gets the value of the 'attr_name' attribute from the 'dict_name' dictionary by the 'id' key. 'dict_name' and 'attr_name' are constant strings. 'id' must be UInt64. If the 'id' key is not in the dictionary, it returns the default value set in the dictionary definition.\"\n },\n {\n \"name\": \"greaterOrEquals\",\n \"def\": \"greaterOrEquals(v)\",\n \"docText\": \"\"\n },\n {\n \"name\": \"e\",\n \"def\": \"e(v)\",\n \"docText\": \"What to do when the amount of data exceeds one of the limits: `throw` or `break`. By default, throw.\"\n },\n {\n \"name\": \"runningDifference\",\n \"def\": \"runningDifference(x)\",\n \"docText\": \"Calculates the difference between consecutive values in the data block. \\n\" +\n \"\\n\" +\n \" Result of the function depends on the order of the data in the blocks. \\n\" +\n \"\\n\" +\n \" It works only inside of the each processed block of data. Data splitting in the blocks is not explicitly controlled by the user. \"\n },\n {\n \"name\": \"not\",\n \"def\": \"not(v)\",\n \"docText\": \"See the section `IN operators`.\"\n },\n {\n \"name\": \"intHash64\",\n \"def\": \"intHash64(v)\",\n \"docText\": \"Calculates a 64-bit hash code from any type of integer. \\n\" +\n \"\\n\" +\n \" It works faster than intHash32. Average quality.\"\n },\n {\n \"name\": \"acos\",\n \"def\": \"acos(x)\",\n \"docText\": \"The arc cosine.\"\n },\n {\n \"name\": \"dictGetString\",\n \"def\": \"dictGetString(v)\",\n \"docText\": \"\"\n },\n {\n \"name\": \"and\",\n \"def\": \"and(x, determinator)\",\n \"docText\": \"This function works similarly to the `median` function - it approximates the median. However, in contrast to `median`, the result is deterministic and does not depend on the order of query execution. \\n\" +\n \"\\n\" +\n \" To achieve this, the function takes a second argument - the `determinator`. \"\n },\n {\n \"name\": \"dictGetDate\",\n \"def\": \"dictGetDate(v)\",\n \"docText\": \"dictGetT('dict_name', 'attr_name', id) Gets the value of the 'attr_name' attribute from the 'dict_name' dictionary by the 'id' key. 'dict_name' and 'attr_name' are constant strings. 'id' must be UInt64. If the 'id' key is not in the dictionary, it returns the default value set in the dictionary definition.\"\n },\n {\n \"name\": \"dictGetFloat32\",\n \"def\": \"dictGetFloat32(v)\",\n \"docText\": \"dictGetT('dict_name', 'attr_name', id) Gets the value of the 'attr_name' attribute from the 'dict_name' dictionary by the 'id' key. 'dict_name' and 'attr_name' are constant strings. 'id' must be UInt64. If the 'id' key is not in the dictionary, it returns the default value set in the dictionary definition.\"\n },\n {\n \"name\": \"dictGetInt8\",\n \"def\": \"dictGetInt8(v)\",\n \"docText\": \"dictGetT('dict_name', 'attr_name', id) Gets the value of the 'attr_name' attribute from the 'dict_name' dictionary by the 'id' key. 'dict_name' and 'attr_name' are constant strings. 'id' must be UInt64. If the 'id' key is not in the dictionary, it returns the default value set in the dictionary definition.\"\n },\n {\n \"name\": \"dictGetUInt32\",\n \"def\": \"dictGetUInt32(v)\",\n \"docText\": \"dictGetT('dict_name', 'attr_name', id) Gets the value of the 'attr_name' attribute from the 'dict_name' dictionary by the 'id' key. 'dict_name' and 'attr_name' are constant strings. 'id' must be UInt64. If the 'id' key is not in the dictionary, it returns the default value set in the dictionary definition.\"\n },\n {\n \"name\": \"OSIn\",\n \"def\": \"OSIn(lhs, rhs)\",\n \"docText\": \"Checks whether the `lhs` operating system belongs to the `rhs` operating system.\"\n },\n {\n \"name\": \"arrayFirstIndex\",\n \"def\": \"arrayFirstIndex(func, arr1, ...)\",\n \"docText\": \"Returns the index of the first element in the `arr1` array for which `func` returns something other than 0.\"\n },\n {\n \"name\": \"ceil\",\n \"def\": \"ceil(x[, N])\",\n \"docText\": \"Returns the smallest round number that is greater than or equal to `x`. In every other way, it is the same as the `floor` function (see above).\"\n },\n {\n \"name\": \"fragment\",\n \"def\": \"fragment(v)\",\n \"docText\": \"Removes the query-string and fragment identifier. The question mark and number sign are also removed.\"\n },\n {\n \"name\": \"dictGetUInt8\",\n \"def\": \"dictGetUInt8(v)\",\n \"docText\": \"dictGetT('dict_name', 'attr_name', id) Gets the value of the 'attr_name' attribute from the 'dict_name' dictionary by the 'id' key. 'dict_name' and 'attr_name' are constant strings. 'id' must be UInt64. If the 'id' key is not in the dictionary, it returns the default value set in the dictionary definition.\"\n },\n {\n \"name\": \"dictHas\",\n \"def\": \"dictHas(v)\",\n \"docText\": \"dictHas('dict_name', id) check the presence of a key in the dictionary. Returns a value of type UInt8, equal to 0, if there is no key and 1 if there is a key.\"\n },\n {\n \"name\": \"arraySum\",\n \"def\": \"arraySum([func,] arr1, ...)\",\n \"docText\": \"Returns the sum of the `func` values. If the function is omitted, it just returns the sum of the array elements.\"\n },\n {\n \"name\": \"emptyArrayDateTime\",\n \"def\": \"emptyArrayDateTime(v)\",\n \"docText\": \"Accepts zero arguments and returns an empty array of the appropriate type.\"\n },\n {\n \"name\": \"intDivOrZero\",\n \"def\": \"intDivOrZero(a, b)\",\n \"docText\": \"Differs from `intDiv` in that it returns zero when dividing by zero or when dividing a minimal negative number by minus one.\"\n },\n {\n \"name\": \"SEHierarchy\",\n \"def\": \"SEHierarchy(v)\",\n \"docText\": \"Accepts a UInt8 number - the ID of the search engine from the Yandex.Metrica dictionary. Returns an array with a hierarchy of search engines. Similar to the `regionHierarchy` function.\"\n },\n {\n \"name\": \"regionToContinent\",\n \"def\": \"regionToContinent(id[, geobase])\",\n \"docText\": \"Converts a region to a continent. In every other way, this function is the same as `regionToCity`. \\n\" +\n \"\\n\" +\n \" Example: `regionToContinent(toUInt32(213)) = 10001` converts Moscow (213) to Eurasia (10001).\"\n },\n {\n \"name\": \"dictGetInt32\",\n \"def\": \"dictGetInt32(v)\",\n \"docText\": \"dictGetT('dict_name', 'attr_name', id) Gets the value of the 'attr_name' attribute from the 'dict_name' dictionary by the 'id' key. 'dict_name' and 'attr_name' are constant strings. 'id' must be UInt64. If the 'id' key is not in the dictionary, it returns the default value set in the dictionary definition.\"\n },\n {\n \"name\": \"toInt8\",\n \"def\": \"toInt8(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"materialize\",\n \"def\": \"materialize(x)\",\n \"docText\": \"Turns a constant into a full column containing just one value. \\n\" +\n \"\\n\" +\n \" In ClickHouse, full columns and constants are represented differently in memory. Functions work differently for constant arguments and normal arguments (different code is executed), although the result is almost always the same. This function is for debugging this behavior.\"\n },\n {\n \"name\": \"regionToCountry\",\n \"def\": \"regionToCountry(id[, geobase])\",\n \"docText\": \"Converts a region to a country. In every other way, this function is the same as `regionToCity`. \\n\" +\n \"\\n\" +\n \" Example: `regionToCountry(toUInt32(213)) = 225` converts Moscow (213) to Russia (225).\"\n },\n {\n \"name\": \"dictGetDateTime\",\n \"def\": \"dictGetDateTime(v)\",\n \"docText\": \"dictGetT('dict_name', 'attr_name', id) Gets the value of the 'attr_name' attribute from the 'dict_name' dictionary by the 'id' key. 'dict_name' and 'attr_name' are constant strings. 'id' must be UInt64. If the 'id' key is not in the dictionary, it returns the default value set in the dictionary definition.\"\n },\n {\n \"name\": \"xor\",\n \"def\": \"xor(v)\",\n \"docText\": \"\"\n },\n {\n \"name\": \"regionToCity\",\n \"def\": \"regionToCity(id[, geobase])\",\n \"docText\": \"Accepts a UInt32 number - the region ID from the Yandex geobase. If this region is a city or part of a city, it returns the region ID for the appropriate city. Otherwise, returns 0.\"\n },\n {\n \"name\": \"dictGetFloat64\",\n \"def\": \"dictGetFloat64(v)\",\n \"docText\": \"dictGetT('dict_name', 'attr_name', id) Gets the value of the 'attr_name' attribute from the 'dict_name' dictionary by the 'id' key. 'dict_name' and 'attr_name' are constant strings. 'id' must be UInt64. If the 'id' key is not in the dictionary, it returns the default value set in the dictionary definition.\"\n },\n {\n \"name\": \"timeSlot\",\n \"def\": \"timeSlot(StartTime, Duration)\",\n \"docText\": \"For a time interval starting at `StartTime` and continuing for `Duration` seconds, it returns an array of moments in time, consisting of points from this interval rounded down to the half hour.\"\n },\n {\n \"name\": \"toTime\",\n \"def\": \"toTime(v)\",\n \"docText\": \"Converts a date with time to the date of the start of the Unix Epoch, while preserving the time.\"\n },\n {\n \"name\": \"log2\",\n \"def\": \"log2(x)\",\n \"docText\": \"Accepts a numeric argument and returns a Float64 number close to the binary logarithm of the argument.\"\n },\n {\n \"name\": \"toRelativeHourNum\",\n \"def\": \"toRelativeHourNum(v)\",\n \"docText\": \"Converts a date with time or date to the number of the hour, starting from a certain fixed point in the past.\"\n },\n {\n \"name\": \"toRelativeDayNum\",\n \"def\": \"toRelativeDayNum(v)\",\n \"docText\": \"Converts a date with time or date to the number of the day, starting from a certain fixed point in the past.\"\n },\n {\n \"name\": \"toRelativeWeekNum\",\n \"def\": \"toRelativeWeekNum(v)\",\n \"docText\": \"Converts a date with time or date to the number of the week, starting from a certain fixed point in the past.\"\n },\n {\n \"name\": \"splitByString\",\n \"def\": \"splitByString(separator, s)\",\n \"docText\": \"The same as above, but it uses a string of multiple characters as the separator. The string must be non-empty.\"\n },\n {\n \"name\": \"currentDatabase\",\n \"def\": \"currentDatabase()\",\n \"docText\": \"Returns the name of the current database. \\n\" +\n \"\\n\" +\n \" You can use this function in table engine parameters in a CREATE TABLE query where you need to specify the database.\"\n },\n {\n \"name\": \"toRelativeMonthNum\",\n \"def\": \"toRelativeMonthNum(v)\",\n \"docText\": \"Converts a date with time or date to the number of the month, starting from a certain fixed point in the past.\"\n },\n {\n \"name\": \"visibleWidth\",\n \"def\": \"visibleWidth(x)\",\n \"docText\": \"Calculates the approximate width when outputting values to the console in text format (tab-separated). This function is used by the system for implementing Pretty formats.\"\n },\n {\n \"name\": \"bitShiftRight\",\n \"def\": \"bitShiftRight(a, b)\",\n \"docText\": \"\"\n },\n {\n \"name\": \"toRelativeYearNum\",\n \"def\": \"toRelativeYearNum(v)\",\n \"docText\": \"Converts a date with time or date to the number of the year, starting from a certain fixed point in the past.\"\n },\n {\n \"name\": \"toStartOfHour\",\n \"def\": \"toStartOfHour(v)\",\n \"docText\": \"Rounds down a date with time to the start of the hour.\"\n },\n {\n \"name\": \"halfMD5\",\n \"def\": \"halfMD5(v)\",\n \"docText\": \"Calculates the MD5 from a string. Then it takes the first 8 bytes of the hash and interprets them as UInt64 in big endian.\"\n },\n {\n \"name\": \"toStartOfFiveMinute\",\n \"def\": \"toStartOfFiveMinute(v)\",\n \"docText\": \"Rounds down a date with time to the start of the 5 minute (00:00, 00:05, 00:10...).\"\n },\n {\n \"name\": \"toUInt16OrZero\",\n \"def\": \"toUInt16OrZero(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument.\"\n },\n {\n \"name\": \"toMonday\",\n \"def\": \"toMonday(v)\",\n \"docText\": \"Rounds down a date or date with time to the nearest Monday. \\n\" +\n \"\\n\" +\n \" Returns the date.\"\n },\n {\n \"name\": \"IPv6NumToString\",\n \"def\": \"IPv6NumToString(x)\",\n \"docText\": \"Accepts a FixedString(16) value containing the IPv6 address in binary format. Returns a string containing this address in text format. \"\n },\n {\n \"name\": \"indexOf\",\n \"def\": \"indexOf(arr, x)\",\n \"docText\": \"Returns the index of the `x` element (starting from 1) if it is in the array, or 0 if it is not.\"\n },\n {\n \"name\": \"today\",\n \"def\": \"today(v)\",\n \"docText\": \"Accepts zero arguments and returns the current date at one of the moments of request execution. \\n\" +\n \"\\n\" +\n \" The same as `toDate(now())`.\"\n },\n {\n \"name\": \"emptyArrayToSingle\",\n \"def\": \"emptyArrayToSingle(v)\",\n \"docText\": \"Accepts an empty array as argument and returns an array of one element equal to the default value.\"\n },\n {\n \"name\": \"sleep\",\n \"def\": \"sleep(seconds)\",\n \"docText\": \"Sleeps `seconds` seconds on each data block. You can specify an integer or a floating-point number.\"\n },\n {\n \"name\": \"extract\",\n \"def\": \"extract(params, name)\",\n \"docText\": \"Parses the string in double quotes. The value is unescaped. If unescaping failed, it returns an empty string. Examples: \"\n },\n {\n \"name\": \"emptyArrayInt8\",\n \"def\": \"emptyArrayInt8(v)\",\n \"docText\": \"Accepts zero arguments and returns an empty array of the appropriate type.\"\n },\n {\n \"name\": \"regionToName\",\n \"def\": \"regionToName(id[, lang])\",\n \"docText\": \"Accepts a UInt32 number - the region ID from the Yandex geobase. A string with the name of the language can be passed as a second argument. Supported languages are: ru, en, ua, uk, by, kz, tr. If the second argument is omitted, the language `ru` is used. \"\n },\n {\n \"name\": \"concat\",\n \"def\": \"concat(arr[, separator])\",\n \"docText\": \"Concatenates strings from the array elements, using `separator` as the separator. \\n\" +\n \"\\n\" +\n \" `separator` is a string constant, an optional parameter. By default it is an empty string. \\n\" +\n \"\\n\" +\n \" Returns a string.\"\n },\n {\n \"name\": \"convertCharset\",\n \"def\": \"convertCharset(s, from, to)\",\n \"docText\": \"Returns a string with the data `s` (encoded as `from` charset) that was converted to the `to` charset.\"\n },\n {\n \"name\": \"toMonth\",\n \"def\": \"toMonth(v)\",\n \"docText\": \"Converts a date or date with time to a UInt8 number containing the month number (1-12).\"\n },\n {\n \"name\": \"IPv6StringToNum\",\n \"def\": \"IPv6StringToNum(s)\",\n \"docText\": \"The reverse function of IPv6NumToString. If the IPv6 address has an invalid format, it returns a string of null bytes. \\n\" +\n \"\\n\" +\n \" HEX can be uppercase or lowercase.\"\n },\n {\n \"name\": \"emptyArrayString\",\n \"def\": \"emptyArrayString(v)\",\n \"docText\": \"Accepts zero arguments and returns an empty array of the appropriate type.\"\n },\n {\n \"name\": \"uptime\",\n \"def\": \"uptime()\",\n \"docText\": \"Returns server's uptime in seconds.\"\n },\n {\n \"name\": \"blockSize\",\n \"def\": \"blockSize()\",\n \"docText\": \"Gets the size of the block. \\n\" +\n \"\\n\" +\n \" In ClickHouse, queries are always run on blocks (sets of column parts). This function allows getting the size of the block that you called it for.\"\n },\n {\n \"name\": \"toInt64OrZero\",\n \"def\": \"toInt64OrZero(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"pathFull\",\n \"def\": \"pathFull(v)\",\n \"docText\": \"Selects the path, but including query-string and fragment. Example: /top/news.html?page=2#comments\"\n },\n {\n \"name\": \"emptyArrayDate\",\n \"def\": \"emptyArrayDate(v)\",\n \"docText\": \"Accepts zero arguments and returns an empty array of the appropriate type.\"\n },\n {\n \"name\": \"emptyArrayInt64\",\n \"def\": \"emptyArrayInt64(v)\",\n \"docText\": \"Accepts zero arguments and returns an empty array of the appropriate type.\"\n },\n {\n \"name\": \"toInt32OrZero\",\n \"def\": \"toInt32OrZero(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"greater\",\n \"def\": \"greater(v)\",\n \"docText\": \"\"\n },\n {\n \"name\": \"emptyArrayInt32\",\n \"def\": \"emptyArrayInt32(v)\",\n \"docText\": \"Accepts zero arguments and returns an empty array of the appropriate type.\"\n },\n {\n \"name\": \"toString\",\n \"def\": \"toString(str)\",\n \"docText\": \"Accepts a FixedString(16) value containing the UUID in the binary format. Returns a readable string containing the UUID in the text format.\"\n },\n {\n \"name\": \"greatest\",\n \"def\": \"greatest(a, b)\",\n \"docText\": \"Returns the greatest element of a and b.\"\n },\n {\n \"name\": \"emptyArrayUInt64\",\n \"def\": \"emptyArrayUInt64(v)\",\n \"docText\": \"Accepts zero arguments and returns an empty array of the appropriate type.\"\n },\n {\n \"name\": \"emptyArrayUInt32\",\n \"def\": \"emptyArrayUInt32(v)\",\n \"docText\": \"Accepts zero arguments and returns an empty array of the appropriate type.\"\n },\n {\n \"name\": \"formatReadableSize\",\n \"def\": \"formatReadableSize(x)\",\n \"docText\": \"Gets a size (number of bytes). Returns a string that contains rounded size with the suffix (KiB, MiB etc.).\\n\" +\n \"\\n\" +\n \"Example:\\n\" +\n \"\\n\" +\n \"SELECT\\n\" +\n \" arrayJoin([1, 1024, 1024*1024, 192851925]) AS f_bytes,\\n\" +\n \" formatReadableSize(filesize_bytes) AS filesize\\n\" +\n \"┌─f_bytes-─┬─filesize───┐\\n\" +\n \"│ 1 │ 1.00 B │\\n\" +\n \"│ 1024 │ 1.00 KiB │\\n\" +\n \"│ 1048576 │ 1.00 MiB │\\n\" +\n \"│192851925 │ 183.92 MiB │\\n\" +\n \"└──────────┴────────────┘\\n\"\n },\n {\n \"name\": \"toInt16OrZero\",\n \"def\": \"toInt16OrZero(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"emptyArrayUInt8\",\n \"def\": \"emptyArrayUInt8(v)\",\n \"docText\": \"Accepts zero arguments and returns an empty array of the appropriate type.\"\n },\n {\n \"name\": \"protocol\",\n \"def\": \"protocol(v)\",\n \"docText\": \"Selects the protocol. Examples: http, ftp, mailto, magnet...\"\n },\n {\n \"name\": \"regionToPopulation\",\n \"def\": \"regionToPopulation(id[, geobase])\",\n \"docText\": \"Gets the population for a region. \\n\" +\n \"\\n\" +\n \" The population can be recorded in files with the geobase. See the section `External dictionaries`. \\n\" +\n \"\\n\" +\n \" If the population is not recorded for the region, it returns 0. \\n\" +\n \"\\n\" +\n \" In the Yandex geobase, the population might be recorded for child regions, but not for parent regions.\"\n },\n {\n \"name\": \"notIn\",\n \"def\": \"notIn(v)\",\n \"docText\": \"See the section `IN operators`.\"\n },\n {\n \"name\": \"position\",\n \"def\": \"position(haystack, needle)\",\n \"docText\": \"The same as `position`, but the position is returned in Unicode code points. Works under the assumption that the string contains a set of bytes representing a UTF-8 encoded text. If this assumption is not met, it returns some result (it doesn`t throw an exception). \\n\" +\n \"\\n\" +\n \" There's also positionCaseInsensitiveUTF8 function.\"\n },\n {\n \"name\": \"arrayElement\",\n \"def\": \"arrayElement(arr, n), arr[n] operator\",\n \"docText\": \"Get the element with the index `n` from the array `arr`. \\n\" +\n \"\\n\" +\n \" `n` should be any integer type. \\n\" +\n \"\\n\" +\n \" Indexes in an array begin from one. \\n\" +\n \"\\n\" +\n \" Negative indexes are supported - in this case, it selects the corresponding element numbered from the end. \"\n },\n {\n \"name\": \"toStringCutToZero\",\n \"def\": \"toStringCutToZero(s)\",\n \"docText\": \"Accepts a String or FixedString argument. Returns a String that is cut to a first null byte occurrence.\"\n },\n {\n \"name\": \"log\",\n \"def\": \"log(x)\",\n \"docText\": \"Accepts a numeric argument and returns a Float64 number close to the decimal logarithm of the argument.\"\n },\n {\n \"name\": \"SEIn\",\n \"def\": \"SEIn(lhs, rhs)\",\n \"docText\": \"Checks whether the `lhs` search engine belongs to the `rhs` search engine.\"\n },\n {\n \"name\": \"replicate\",\n \"def\": \"replicate(v)\",\n \"docText\": \"Create a MergeTree table with a different name. Move all the data from the directory with the ReplicatedMergeTree table data to the new table`s data directory.\"\n },\n {\n \"name\": \"sipHash64\",\n \"def\": \"sipHash64(v)\",\n \"docText\": \"Calculates SipHash from a string. \\n\" +\n \"\\n\" +\n \" Accepts a String-type argument. Returns UInt64. \\n\" +\n \"\\n\" +\n \" SipHash is a cryptographic hash function. It works at least three times faster than MD5. For more information, see https://131002.net/siphash/\"\n },\n {\n \"name\": \"emptyArrayUInt16\",\n \"def\": \"emptyArrayUInt16(v)\",\n \"docText\": \"Accepts zero arguments and returns an empty array of the appropriate type.\"\n },\n {\n \"name\": \"hex\",\n \"def\": \"hex(str)\",\n \"docText\": \"Accepts a string containing any number of hexadecimal digits, and returns a string containing the corresponding bytes. Supports both uppercase and lowercase letters A-F. The number of hexadecimal digits doesn`t have to be even.\"\n },\n {\n \"name\": \"regionToDistrict\",\n \"def\": \"regionToDistrict(id[, geobase])\",\n \"docText\": \"Converts a region to a federal district (type 4 in the geobase). In every other way, this function is the same as `regionToCity`. \"\n },\n {\n \"name\": \"arrayFilter\",\n \"def\": \"arrayFilter(func, arr1, ...)\",\n \"docText\": \"Returns an array containing only the elements in `arr1` for which `func` returns something other than 0. \\n\" +\n \"\\n\" +\n \" Examples: \\n\" +\n \"\\n\" +\n \" SELECT arrayFilter(x -> x LIKE `%World%`, [`Hello`, `abc World`]) AS res \"\n },\n {\n \"name\": \"toStartOfQuarter\",\n \"def\": \"toStartOfQuarter(v)\",\n \"docText\": \"Rounds down a date or date with time to the first day of the quarter. \\n\" +\n \"\\n\" +\n \" The first day of the quarter is either 1 January, 1 April, 1 July, or 1 October. Returns the date.\"\n },\n {\n \"name\": \"divide\",\n \"def\": \"divide(a, b), a / b operator\",\n \"docText\": \"Calculates the quotient of the numbers. The result type is always a floating-point type. \\n\" +\n \"\\n\" +\n \" It is not integer division. For integer division, use the `intDiv` function. \\n\" +\n \"\\n\" +\n \" When dividing by zero you get `inf`, `-inf`, or `nan`.\"\n },\n {\n \"name\": \"reverseUTF8\",\n \"def\": \"reverseUTF8(v)\",\n \"docText\": \"Reverses a sequence of Unicode code points, assuming that the string contains a set of bytes representing a UTF-8 text. Otherwise, it does something else (it doesn`t throw an exception).\"\n },\n {\n \"name\": \"toDate\",\n \"def\": \"toDate(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"emptyArrayFloat64\",\n \"def\": \"emptyArrayFloat64(v)\",\n \"docText\": \"Accepts zero arguments and returns an empty array of the appropriate type.\"\n },\n {\n \"name\": \"abs\",\n \"def\": \"abs(s, c)\",\n \"docText\": \"If the `s` string is non-empty and does not contain the `c` character at the end, it appends the `c` character to the end.\"\n },\n {\n \"name\": \"yesterday\",\n \"def\": \"yesterday(v)\",\n \"docText\": \"Accepts zero arguments and returns yesterday`s date at one of the moments of request execution. \\n\" +\n \"\\n\" +\n \" The same as `today() - 1`.\"\n },\n {\n \"name\": \"toMinute\",\n \"def\": \"toMinute(v)\",\n \"docText\": \"Converts a date with time to a UInt8 number containing the number of the minute of the hour (0-59).\"\n },\n {\n \"name\": \"bitXor\",\n \"def\": \"bitXor(a, b)\",\n \"docText\": \"\"\n },\n {\n \"name\": \"minus\",\n \"def\": \"minus(a, b), a - b operator\",\n \"docText\": \"Calculates the difference. The result is always signed. \\n\" +\n \"\\n\" +\n \" You can also calculate whole numbers from a date or date with time. The idea is the same - see above for `plus`.\"\n },\n {\n \"name\": \"toDateTime\",\n \"def\": \"toDateTime(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"modulo\",\n \"def\": \"modulo(a, b), a % b operator\",\n \"docText\": \"Calculates the remainder after division. \\n\" +\n \"\\n\" +\n \" If arguments are floating-point numbers, they are pre-converted to integers by dropping the decimal portion. The remainder is taken in the same sense as in C++. Truncated division is used for negative numbers. \\n\" +\n \"\\n\" +\n \" An exception is thrown when dividing by zero or when dividing a minimal negative number by minus one.\"\n },\n {\n \"name\": \"bitmaskToArray\",\n \"def\": \"bitmaskToArray(num)\",\n \"docText\": \"Accepts an integer. Returns an array of UInt64 numbers containing the list of powers of two that total the source number when summed. Numbers in the array are in ascending order.\"\n },\n {\n \"name\": \"negate\",\n \"def\": \"negate(a), -a operator\",\n \"docText\": \"Calculates a number with the reverse sign. The result is always signed.\"\n },\n {\n \"name\": \"emptyArrayFloat32\",\n \"def\": \"emptyArrayFloat32(v)\",\n \"docText\": \"Accepts zero arguments and returns an empty array of the appropriate type.\"\n },\n {\n \"name\": \"range\",\n \"def\": \"range(N)\",\n \"docText\": \"Returns an array of numbers from 0 to N-1. \\n\" +\n \"\\n\" +\n \" Just in case, an exception is thrown if arrays with a total length of more than 100,000,000 elements are created in a data block.\"\n },\n {\n \"name\": \"arrayAll\",\n \"def\": \"arrayAll([func,] arr1, ...)\",\n \"docText\": \"Returns 1 if `func` returns something other than 0 for all the elements in `arr`. Otherwise, it returns 0.\"\n },\n {\n \"name\": \"toInt32\",\n \"def\": \"toInt32(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"unhex\",\n \"def\": \"unhex(str)\",\n \"docText\": \"Accepts a string containing any number of hexadecimal digits, and returns a string containing the corresponding bytes. Supports both uppercase and lowercase letters A-F. The number of hexadecimal digits doesn`t have to be even. If it is odd, the last digit is interpreted as the younger half of the 00-0F byte. If the argument string contains anything other than hexadecimal digits, some implementation-defined result is returned (an exception isn`t thrown). \\n\" +\n \"\\n\" +\n \" If you want to convert the result to a number, you can use the functions `reverse` and `reinterpretAsType`.\"\n },\n {\n \"name\": \"toFloat64\",\n \"def\": \"toFloat64(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"bitAnd\",\n \"def\": \"bitAnd(a, b)\",\n \"docText\": \"\"\n },\n {\n \"name\": \"toStartOfYear\",\n \"def\": \"toStartOfYear(v)\",\n \"docText\": \"Rounds down a date or date with time to the first day of the year. \\n\" +\n \"\\n\" +\n \" Returns the date.\"\n },\n {\n \"name\": \"bitOr\",\n \"def\": \"bitOr(a, b)\",\n \"docText\": \"\"\n },\n {\n \"name\": \"SEToRoot\",\n \"def\": \"SEToRoot(v)\",\n \"docText\": \"Accepts a UInt8 number - the ID of the search engine from the Yandex.Metrica dictionary. If any search engine matches the passed number, it returns a UInt8 number - the ID of the corresponding root search engine (for example, it converts Yandex.Images to Yandex). Otherwise, returns 0.\"\n },\n {\n \"name\": \"toRelativeMinuteNum\",\n \"def\": \"toRelativeMinuteNum(v)\",\n \"docText\": \"Converts a date with time or date to the number of the minute, starting from a certain fixed point in the past.\"\n },\n {\n \"name\": \"visitParamExtractInt\",\n \"def\": \"visitParamExtractInt(params, name)\",\n \"docText\": \"The same as for Int64.\"\n },\n {\n \"name\": \"emptyArrayInt16\",\n \"def\": \"emptyArrayInt16(v)\",\n \"docText\": \"Accepts zero arguments and returns an empty array of the appropriate type.\"\n },\n {\n \"name\": \"visitParamExtractString\",\n \"def\": \"visitParamExtractString(params, name)\",\n \"docText\": \"Parses the string in double quotes. The value is unescaped. If unescaping failed, it returns an empty string. \"\n },\n {\n \"name\": \"arrayEnumerateUniq\",\n \"def\": \"arrayEnumerateUniq(arr, ...)\",\n \"docText\": \"Returns an array the same size as the source array, indicating for each element what its position is among elements with the same value. \"\n },\n {\n \"name\": \"visitParamExtractUInt\",\n \"def\": \"visitParamExtractUInt(params, name)\",\n \"docText\": \"Parses UInt64 from the value of the field named `name`. If this is a string field, it tries to parse a number from the beginning of the string. If the field doesn`t exist, or it exists but doesn`t contain a number, it returns 0.\"\n },\n {\n \"name\": \"toTypeName\",\n \"def\": \"toTypeName(x)\",\n \"docText\": \"Gets the type name. Returns a string containing the type name of the passed argument.\"\n },\n {\n \"name\": \"empty\",\n \"def\": \"empty(v)\",\n \"docText\": \"Accepts an empty array as argument and returns an array of one element equal to the default value.\"\n },\n {\n \"name\": \"multiply\",\n \"def\": \"multiply(a, b), a * b operator\",\n \"docText\": \"Calculates the product of the numbers.\"\n },\n {\n \"name\": \"has\",\n \"def\": \"has('database', 'table', 'column')\",\n \"docText\": \"Accepts constant String columns - database name, table name and column name. Returns constant UInt8 value, equal to 1 if column exists, otherwise 0.\\n\" +\n \"\\n\" +\n \" If table doesn't exist than exception is thrown. \\n\" +\n \"\\n\" +\n \" For elements of nested data structure function checks existence of column. For nested data structure 0 is returned.\"\n },\n {\n \"name\": \"bitNot\",\n \"def\": \"bitNot(a)\",\n \"docText\": \"\"\n },\n {\n \"name\": \"lessOrEquals\",\n \"def\": \"lessOrEquals(v)\",\n \"docText\": \"greaterOrEquals, >= operator\"\n },\n {\n \"name\": \"reinterpretAsInt64\",\n \"def\": \"reinterpretAsInt64(v)\",\n \"docText\": \"Functions accept a string and interpret the bytes placed at the beginning of the string as a number in host order (little endian). If the string isn't long enough, the functions work as if the string is padded with the necessary number of null bytes. If the string is longer than needed, the extra bytes are ignored. A date is interpreted as the number of days since the beginning of the Unix Epoch, and a date with time is interpreted as the number of seconds since the beginning of the Unix Epoch.\"\n },\n {\n \"name\": \"IPv4NumToString\",\n \"def\": \"IPv4NumToString(num)\",\n \"docText\": \"Similar to IPv4NumToString, but using `xxx` instead of the last octet. \"\n },\n {\n \"name\": \"bitShiftLeft\",\n \"def\": \"bitShiftLeft(a, b)\",\n \"docText\": \"\"\n },\n {\n \"name\": \"dictGetInt16\",\n \"def\": \"dictGetInt16(v)\",\n \"docText\": \"dictGetT('dict_name', 'attr_name', id) Gets the value of the 'attr_name' attribute from the 'dict_name' dictionary by the 'id' key. 'dict_name' and 'attr_name' are constant strings. 'id' must be UInt64. If the 'id' key is not in the dictionary, it returns the default value set in the dictionary definition.\"\n },\n {\n \"name\": \"toUInt32OrZero\",\n \"def\": \"toUInt32OrZero(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"regionIn\",\n \"def\": \"regionIn(lhs, rhs[, geobase])\",\n \"docText\": \"Checks whether a `lhs` region belongs to a `rhs` region. Returns a UInt8 number equal to 1 if it belongs, or 0 if it doesn`t belong. \\n\" +\n \"\\n\" +\n \" The relationship is reflexive - any region also belongs to itself.\"\n },\n {\n \"name\": \"reinterpretAsUInt8\",\n \"def\": \"reinterpretAsUInt8(v)\",\n \"docText\": \"Functions accept a string and interpret the bytes placed at the beginning of the string as a number in host order (little endian). If the string isn't long enough, the functions work as if the string is padded with the necessary number of null bytes. If the string is longer than needed, the extra bytes are ignored. A date is interpreted as the number of days since the beginning of the Unix Epoch, and a date with time is interpreted as the number of seconds since the beginning of the Unix Epoch.\"\n },\n {\n \"name\": \"dictIsIn\",\n \"def\": \"dictIsIn(v)\",\n \"docText\": \"`dictIsIn(`dict_name`, child_id, ancestor_id)` \\n\" +\n \"\\n\" +\n \" - For the `dict_name` hierarchical dictionary, finds out whether the `child_id` key is located inside `ancestor_id` (or matches `ancestor_id`). Returns UInt8.\"\n },\n {\n \"name\": \"toSecond\",\n \"def\": \"toSecond(v)\",\n \"docText\": \"Converts a date with time to a UInt8 number containing the number of the second in the minute (0-59). \\n\" +\n \"\\n\" +\n \" Leap seconds are not accounted for.\"\n },\n {\n \"name\": \"least\",\n \"def\": \"least(a, b)\",\n \"docText\": \"Returns the least element of a and b.\"\n },\n {\n \"name\": \"countEqual\",\n \"def\": \"countEqual(arr, x)\",\n \"docText\": \"Returns the number of elements in the array equal to `x`. Equivalent to arrayCount(elem -> elem = x, arr).\"\n },\n {\n \"name\": \"IPv4StringToNum\",\n \"def\": \"IPv4StringToNum(s)\",\n \"docText\": \"The reverse function of IPv4NumToString. If the IPv4 address has an invalid format, it returns 0.\"\n },\n {\n \"name\": \"replaceRegexpAll\",\n \"def\": \"replaceRegexpAll(haystack, pattern, replacement)\",\n \"docText\": \"This does the same thing, but replaces all the occurrences\"\n },\n {\n \"name\": \"SHA224\",\n \"def\": \"SHA224(v)\",\n \"docText\": \"Calculates SHA-1, SHA-224, or SHA-256 from a string and returns the resulting set of bytes as FixedString(20), FixedString(28), or FixedString(32). \\n\" +\n \"\\n\" +\n \" The function works fairly slowly (SHA-1 processes about 5 million short strings per second per processor core, while SHA-224 and SHA-256 process about 2.2 million). \"\n },\n {\n \"name\": \"URLHash\",\n \"def\": \"URLHash(url[, N])\",\n \"docText\": \"A fast, decent-quality non-cryptographic hash function for a string obtained from a URL using some type of normalization. \\n\" +\n \"\\n\" +\n \" URLHash(s) - Calculates a hash from a string without one of the trailing symbols /,? or # at the end, if present\"\n },\n {\n \"name\": \"equals\",\n \"def\": \"equals(v)\",\n \"docText\": \"

greaterOrEquals, >= operator

\"\n },\n {\n \"name\": \"plus\",\n \"def\": \"plus(a, b), a + b operator\",\n \"docText\": \"Calculates the sum of the numbers. \\n\" +\n \"\\n\" +\n \" You can also add whole numbers with a date or date and time. In the case of a date, adding a whole number means adding the corresponding number of days. For a date with time, it means adding the corresponding number of seconds.\"\n },\n {\n \"name\": \"less\",\n \"def\": \"less(v)\",\n \"docText\": \"

greaterOrEquals, >= operator

\"\n },\n {\n \"name\": \"regionHierarchy\",\n \"def\": \"regionHierarchy(id[, geobase])\",\n \"docText\": \"Accepts a UInt32 number - the region ID from the Yandex geobase. Returns an array of region IDs consisting of the passed region and all parents along the chain. \\n\" +\n \"\\n\" +\n \" Example: `regionHierarchy(toUInt32(213)) = [213,1,3,225,10001,10000]`.\"\n },\n {\n \"name\": \"toUInt64OrZero\",\n \"def\": \"toUInt64OrZero(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"rowNumberInAllBlocks\",\n \"def\": \"rowNumberInAllBlocks()\",\n \"docText\": \"Returns an incremental row number within all blocks that were processed by this function.\"\n },\n {\n \"name\": \"toDayOfWeek\",\n \"def\": \"toDayOfWeek(v)\",\n \"docText\": \"Converts a date or date with time to a UInt8 number containing the number of the day of the week (Monday is 1, and Sunday is 7).\"\n },\n {\n \"name\": \"bar\",\n \"def\": \"bar(v)\",\n \"docText\": \"Allows building a unicode-art diagram. \\n\" +\n \"\\n\" +\n \" bar(x, min, max, width) - Draws a band with a width proportional to (x - min) and equal to `width` characters when x\"\n },\n {\n \"name\": \"if\",\n \"def\": \"if(v)\",\n \"docText\": \"The suffix -`If` can be appended to the name of any aggregate function. In this case, the aggregate function accepts an extra argument - a condition (Uint8 type). \"\n },\n {\n \"name\": \"regionToArea\",\n \"def\": \"regionToArea(id[, geobase])\",\n \"docText\": \"Converts a region to an area (type 5 in the geobase). In every other way, this function is the same as `regionToCity`.\"\n },\n {\n \"name\": \"dictGetUInt16\",\n \"def\": \"dictGetUInt16(v)\",\n \"docText\": \"dictGetT('dict_name', 'attr_name', id) Gets the value of the 'attr_name' attribute from the 'dict_name' dictionary by the 'id' key. 'dict_name' and 'attr_name' are constant strings. 'id' must be UInt64. If the 'id' key is not in the dictionary, it returns the default value set in the dictionary definition.\"\n },\n {\n \"name\": \"toUInt8\",\n \"def\": \"toUInt8(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"toUInt16\",\n \"def\": \"toUInt16(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"path\",\n \"def\": \"path(URL)\",\n \"docText\": \"- The same thing, but without the protocol and host in the result. The / element (root) is not included.\"\n },\n {\n \"name\": \"extractURLParameters\",\n \"def\": \"extractURLParameters(URL)\",\n \"docText\": \"- Gets an array of name=value strings corresponding to the URL parameters. The values are not decoded in any way.\"\n },\n {\n \"name\": \"OSHierarchy\",\n \"def\": \"OSHierarchy(v)\",\n \"docText\": \"Accepts a UInt8 number - the ID of the operating system from the Yandex.Metrica dictionary. Returns an array with a hierarchy of operating systems. Similar to the `regionHierarchy` function.\"\n },\n {\n \"name\": \"cutQueryStringAndFragment\",\n \"def\": \"cutQueryStringAndFragment(v)\",\n \"docText\": \"Removes the query-string and fragment identifier. The question mark and number sign are also removed.\"\n },\n {\n \"name\": \"timeSlots\",\n \"def\": \"timeSlots(StartTime, Duration)\",\n \"docText\": \"For a time interval starting at `StartTime` and continuing for `Duration` seconds, it returns an array of moments in time, consisting of points from this interval rounded down to the half hour. \\n\" +\n \"\\n\" +\n \" For example, `timeSlots(toDateTime(`2012-01-01 12:20:00`), toUInt32(600)) = [toDateTime(`2012-01-01 12:00:00`), toDateTime(`2012-01-01 12:30:00`)]`. \\n\" +\n \"\\n\" +\n \" This is necessary for searching for pageviews in the corresponding session.\"\n },\n {\n \"name\": \"toUInt32\",\n \"def\": \"toUInt32(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"toStartOfMinute\",\n \"def\": \"toStartOfMinute(v)\",\n \"docText\": \"Rounds down a date with time to the start of the minute.\"\n },\n {\n \"name\": \"version\",\n \"def\": \"version()\",\n \"docText\": \"Returns server's version as a string.\"\n },\n {\n \"name\": \"toUInt64\",\n \"def\": \"toUInt64(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"toInt16\",\n \"def\": \"toInt16(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"reinterpretAsInt16\",\n \"def\": \"reinterpretAsInt16(v)\",\n \"docText\": \"Functions accept a string and interpret the bytes placed at the beginning of the string as a number in host order (little endian). If the string isn't long enough, the functions work as if the string is padded with the necessary number of null bytes. If the string is longer than needed, the extra bytes are ignored. A date is interpreted as the number of days since the beginning of the Unix Epoch, and a date with time is interpreted as the number of seconds since the beginning of the Unix Epoch.\"\n },\n {\n \"name\": \"toInt64\",\n \"def\": \"toInt64(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"toFixedString\",\n \"def\": \"toFixedString(s, N)\",\n \"docText\": \"Converts a String type argument to a FixedString(N) type (a string with fixed length N). N must be a constant. If the string has fewer bytes than N, it is passed with null bytes to the right. If the string has more bytes than N, an exception is thrown.\"\n },\n {\n \"name\": \"toFloat32\",\n \"def\": \"toFloat32(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"dictGetHierarchy\",\n \"def\": \"dictGetHierarchy(v)\",\n \"docText\": \"`dictGetHierarchy(`dict_name`, id)` \\n\" +\n \"\\n\" +\n \" - For the `dict_name` hierarchical dictionary, returns an array of dictionary keys starting from `id` and continuing along the chain of parent elements. Returns Array(UInt64).\"\n },\n {\n \"name\": \"dictGetInt64\",\n \"def\": \"dictGetInt64(v)\",\n \"docText\": \"dictGetT('dict_name', 'attr_name', id) Gets the value of the 'attr_name' attribute from the 'dict_name' dictionary by the 'id' key. 'dict_name' and 'attr_name' are constant strings. 'id' must be UInt64. If the 'id' key is not in the dictionary, it returns the default value set in the dictionary definition.\"\n },\n {\n \"name\": \"CAST\",\n \"def\": \"CAST(x, t)\",\n \"docText\": \"Casts `x` to the `t` data type. \\n\" +\n \"\\n\" +\n \" The syntax `CAST(x AS t)` is also supported. \\n\"\n },\n {\n \"name\": \"toRelativeSecondNum\",\n \"def\": \"toRelativeSecondNum(v)\",\n \"docText\": \"Converts a date with time or date to the number of the second, starting from a certain fixed point in the past.\"\n },\n {\n \"name\": \"toUInt8OrZero\",\n \"def\": \"toUInt8OrZero(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"toStartOfMonth\",\n \"def\": \"toStartOfMonth(v)\",\n \"docText\": \"Rounds down a date or date with time to the first day of the month. \\n\" +\n \"\\n\" +\n \" Returns the date.\"\n },\n {\n \"name\": \"rand64\",\n \"def\": \"rand64(v)\",\n \"docText\": \"Returns a pseudo-random UInt64 number, evenly distributed among all UInt64-type numbers. \\n\" +\n \"\\n\" +\n \" Uses a linear congruential generator.\"\n },\n {\n \"name\": \"toInt8OrZero\",\n \"def\": \"toInt8OrZero(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"toFloat32OrZero\",\n \"def\": \"toFloat32OrZero(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"toYear\",\n \"def\": \"toYear(v)\",\n \"docText\": \"Converts a date or date with time to a UInt16 number containing the year number (AD).\"\n },\n {\n \"name\": \"atan\",\n \"def\": \"atan(x)\",\n \"docText\": \"The arc tangent.\"\n },\n {\n \"name\": \"toFloat64OrZero\",\n \"def\": \"toFloat64OrZero(v)\",\n \"docText\": \"Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times. All these functions accept one argument. \"\n },\n {\n \"name\": \"arrayEnumerate\",\n \"def\": \"arrayEnumerate(arr, ...)\",\n \"docText\": \"Returns an array the same size as the source array, indicating for each element what its position is among elements with the same value.\"\n },\n {\n \"name\": \"toDayOfMonth\",\n \"def\": \"toDayOfMonth(v)\",\n \"docText\": \"Converts a date or date with time to a UInt8 number containing the number of the day of the month (1-31).\"\n },\n {\n \"name\": \"dictGetUInt64\",\n \"def\": \"dictGetUInt64(v)\",\n \"docText\": \"dictGetT('dict_name', 'attr_name', id) Gets the value of the 'attr_name' attribute from the 'dict_name' dictionary by the 'id' key. 'dict_name' and 'attr_name' are constant strings. 'id' must be UInt64. If the 'id' key is not in the dictionary, it returns the default value set in the dictionary definition.\"\n },\n {\n \"name\": \"IPv4NumToStringClassC\",\n \"def\": \"IPv4NumToStringClassC(num)\",\n \"docText\": \"Similar to IPv4NumToString, but using `xxx` instead of the last octet. \"\n },\n {\n \"name\": \"reinterpretAsString\",\n \"def\": \"reinterpretAsString(v)\",\n \"docText\": \"This function accepts a number or date or date with time, and returns a string containing bytes representing the corresponding value in host order (little endian). Null bytes are dropped from the end. For example, a UInt32 type value of 255 is a string that is one byte long.\"\n },\n {\n \"name\": \"toHour\",\n \"def\": \"toHour(v)\",\n \"docText\": \"Converts a date with time to a UInt8 number containing the number of the hour in 24-hour time (0-23). \\n\" +\n \"\\n\" +\n \" This function assumes that if clocks are moved ahead, it is by one hour and occurs at 2 a.m., and if clocks are moved back, it is by one hour and occurs at 3 a.m. (which is not always true - even in Moscow the clocks were once changed at a different time).\"\n },\n {\n \"name\": \"ignore\",\n \"def\": \"ignore(...)\",\n \"docText\": \"A function that accepts any arguments and always returns 0. \\n\" +\n \"\\n\" +\n \" However, the argument is still calculated. This can be used for benchmarks.\"\n },\n {\n \"name\": \"arrayJoin\",\n \"def\": \"arrayJoin(v)\",\n \"docText\": \"This is a very unusual function.\\n\" +\n \"\\n\" +\n \"Normal functions don't change a set of rows, but just change the values in each row (map). Aggregate functions compress a set of rows (fold or reduce). The 'arrayJoin' function takes each row and generates a set of rows (unfold).\\n\" +\n \"\\n\" +\n \"This function takes an array as an argument, and propagates the source row to multiple rows for the number of elements in the array. All the values in columns are simply copied, except the values in the column where this function is applied - it is replaced with the corresponding array value.\\n\" +\n \"\\n\" +\n \"A query can use multiple 'arrayJoin' functions. In this case, the transformation is performed multiple times.\\n\" +\n \"\\n\" +\n \"Note the ARRAY JOIN syntax in the SELECT query, which provides broader possibilities.\"\n },\n {\n \"name\": \"length\",\n \"def\": \"length(v)\",\n \"docText\": \"Returns the length of a string in Unicode code points (not in characters), assuming that the string contains a set of bytes that make up UTF-8 encoded text. If this assumption is not met, it returns some result (it doesn`t throw an exception). \\n\" +\n \"\\n\" +\n \" The result type is UInt64.\"\n },\n {\n \"name\": \"tuple\",\n \"def\": \"tuple(tuple, n), operator x.N\",\n \"docText\": \"A function that allows getting columns from a tuple. \\n\" +\n \"\\n\" +\n \" `N` is the column index, starting from 1. `N` must be a constant. `N` must be a strict postive integer no greater than the size of the tuple. \\n\" +\n \"\\n\" +\n \" There is no cost to execute the function.\"\n },\n {\n \"name\": \"extractURLParameterNames\",\n \"def\": \"extractURLParameterNames(URL)\",\n \"docText\": \"- Gets an array of name=value strings corresponding to the names of URL parameters. The values are not decoded in any way.\"\n },\n {\n \"name\": \"tupleElement\",\n \"def\": \"tupleElement(tuple, n), operator x.N\",\n \"docText\": \"A function that allows getting columns from a tuple. \\n\" +\n \"\\n\" +\n \" `N` is the column index, starting from 1. `N` must be a constant. `N` must be a strict postive integer no greater than the size of the tuple. \\n\" +\n \"\\n\" +\n \" There is no cost to execute the function.\"\n },\n {\n \"name\": \"in\",\n \"def\": \"in(v)\",\n \"docText\": \"What to do when the amount of data exceeds one of the limits: `throw` or `break`. By default, throw.\"\n },\n {\n \"name\": \"globalIn\",\n \"def\": \"globalIn(v)\",\n \"docText\": \"See the section `IN operators`.\"\n },\n {\n \"name\": \"isFinite\",\n \"def\": \"isFinite(x)\",\n \"docText\": \"Accepts Float32 and Float64 and returns UInt8 equal to 1 if the argument is not infinite and not a NaN, otherwise 0.\"\n },\n {\n \"name\": \"isNaN\",\n \"def\": \"isNaN(x)\",\n \"docText\": \"Accepts Float32 and Float64 and returns UInt8 equal to 1 if the argument is a NaN, otherwise 0.\"\n },\n {\n \"name\": \"isInfinite\",\n \"def\": \"isInfinite(x)\",\n \"docText\": \"Accepts Float32 and Float64 and returns UInt8 equal to 1 if the argument is infinite, otherwise 0. \\n\" +\n \"\\n\" +\n \" Note that 0 is returned for a NaN.\"\n },\n {\n \"name\": \"transform\",\n \"def\": \"transform(v)\",\n \"docText\": \"Transforms a value according to the explicitly defined mapping of some elements to other ones. \\n\" +\n \"\\n\" +\n \" There are two variations of this function: \\n\" +\n \"\\n\" +\n \" 1. `transform(x, array_from, array_to, default)` \"\n },\n {\n \"name\": \"rand\",\n \"def\": \"rand(v)\",\n \"docText\": \"Returns a pseudo-random UInt64 number, evenly distributed among all UInt64-type numbers. \\n\" +\n \"\\n\" +\n \" Uses a linear congruential generator.\"\n },\n {\n \"name\": \"reinterpretAsUInt16\",\n \"def\": \"reinterpretAsUInt16(v)\",\n \"docText\": \"Functions accept a string and interpret the bytes placed at the beginning of the string as a number in host order (little endian). If the string isn't long enough, the functions work as if the string is padded with the necessary number of null bytes. If the string is longer than needed, the extra bytes are ignored. A date is interpreted as the number of days since the beginning of the Unix Epoch, and a date with time is interpreted as the number of seconds since the beginning of the Unix Epoch.\"\n },\n {\n \"name\": \"pi\",\n \"def\": \"pi(v)\",\n \"docText\": \"Maximum pipeline depth. Corresponds to the number of transformations that each data block goes through during query processing. Counted within the limits of a single server. If the pipeline depth is greater, an exception is thrown. By default, 1000.\"\n },\n {\n \"name\": \"reinterpretAsUInt32\",\n \"def\": \"reinterpretAsUInt32(v)\",\n \"docText\": \"Functions accept a string and interpret the bytes placed at the beginning of the string as a number in host order (little endian). If the string isn't long enough, the functions work as if the string is padded with the necessary number of null bytes. If the string is longer than needed, the extra bytes are ignored. A date is interpreted as the number of days since the beginning of the Unix Epoch, and a date with time is interpreted as the number of seconds since the beginning of the Unix Epoch.\"\n },\n {\n \"name\": \"reinterpretAsUInt64\",\n \"def\": \"reinterpretAsUInt64(v)\",\n \"docText\": \"Functions accept a string and interpret the bytes placed at the beginning of the string as a number in host order (little endian). If the string isn't long enough, the functions work as if the string is padded with the necessary number of null bytes. If the string is longer than needed, the extra bytes are ignored. A date is interpreted as the number of days since the beginning of the Unix Epoch, and a date with time is interpreted as the number of seconds since the beginning of the Unix Epoch.\"\n },\n {\n \"name\": \"reinterpretAsInt8\",\n \"def\": \"reinterpretAsInt8(v)\",\n \"docText\": \"Functions accept a string and interpret the bytes placed at the beginning of the string as a number in host order (little endian). If the string isn't long enough, the functions work as if the string is padded with the necessary number of null bytes. If the string is longer than needed, the extra bytes are ignored. A date is interpreted as the number of days since the beginning of the Unix Epoch, and a date with time is interpreted as the number of seconds since the beginning of the Unix Epoch.\"\n },\n {\n \"name\": \"upperUTF8\",\n \"def\": \"upperUTF8(v)\",\n \"docText\": \"Converts a string to uppercase, assuming the string contains a set of bytes that make up a UTF-8 encoded text. It doesn`t detect the language. So for Turkish the result might not be exactly correct. \"\n },\n {\n \"name\": \"reinterpretAsInt32\",\n \"def\": \"reinterpretAsInt32(v)\",\n \"docText\": \"Functions accept a string and interpret the bytes placed at the beginning of the string as a number in host order (little endian). If the string isn't long enough, the functions work as if the string is padded with the necessary number of null bytes. If the string is longer than needed, the extra bytes are ignored. A date is interpreted as the number of days since the beginning of the Unix Epoch, and a date with time is interpreted as the number of seconds since the beginning of the Unix Epoch.\"\n },\n {\n \"name\": \"reinterpretAsFloat32\",\n \"def\": \"reinterpretAsFloat32(v)\",\n \"docText\": \"Functions accept a string and interpret the bytes placed at the beginning of the string as a number in host order (little endian). If the string isn't long enough, the functions work as if the string is padded with the necessary number of null bytes. If the string is longer than needed, the extra bytes are ignored. A date is interpreted as the number of days since the beginning of the Unix Epoch, and a date with time is interpreted as the number of seconds since the beginning of the Unix Epoch.\"\n },\n {\n \"name\": \"reinterpretAsFloat64\",\n \"def\": \"reinterpretAsFloat64(v)\",\n \"docText\": \"Functions accept a string and interpret the bytes placed at the beginning of the string as a number in host order (little endian). If the string isn't long enough, the functions work as if the string is padded with the necessary number of null bytes. If the string is longer than needed, the extra bytes are ignored. A date is interpreted as the number of days since the beginning of the Unix Epoch, and a date with time is interpreted as the number of seconds since the beginning of the Unix Epoch.\"\n },\n {\n \"name\": \"reinterpretAsDate\",\n \"def\": \"reinterpretAsDate(v)\",\n \"docText\": \"Functions accept a string and interpret the bytes placed at the beginning of the string as a number in host order (little endian). If the string isn't long enough, the functions work as if the string is padded with the necessary number of null bytes. If the string is longer than needed, the extra bytes are ignored. A date is interpreted as the number of days since the beginning of the Unix Epoch, and a date with time is interpreted as the number of seconds since the beginning of the Unix Epoch.\"\n },\n {\n \"name\": \"reinterpretAsDateTime\",\n \"def\": \"reinterpretAsDateTime(v)\",\n \"docText\": \"Functions accept a string and interpret the bytes placed at the beginning of the string as a number in host order (little endian). If the string isn't long enough, the functions work as if the string is padded with the necessary number of null bytes. If the string is longer than needed, the extra bytes are ignored. A date is interpreted as the number of days since the beginning of the Unix Epoch, and a date with time is interpreted as the number of seconds since the beginning of the Unix Epoch.\"\n },\n {\n \"name\": \"roundToExp2\",\n \"def\": \"roundToExp2(num)\",\n \"docText\": \"Accepts a number. If the number is less than one, it returns 0. Otherwise, it rounds the number down to the nearest (whole non-negative) degree of two.\"\n },\n {\n \"name\": \"upper\",\n \"def\": \"upper(v)\",\n \"docText\": \"Converts a string to uppercase, assuming the string contains a set of bytes that make up a UTF-8 encoded text. It doesn`t detect the language. So for Turkish the result might not be exactly correct.\"\n },\n {\n \"name\": \"positionUTF8\",\n \"def\": \"positionUTF8(haystack, needle)\",\n \"docText\": \"The same as `position`, but the position is returned in Unicode code points. Works under the assumption that the string contains a set of bytes representing a UTF-8 encoded text. If this assumption is not met, it returns some result (it doesn`t throw an exception). \\n\" +\n \"\\n\" +\n \" There's also positionCaseInsensitiveUTF8 function.\"\n },\n {\n \"name\": \"roundDuration\",\n \"def\": \"roundDuration(num)\",\n \"docText\": \"Accepts a number. If the number is less than one, it returns 0. Otherwise, it rounds the number down to numbers from the set: 1, 10, 30, 60, 120, 180, 240, 300, 600, 1200, 1800, 3600, 7200, 18000, 36000. This function is specific to Yandex.Metrica and used for implementing the report on session length.\"\n },\n {\n \"name\": \"roundAge\",\n \"def\": \"roundAge(num)\",\n \"docText\": \"Accepts a number. If the number is less than 18, it returns 0. Otherwise, it rounds the number down to numbers from the set: 18, 25, 35, 45. This function is specific to Yandex.Metrica and used for implementing the report on user age.\"\n },\n {\n \"name\": \"round\",\n \"def\": \"round(num)\",\n \"docText\": \"Accepts a number. If the number is less than 18, it returns 0. Otherwise, it rounds the number down to numbers from the set: 18, 25, 35, 45. This function is specific to Yandex.Metrica and used for implementing the report on user age.\"\n },\n {\n \"name\": \"floor\",\n \"def\": \"floor(x[, N])\",\n \"docText\": \"Returns a rounder number that is less than or equal to `x`.\"\n },\n {\n \"name\": \"notEmpty\",\n \"def\": \"notEmpty(v)\",\n \"docText\": \"Returns 0 for an empty array, or 1 for a non-empty array. \\n\" +\n \"\\n\" +\n \" The result type is UInt8. \\n\" +\n \"\\n\" +\n \" The function also works for strings.\"\n },\n {\n \"name\": \"lengthUTF8\",\n \"def\": \"lengthUTF8(v)\",\n \"docText\": \"Returns the length of a string in Unicode code points (not in characters), assuming that the string contains a set of bytes that make up UTF-8 encoded text. If this assumption is not met, it returns some result (it doesn`t throw an exception). \\n\" +\n \"\\n\" +\n \" The result type is UInt64.\"\n },\n {\n \"name\": \"lower\",\n \"def\": \"lower(v)\",\n \"docText\": \"Converts a string to lowercase, assuming the string contains a set of bytes that make up a UTF-8 encoded text. It doesn`t detect the language. \"\n },\n {\n \"name\": \"lowerUTF8\",\n \"def\": \"lowerUTF8(v)\",\n \"docText\": \"Converts a string to lowercase, assuming the string contains a set of bytes that make up a UTF-8 encoded text. It doesn`t detect the language. \"\n },\n {\n \"name\": \"reverse\",\n \"def\": \"reverse(v)\",\n \"docText\": \"Reverses a sequence of Unicode code points, assuming that the string contains a set of bytes representing a UTF-8 text. Otherwise, it does something else (it doesn`t throw an exception).\"\n },\n {\n \"name\": \"URLPathHierarchy\",\n \"def\": \"URLPathHierarchy(URL)\",\n \"docText\": \"- The same thing, but without the protocol and host in the result. The / element (root) is not included. \"\n },\n {\n \"name\": \"substringUTF8\",\n \"def\": \"substringUTF8(s, offset, length)\",\n \"docText\": \"The same as `substring`, but for Unicode code points. Works under the assumption that the string contains a set of bytes representing a UTF-8 encoded text. If this assumption is not met, it returns some result (it doesn`t throw an exception).\"\n },\n {\n \"name\": \"appendTrailingCharIfAbsent\",\n \"def\": \"appendTrailingCharIfAbsent(s, c)\",\n \"docText\": \"If the `s` string is non-empty and does not contain the `c` character at the end, it appends the `c` character to the end.\"\n },\n {\n \"name\": \"alphaTokens\",\n \"def\": \"alphaTokens(s)\",\n \"docText\": \"Selects substrings of consecutive bytes from the range a-z and A-Z. \\n\" +\n \"\\n\" +\n \" Returns an array of selected substrings.\"\n },\n {\n \"name\": \"splitByChar\",\n \"def\": \"splitByChar(separator, s)\",\n \"docText\": \"Splits a string into substrings, using `separator` as the separator. \\n\" +\n \"\\n\" +\n \" `separator` must be a string constant consisting of exactly one character. \\n\" +\n \"\\n\" +\n \" Returns an array of selected substrings\"\n },\n {\n \"name\": \"arrayStringConcat\",\n \"def\": \"arrayStringConcat(arr[, separator])\",\n \"docText\": \"Concatenates strings from the array elements, using `separator` as the separator. \\n\" +\n \"\\n\" +\n \" `separator` is a string constant, an optional parameter. By default it is an empty string. \\n\" +\n \"\\n\" +\n \" Returns a string.\"\n },\n {\n \"name\": \"replaceAll\",\n \"def\": \"replaceAll(haystack, pattern, replacement)\",\n \"docText\": \"Replaces all occurrences of the `pattern` substring in `haystack` with the `replacement` substring.\"\n },\n {\n \"name\": \"replaceRegexpOne\",\n \"def\": \"replaceRegexpOne(haystack, pattern, replacement)\",\n \"docText\": \"Replacement using the `pattern` regular expression. A re2 regular expression. Replaces only the first occurrence, if it exists. \\n\" +\n \"\\n\" +\n \" A pattern can be specified as `replacement`. \"\n },\n {\n \"name\": \"cbrt\",\n \"def\": \"cbrt(x)\",\n \"docText\": \"Accepts a numeric argument and returns a Float64 number close to the cubic root of the argument.\"\n },\n {\n \"name\": \"match\",\n \"def\": \"match(pattern)(time, cond1, cond2, ...)\",\n \"docText\": \"Pattern matching for event chains. \\n\" +\n \"\\n\" +\n \" `pattern` is a string containing a pattern to match. The pattern is similar to a regular expression.\"\n },\n {\n \"name\": \"cutURLParameter\",\n \"def\": \"cutURLParameter(URL, name)\",\n \"docText\": \"Removes the URL parameter named `name`, if present. This function works under the assumption that the parameter name is encoded in the URL exactly the same way as in the passed argument.\"\n },\n {\n \"name\": \"like\",\n \"def\": \"like(haystack, pattern), haystack NOT LIKE pattern operator\",\n \"docText\": \"The same thing as `like`, but negative.\"\n },\n {\n \"name\": \"domain\",\n \"def\": \"domain(v)\",\n \"docText\": \"- Selects the part of the domain that includes top-level subdomains up to the `first significant subdomain` (see the explanation above). \\n\" +\n \"\\n\" +\n \" For example, cutToFirstSignificantSubdomain(`https://news.yandex.com.tr/`) = `yandex.com.tr`.\"\n },\n {\n \"name\": \"domainWithoutWWW\",\n \"def\": \"domainWithoutWWW(v)\",\n \"docText\": \"- Selects the domain and removes no more than one `www.` from the beginning of it, if present.\"\n },\n {\n \"name\": \"firstSignificantSubdomain\",\n \"def\": \"firstSignificantSubdomain(v)\",\n \"docText\": \"- Selects the part of the domain that includes top-level subdomains up to the `first significant subdomain` (see the explanation above). \\n\" +\n \"\\n\" +\n \" For example, cutToFirstSignificantSubdomain(`https://news.yandex.com.tr/`) = `yandex.com.tr`.\"\n },\n {\n \"name\": \"queryString\",\n \"def\": \"queryString(v)\",\n \"docText\": \"Removes the query-string and fragment identifier. The question mark and number sign are also removed.\"\n },\n {\n \"name\": \"queryStringAndFragment\",\n \"def\": \"queryStringAndFragment(v)\",\n \"docText\": \"Removes the query-string and fragment identifier. The question mark and number sign are also removed.\"\n },\n {\n \"name\": \"extractURLParameter\",\n \"def\": \"extractURLParameter(URL)\",\n \"docText\": \"- Gets an array of name=value strings corresponding to the names of URL parameters. The values are not decoded in any way.\"\n },\n {\n \"name\": \"URLHierarchy\",\n \"def\": \"URLHierarchy(URL)\",\n \"docText\": \"- Gets an array containing the URL trimmed to the `/`, `?` characters in the path and query-string. Consecutive separator characters are counted as one. The cut is made in the position after all the consecutive separator characters. Example:\"\n },\n {\n \"name\": \"cutToFirstSignificantSubdomain\",\n \"def\": \"cutToFirstSignificantSubdomain(v)\",\n \"docText\": \"- Selects the part of the domain that includes top-level subdomains up to the `first significant subdomain` (see the explanation above). \\n\" +\n \"\\n\" +\n \" For example, cutToFirstSignificantSubdomain(`https://news.yandex.com.tr/`) = `yandex.com.tr`.\"\n },\n {\n \"name\": \"cutWWW\",\n \"def\": \"cutWWW(v)\",\n \"docText\": \"Removes no more than one `www.` from the beginning of the URL`s domain, if present.\"\n },\n {\n \"name\": \"cutQueryString\",\n \"def\": \"cutQueryString(v)\",\n \"docText\": \"Removes the query-string and fragment identifier. The question mark and number sign are also removed.\"\n },\n {\n \"name\": \"cutFragment\",\n \"def\": \"cutFragment(v)\",\n \"docText\": \"Removes the fragment identifier. The number sign is also removed.\"\n },\n {\n \"name\": \"visitParamHas\",\n \"def\": \"visitParamHas(params, name)\",\n \"docText\": \"Checks whether there is a field with the `name` name.\"\n },\n {\n \"name\": \"visitParamExtractFloat\",\n \"def\": \"visitParamExtractFloat(params, name)\",\n \"docText\": \"The same as for Float64.\"\n },\n {\n \"name\": \"visitParamExtractBool\",\n \"def\": \"visitParamExtractBool(params, name)\",\n \"docText\": \"Parses a true/false value. The result is UInt8.\"\n },\n {\n \"name\": \"visitParamExtractRaw\",\n \"def\": \"visitParamExtractRaw(params, name)\",\n \"docText\": \"Returns the value of a field, including separators.\"\n },\n {\n \"name\": \"exp\",\n \"def\": \"exp(x)\",\n \"docText\": \"Accepts a numeric argument and returns a Float64 number close to 10 in power of x.\"\n },\n {\n \"name\": \"exp2\",\n \"def\": \"exp2(x)\",\n \"docText\": \"Accepts a numeric argument and returns a Float64 number close to 2 in power of x.\"\n },\n {\n \"name\": \"exp10\",\n \"def\": \"exp10(x)\",\n \"docText\": \"Accepts a numeric argument and returns a Float64 number close to 10 in power of x.\"\n },\n {\n \"name\": \"tgamma\",\n \"def\": \"tgamma(x)\",\n \"docText\": \"Gamma function.\"\n },\n {\n \"name\": \"log10\",\n \"def\": \"log10(x)\",\n \"docText\": \"Accepts a numeric argument and returns a Float64 number close to the decimal logarithm of the argument.\"\n },\n {\n \"name\": \"sqrt\",\n \"def\": \"sqrt(x)\",\n \"docText\": \"Accepts a numeric argument and returns a Float64 number close to the square root of the argument.\"\n },\n {\n \"name\": \"erf\",\n \"def\": \"erf(v)\",\n \"docText\": \"What to do when the amount of data exceeds one of the limits: `throw` or `break`. By default, throw.\"\n },\n {\n \"name\": \"erfc\",\n \"def\": \"erfc(x)\",\n \"docText\": \"Accepts a numeric argument and returns a Float64 number close to 1 - erf(x), but without loss of precision for large `x` values.\"\n },\n {\n \"name\": \"lgamma\",\n \"def\": \"lgamma(x)\",\n \"docText\": \"The logarithm of the gamma function.\"\n },\n {\n \"name\": \"sin\",\n \"def\": \"sin(x)\",\n \"docText\": \"Accepts Float32 and Float64 and returns UInt8 equal to 1 if the argument is infinite, otherwise 0. \\n\" +\n \"\\n\" +\n \" Note that 0 is returned for a NaN.\"\n },\n {\n \"name\": \"cos\",\n \"def\": \"cos(x)\",\n \"docText\": \"The arc cosine.\"\n },\n {\n \"name\": \"tan\",\n \"def\": \"tan(x)\",\n \"docText\": \"The arc tangent.\"\n },\n {\n \"name\": \"pow\",\n \"def\": \"pow(x, y)\",\n \"docText\": \"x in power of y.\"\n }\n ]\n };\n\n p.MacrosCompletions = function () {\n return [\n {\n \"name\": \"$table\",\n \"def\": \"$table\",\n \"docText\": \"Replaced with selected table name from Query Builder\"\n },\n {\n \"name\": \"$dateCol\",\n \"def\": \"$dateCol\",\n \"docText\": \"Replaced with `Date:Col` value from Query Builder\"\n },\n {\n \"name\": \"$dateTimeCol\",\n \"def\": \"$dateTimeCol\",\n \"docText\": \"Replaced with `Column:DateTime` or `Column:TimeStamp` value from Query Builder\"\n },\n {\n \"name\": \"$from\",\n \"def\": \"$from\",\n \"docText\": \"Replaced with timestamp/1000 value of selected `Time Range:From`\"\n },\n {\n \"name\": \"$to\",\n \"def\": \"$to\",\n \"docText\": \"Replaced with timestamp/1000 value of selected `Time Range:To`\"\n },\n {\n \"name\": \"$interval\",\n \"def\": \"$interval\",\n \"docText\": \"Replaced with selected `Group by time interval` value (as a number of seconds)\"\n },\n {\n \"name\": \"$timeFilter\",\n \"def\": \"$timeFilter\",\n \"docText\": \"Replaced with currently selected `Time Range`. Requires `Column:Date` and `Column:DateTime` or `Column:TimeStamp` to be selected\"\n },\n {\n \"name\": \"$timeSeries\",\n \"def\": \"$timeSeries\",\n \"docText\": \"Replaced with special ClickHouse construction to convert results as time-series data. Use it as `SELECT $timeSeries...`. Require `Column:DateTime` or `Column:TimeStamp` to be selected\"\n },\n {\n \"name\": \"$rate\",\n \"def\": \"$rate(cols...)\",\n \"docText\": \"Converts query results as `change rate per interval`. Can be used to display changes-per-second.\" +\n \"\\n\" +\n \"Example:\\n $rate(countIf(Type = 200) AS good, countIf(Type != 200) AS bad) FROM requests\"\n },\n {\n \"name\": \"$columns\",\n \"def\": \"$columns(key, value)\",\n \"docText\": \"Query values as array of [key, value], where key will be used as label. Can be used to display multiple lines at graph\" +\n \"\\n\" +\n \"Example:\\n $columns(OSName, count(*) c) FROM requests\"\n },\n {\n \"name\": \"$rateColumns\",\n \"def\": \"$rateColumns(key, value)\",\n \"docText\": \"Is a combination of `$columns` and `$rate` .\" +\n \"\\n\" +\n \"Example:\\n $rateColumns(OS, count(*) c) FROM requests\"\n },\n {\n \"name\": \"$unescape\",\n \"def\": \"$unescape($variable)\",\n \"docText\": \"Unescapes variable value by removing single quotes\" +\n \"\\n\" +\n \"Example:\\n SELECT $unescape($column) FROM requests WHERE $unescape($column) = 5\"\n }\n ];\n };\n\n p.re = function (list) {\n return list.join(\"|\")\n };\n\n exports.ClickhouseInfo = p;\n});\n"]} \ No newline at end of file diff --git a/dist/datasource.d.ts b/dist/datasource.d.ts index 8861618b9..cd9013df0 100644 --- a/dist/datasource.d.ts +++ b/dist/datasource.d.ts @@ -12,6 +12,7 @@ export declare class ClickHouseDatasource { basicAuth: any; withCredentials: any; usePOST: boolean; + defaultDatabase: string; addCorsHeader: boolean; responseParser: any; adhocCtrl: AdhocCtrl; diff --git a/dist/datasource.js b/dist/datasource.js index a8e6c63db..2d36dc1e4 100644 --- a/dist/datasource.js +++ b/dist/datasource.js @@ -1,6 +1,6 @@ /// -System.register(['lodash', './sql_series', './sql_query', './response_parser', './adhoc'], function(exports_1) { - var lodash_1, sql_series_1, sql_query_1, response_parser_1, adhoc_1; +System.register(['lodash', './sql_series', './sql_query', './response_parser', './adhoc', './scanner'], function(exports_1) { + var lodash_1, sql_series_1, sql_query_1, response_parser_1, adhoc_1, scanner_1; var ClickHouseDatasource; return { setters:[ @@ -18,6 +18,9 @@ System.register(['lodash', './sql_series', './sql_query', './response_parser', ' }, function (adhoc_1_1) { adhoc_1 = adhoc_1_1; + }, + function (scanner_1_1) { + scanner_1 = scanner_1_1; }], execute: function() { ClickHouseDatasource = (function () { @@ -36,6 +39,7 @@ System.register(['lodash', './sql_series', './sql_query', './response_parser', ' this.withCredentials = instanceSettings.withCredentials; this.addCorsHeader = instanceSettings.jsonData.addCorsHeader; this.usePOST = instanceSettings.jsonData.usePOST; + this.defaultDatabase = instanceSettings.jsonData.defaultDatabase || ''; this.adhocCtrl = new adhoc_1.default(); } ClickHouseDatasource.prototype._request = function (query) { @@ -72,12 +76,19 @@ System.register(['lodash', './sql_series', './sql_query', './response_parser', ' ; ClickHouseDatasource.prototype.query = function (options) { var _this = this; - var queries = [], q, adhocFilters = this.templateSrv.getAdhocFilters(this.name); + var queries = [], q, adhocFilters = this.templateSrv.getAdhocFilters(this.name), keyColumns = []; lodash_1.default.map(options.targets, function (target) { if (!target.hide && target.query) { var queryModel = new sql_query_1.default(target, _this.templateSrv, options); q = queryModel.replace(options, adhocFilters); queries.push(q); + try { + var queryAST = new scanner_1.default(q).toAST(); + keyColumns.push(queryAST['group by'] || []); + } + catch (err) { + console.log('AST parser error: ', err); + } } }); // No valid targets, return the empty result to save a round trip. @@ -93,6 +104,7 @@ System.register(['lodash', './sql_series', './sql_query', './response_parser', ' var result = [], i = 0; lodash_1.default.each(responses, function (response) { var target = options.targets[i]; + var keys = keyColumns[i]; i++; if (!response || !response.rows) { return; @@ -100,6 +112,7 @@ System.register(['lodash', './sql_series', './sql_query', './response_parser', ' var sqlSeries = new sql_series_1.default({ series: response.data, meta: response.meta, + keys: keys, tillNow: options.rangeRaw.to === 'now', from: sql_query_1.default.convertTimestamp(options.range.from), to: sql_query_1.default.convertTimestamp(options.range.to) diff --git a/dist/datasource.js.map b/dist/datasource.js.map index cfc8a9766..d400ed479 100644 --- a/dist/datasource.js.map +++ b/dist/datasource.js.map @@ -1 +1 @@ -{"version":3,"file":"datasource.js","sourceRoot":"","sources":["datasource.ts"],"names":["ClickHouseDatasource","ClickHouseDatasource.constructor","ClickHouseDatasource._request","ClickHouseDatasource.query","ClickHouseDatasource.metricFindQuery","ClickHouseDatasource.testDatasource","ClickHouseDatasource._seriesQuery","ClickHouseDatasource.targetContainsTemplate","ClickHouseDatasource.getTagKeys","ClickHouseDatasource.getTagValues"],"mappings":"AAAA,iFAAiF;;;;;;;;;;;;;;;;;;;;;;YASjF;gBAaIA,gBAAgBA;gBAChBA,8BAAYA,gBAAgBA,EACRA,EAAEA,EACFA,UAAUA,EACVA,WAAWA;oBAFXC,OAAEA,GAAFA,EAAEA,CAAAA;oBACFA,eAAUA,GAAVA,UAAUA,CAAAA;oBACVA,gBAAWA,GAAXA,WAAWA,CAAAA;oBAC7BA,IAAIA,CAACA,IAAIA,GAAGA,YAAYA,CAACA;oBACzBA,IAAIA,CAACA,IAAIA,GAAGA,gBAAgBA,CAACA,IAAIA,CAACA;oBAClCA,IAAIA,CAACA,cAAcA,GAAGA,IAAIA,CAACA;oBAC3BA,IAAIA,CAACA,cAAcA,GAAGA,IAAIA,yBAAcA,EAAEA,CAACA;oBAC3CA,IAAIA,CAACA,GAAGA,GAAGA,gBAAgBA,CAACA,GAAGA,CAACA;oBAChCA,IAAIA,CAACA,SAASA,GAAGA,gBAAgBA,CAACA,SAASA,CAACA;oBAC5CA,IAAIA,CAACA,SAASA,GAAGA,gBAAgBA,CAACA,SAASA,CAACA;oBAC5CA,IAAIA,CAACA,eAAeA,GAAGA,gBAAgBA,CAACA,eAAeA,CAACA;oBACxDA,IAAIA,CAACA,aAAaA,GAAGA,gBAAgBA,CAACA,QAAQA,CAACA,aAAaA,CAACA;oBAC7DA,IAAIA,CAACA,OAAOA,GAAGA,gBAAgBA,CAACA,QAAQA,CAACA,OAAOA,CAACA;oBACjDA,IAAIA,CAACA,SAASA,GAAGA,IAAIA,eAASA,EAAEA,CAACA;gBACnCA,CAACA;gBAEDD,uCAAQA,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A,GAAGA,CAACA,CAACA;oBAC9CA,KAAKA,IAAIA,cAAcA,CAACA;oBACxBA,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA,KAAKA,CAACA,CAACA;gBAChCA,CAACA;;gBAGDN,qDAAsBA,GAAtBA,UAAuBA,MAAMA;oBACzBO,MAAMA,CAACA,IAAIA,CAACA,WAAWA,CAACA,cAAcA,CAACA,MAAMA,CAACA,IAAIA,CAACA,CAACA;gBACxDA,CAACA;;gBAEDP,yCAAUA,GAAVA;oBACIQ,MAAMA,CAACA,IAAIA,CAACA,SAASA,CAACA,UAAUA,CAACA,IAAIA,CAACA,CAACA;gBAE3CA,CAACA;gBAEDR,2CAAYA,GAAZA,UAAaA,OAAOA;oBAChBS,MAAMA,CAACA,IAAIA,CAACA,SAASA,CAACA,YAAYA,CAACA,OAAOA,CAACA,CAACA;gBAChDA,CAACA;gBACLT,2BAACA;YAADA,CAACA,AA9JD,IA8JC;YA9JD,uDA8JC,CAAA"} \ No newline at end of file +{"version":3,"file":"datasource.js","sourceRoot":"","sources":["datasource.ts"],"names":["ClickHouseDatasource","ClickHouseDatasource.constructor","ClickHouseDatasource._request","ClickHouseDatasource.query","ClickHouseDatasource.metricFindQuery","ClickHouseDatasource.testDatasource","ClickHouseDatasource._seriesQuery","ClickHouseDatasource.targetContainsTemplate","ClickHouseDatasource.getTagKeys","ClickHouseDatasource.getTagValues"],"mappings":"AAAA,iFAAiF;;;;;;;;;;;;;;;;;;;;;;;;;YAUjF;gBAcIA,gBAAgBA;gBAChBA,8BAAYA,gBAAgBA,EACRA,EAAEA,EACFA,UAAUA,EACVA,WAAWA;oBAFXC,OAAEA,GAAFA,EAAEA,CAAAA;oBACFA,eAAUA,GAAVA,UAAUA,CAAAA;oBACVA,gBAAWA,GAAXA,WAAWA,CAAAA;oBAC7BA,IAAIA,CAACA,IAAIA,GAAGA,YAAYA,CAACA;oBACzBA,IAAIA,CAACA,IAAIA,GAAGA,gBAAgBA,CAACA,IAAIA,CAAC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IAAIA,cAAcA,CAACA;oBACxBA,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA,KAAKA,CAACA,CAACA;gBAChCA,CAACA;;gBAGDN,qDAAsBA,GAAtBA,UAAuBA,MAAMA;oBACzBO,MAAMA,CAACA,IAAIA,CAACA,WAAWA,CAACA,cAAcA,CAACA,MAAMA,CAACA,IAAIA,CAACA,CAACA;gBACxDA,CAACA;;gBAEDP,yCAAUA,GAAVA;oBACIQ,MAAMA,CAACA,IAAIA,CAACA,SAASA,CAACA,UAAUA,CAACA,IAAIA,CAACA,CAACA;gBAE3CA,CAACA;gBAEDR,2CAAYA,GAAZA,UAAaA,OAAOA;oBAChBS,MAAMA,CAACA,IAAIA,CAACA,SAASA,CAACA,YAAYA,CAACA,OAAOA,CAACA,CAACA;gBAChDA,CAACA;gBACLT,2BAACA;YAADA,CAACA,AA1KD,IA0KC;YA1KD,uDA0KC,CAAA"} \ No newline at end of file diff --git a/dist/datasource.ts b/dist/datasource.ts index 14aaaa1d4..83d169bb5 100644 --- a/dist/datasource.ts +++ b/dist/datasource.ts @@ -6,6 +6,7 @@ import SqlSeries from './sql_series'; import SqlQuery from './sql_query'; import ResponseParser from './response_parser'; import AdhocCtrl from './adhoc'; +import Scanner from './scanner'; export class ClickHouseDatasource { type: string; @@ -16,6 +17,7 @@ export class ClickHouseDatasource { basicAuth: any; withCredentials: any; usePOST: boolean; + defaultDatabase: string; addCorsHeader: boolean; responseParser: any; adhocCtrl: AdhocCtrl; @@ -35,6 +37,7 @@ export class ClickHouseDatasource { this.withCredentials = instanceSettings.withCredentials; this.addCorsHeader = instanceSettings.jsonData.addCorsHeader; this.usePOST = instanceSettings.jsonData.usePOST; + this.defaultDatabase = instanceSettings.jsonData.defaultDatabase || ''; this.adhocCtrl = new AdhocCtrl(); } @@ -75,13 +78,20 @@ export class ClickHouseDatasource { query(options) { var queries = [], q, - adhocFilters = this.templateSrv.getAdhocFilters(this.name); + adhocFilters = this.templateSrv.getAdhocFilters(this.name), + keyColumns = []; _.map(options.targets, (target) => { if (!target.hide && target.query) { var queryModel = new SqlQuery(target, this.templateSrv, options); q = queryModel.replace(options, adhocFilters); queries.push(q); + try { + let queryAST = new Scanner(q).toAST(); + keyColumns.push(queryAST['group by'] || []); + } catch (err) { + console.log('AST parser error: ', err) + } } }); @@ -101,6 +111,8 @@ export class ClickHouseDatasource { var result = [], i = 0; _.each(responses, (response) => { var target = options.targets[i]; + var keys = keyColumns[i]; + i++; if (!response || !response.rows) { return; @@ -109,6 +121,7 @@ export class ClickHouseDatasource { var sqlSeries = new SqlSeries({ series: response.data, meta: response.meta, + keys: keys, tillNow: options.rangeRaw.to === 'now', from: SqlQuery.convertTimestamp(options.range.from), to: SqlQuery.convertTimestamp(options.range.to) diff --git a/dist/partials/config.html b/dist/partials/config.html index 57a9a6ff2..13084bfa4 100644 --- a/dist/partials/config.html +++ b/dist/partials/config.html @@ -4,18 +4,28 @@

Additional

- + checked="ctrl.current.jsonData.addCorsHeader" label-class="width-25" switch-class="max-width-5">
- + checked="ctrl.current.jsonData.usePOST" label-class="width-25" switch-class="max-width-5">
+ +
+
+ Default database + + + If you set default database for this datasource, it will be prefilled in the query builder, and used to make ad-hoc filters more convenient. + +
+
\ No newline at end of file diff --git a/dist/query_ctrl.js b/dist/query_ctrl.js index d9ca18b45..6f03f5576 100644 --- a/dist/query_ctrl.js +++ b/dist/query_ctrl.js @@ -36,7 +36,11 @@ System.register(['jquery', 'lodash', './clickhouse-info', './mode-clickhouse', ' _super.call(this, $scope, $injector); this.uiSegmentSrv = uiSegmentSrv; this.queryModel = new sql_query_1.default(this.target, templateSrv, this.panel.scopedVars); - this.databaseSegment = uiSegmentSrv.newSegment(this.target.database || { fake: true, value: '-- database --' }); + var defaultDatabaseSegment = { fake: true, value: '-- database --' }; + if (this.datasource.defaultDatabase.length > 0) { + defaultDatabaseSegment = { fake: false, value: this.datasource.defaultDatabase }; + } + this.databaseSegment = uiSegmentSrv.newSegment(this.target.database || defaultDatabaseSegment); this.tableSegment = uiSegmentSrv.newSegment(this.target.table || { fake: true, value: '-- table --' }); this.dateColDataTypeSegment = uiSegmentSrv.newSegment(this.target.dateColDataType || { fake: true, value: '-- date : col --' }); this.dateTimeColDataTypeSegment = uiSegmentSrv.newSegment(this.target.dateTimeColDataType || { fake: true, value: '-- dateTime : col --' }); @@ -62,6 +66,10 @@ System.register(['jquery', 'lodash', './clickhouse-info', './mode-clickhouse', ' if (this.target.query === defaultQuery) { this.target.query = this.format(); } + /* Update database if default database is used to prepopulate the field */ + if (this.target.database === undefined && !defaultDatabaseSegment.fake) { + this.databaseChanged(); + } } SqlQueryCtrl.prototype.getCollapsedText = function () { return this.target.query; diff --git a/dist/query_ctrl.js.map b/dist/query_ctrl.js.map index 16a2c88a1..040e40d97 100644 --- a/dist/query_ctrl.js.map +++ b/dist/query_ctrl.js.map @@ -1 +1 @@ -{"version":3,"file":"query_ctrl.js","sourceRoot":"","sources":["query_ctrl.ts"],"names":["SqlQueryCtrl","SqlQueryCtrl.constructor","SqlQueryCtrl.getCollapsedText","SqlQueryCtrl.fakeSegment","SqlQueryCtrl.getDateColDataTypeSegments","SqlQueryCtrl.dateColDataTypeChanged","SqlQueryCtrl.dateTimeTypeChanged","SqlQueryCtrl.getDateTimeColDataTypeSegments","SqlQueryCtrl.dateTimeColDataTypeChanged","SqlQueryCtrl.toggleEditorMode","SqlQueryCtrl.toggleEdit","SqlQueryCtrl.getCompleter","SqlQueryCtrl.getCompletions","SqlQueryCtrl._convertToHTML","SqlQueryCtrl.getDatabaseSegments","SqlQueryCtrl.databaseChanged","SqlQueryCtrl.getTableSegments","SqlQueryCtrl.tableChanged","SqlQueryCtrl.formatQuery","SqlQueryCtrl.toQueryMode","SqlQueryCtrl.format","SqlQueryCtrl.getScanner","SqlQueryCtrl.handleQueryError","SqlQueryCtrl.queryColumns","SqlQueryCtrl.querySegment","SqlQueryCtrl.applySegment","SqlQueryCtrl.buildExploreQuery"],"mappings":"AAAA,iFAAiF;;;;;;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ACA,MAAMA,CAACA,KAAKA,GAAGA,SAASA;gCAC5CA,kBAAkBA;gCAClBA,eAAeA,CAACA;4BACpBA,KAAKA,CAACA;wBACVA,KAAKA,UAAUA;4BACXA,KAAKA,GAAGA,cAAcA;gCAClBA,sBAAsBA;gCACtBA,qBAAqBA,GAAGA,IAAIA,CAACA,MAAMA,CAACA,QAAQA,GAAGA,SAASA;gCACxDA,YAAYA,GAAGA,IAAIA,CAACA,MAAMA,CAACA,KAAKA,GAAGA,SAASA;gCAC5CA,0BAA0BA;gCAC1BA,eAAeA,CAACA;4BACpBA,KAAKA,CAACA;wBACVA,KAAKA,WAAWA;4BACZA,KAAKA,GAAGA,cAAcA;gCAClBA,sBAAsBA;gCACtBA,qBAAqBA,GAAGA,IAAIA,CAACA,MAAMA,CAACA,QAAQA,GAAGA,SAASA;gCACxDA,YAAYA,GAAGA,IAAIA,CAACA,MAAMA,CAACA,KAAKA,GAAGA,SAASA;gCAC5CA,oBAAoBA;gCACpBA,eAAeA,CAACA;4BACpBA,KAAKA,CAACA;wBACVA,KAAKA,WAAWA;4BACZA,KAAKA,GAAGA,cAAcA;gCAClBA,wBAAwBA;gCACxBA,eAAeA,CAACA;4BACpBA,KAAKA,CAACA;wBACVA,KAAKA,SAASA;4BACVA,KAAKA,GAAGA,+BAA+BA;gCACnCA,sBAAsBA;gCACtBA,qBAAqBA,GAAGA,IAAIA,CAACA,MAAMA,CAACA,QAAQA,GAAGA,SAASA;gCACxDA,YAAYA,GAAGA,IAAIA,CAACA,MAAMA,CAACA,KAAKA,GAAGA,IAAIA,CAACA;4BAC5CA,KAAKA,CAACA;oBACdA,CAACA;oBACDA,MAAMA,CAACA,KAAKA,CAACA;gBACjBA,CAACA;;gBA3UM1B,wBAAWA,GAAGA,4BAA4BA,CAACA;gBA4UtDA,mBAACA;YAADA,CAACA,AA7UD,EAA2B,eAAS,EA6UnC;YACO,uCAAY"} \ No newline at end of file +{"version":3,"file":"query_ctrl.js","sourceRoot":"","sources":["query_ctrl.ts"],"names":["SqlQueryCtrl","SqlQueryCtrl.constructor","SqlQueryCtrl.getCollapsedText","SqlQueryCtrl.fakeSegment","SqlQueryCtrl.getDateColDataTypeSegments","SqlQueryCtrl.dateColDataTypeChanged","SqlQueryCtrl.dateTimeTypeChanged","SqlQueryCtrl.getDateTimeColDataTypeSegments","SqlQueryCtrl.dateTimeColDataTypeChanged","SqlQueryCtrl.toggleEditorMode","SqlQueryCtrl.toggleEdit","SqlQueryCtrl.getCompleter","SqlQueryCtrl.getCompletions","SqlQueryCtrl._convertToHTML","SqlQueryCtrl.getDatabaseSegments","SqlQueryCtrl.databaseChanged","SqlQueryCtrl.getTableSegments","SqlQueryCtrl.tableChanged","SqlQueryCtrl.formatQuery","SqlQueryCtrl.toQueryMode","SqlQueryCtrl.format","SqlQueryCtrl.getScanner","SqlQueryCtrl.handleQueryError","SqlQueryCtrl.queryColumns","SqlQueryCtrl.querySegment","SqlQueryCtrl.applySegment","SqlQueryCtrl.buildExploreQuery"],"mappings":"AAAA,iFAAiF;;;;;;;;QAW3E,YAAY;;;;;;;;;;;;;;;;;;;;;;YAAZ,YAAY,GAAG,sFAAsF,CAAC;YAE5G;gBAA2BA,gCAASA;gBA8BhCA,iBAAiBA;gBACjBA,sBAAYA,MAAMA,EAAEA,SAASA,EAAEA,WAAWA,EAAUA,YAAYA;oBAC5DC,kBAAMA,MAAMA,EAAEA,SAASA,CAACA,CAACA;oBADuBA,iBAAYA,GAAZA,YAAYA,CAAAA;oBAG5DA,IAAIA,CAACA,UAAUA,GAAGA,IAAIA,mBAAQA,CAACA,IAAIA,CAACA,MAAMA,EAAEA,WAAWA,EAAEA,IAAIA,CAACA,KAAKA,CAACA,UAAUA,CAACA,CAACA;oBAEhFA,IAAIA,sBAAsBA,GAAGA,EAACA,IAAIA,EAAEA,IAAIA,EAAEA,KAAKA,EAAEA,gBAAgBA,EAACA,CAACA;oBACnEA,EAAEA,CAACA,CAACA,IAAIA,CAACA,UAAUA,CAACA,eAAeA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A,CAACA;wBACVA,KAAKA,UAAUA;4BACXA,KAAKA,GAAGA,cAAcA;gCAClBA,sBAAsBA;gCACtBA,qBAAqBA,GAAGA,IAAIA,CAACA,MAAMA,CAACA,QAAQA,GAAGA,SAASA;gCACxDA,YAAYA,GAAGA,IAAIA,CAACA,MAAMA,CAACA,KAAKA,GAAGA,SAASA;gCAC5CA,0BAA0BA;gCAC1BA,eAAeA,CAACA;4BACpBA,KAAKA,CAACA;wBACVA,KAAKA,WAAWA;4BACZA,KAAKA,GAAGA,cAAcA;gCAClBA,sBAAsBA;gCACtBA,qBAAqBA,GAAGA,IAAIA,CAACA,MAAMA,CAACA,QAAQA,GAAGA,SAASA;gCACxDA,YAAYA,GAAGA,IAAIA,CAACA,MAAMA,CAACA,KAAKA,GAAGA,SAASA;gCAC5CA,oBAAoBA;gCACpBA,eAAeA,CAACA;4BACpBA,KAAKA,CAACA;wBACVA,KAAKA,WAAWA;4BACZA,KAAKA,GAAGA,cAAcA;gCAClBA,wBAAwBA;gCACxBA,eAAeA,CAACA;4BACpBA,KAAKA,CAACA;wBACVA,KAAKA,SAASA;4BACVA,KAAKA,GAAGA,+BAA+BA;gCACnCA,sBAAsBA;gCACtBA,qBAAqBA,GAAGA,IAAIA,CAACA,MAAMA,CAACA,QAAQA,GAAGA,SAASA;gCACxDA,YAAYA,GAAGA,IAAIA,CAACA,MAAMA,CAACA,KAAKA,GAAGA,IAAIA,CAACA;4BAC5CA,KAAKA,CAACA;oBACdA,CAACA;oBACDA,MAAMA,CAACA,KAAKA,CAACA;gBACjBA,CAACA;;gBApVM1B,wBAAWA,GAAGA,4BAA4BA,CAACA;gBAqVtDA,mBAACA;YAADA,CAACA,AAtVD,EAA2B,eAAS,EAsVnC;YACO,uCAAY"} \ No newline at end of file diff --git a/dist/query_ctrl.ts b/dist/query_ctrl.ts index 9cd102587..6208bc809 100644 --- a/dist/query_ctrl.ts +++ b/dist/query_ctrl.ts @@ -47,8 +47,12 @@ class SqlQueryCtrl extends QueryCtrl { this.queryModel = new SqlQuery(this.target, templateSrv, this.panel.scopedVars); + let defaultDatabaseSegment = {fake: true, value: '-- database --'}; + if (this.datasource.defaultDatabase.length > 0) { + defaultDatabaseSegment = {fake: false, value: this.datasource.defaultDatabase}; + } this.databaseSegment = uiSegmentSrv.newSegment( - this.target.database || {fake: true, value: '-- database --'} + this.target.database || defaultDatabaseSegment ); this.tableSegment = uiSegmentSrv.newSegment( @@ -89,6 +93,11 @@ class SqlQueryCtrl extends QueryCtrl { if (this.target.query === defaultQuery) { this.target.query = this.format(); } + + /* Update database if default database is used to prepopulate the field */ + if (this.target.database === undefined && !defaultDatabaseSegment.fake) { + this.databaseChanged(); + } } getCollapsedText() { diff --git a/dist/scanner.d.ts b/dist/scanner.d.ts index b46ef0c38..eb65c0fde 100644 --- a/dist/scanner.d.ts +++ b/dist/scanner.d.ts @@ -3,7 +3,7 @@ export default class Scanner { rootToken: any; token: any; skipSpace: boolean; - re: any; + re: RegExp; expectedNext: boolean; _sOriginal: any; _s: any; diff --git a/dist/scanner.ts b/dist/scanner.ts index 5c32a0b25..dcf69c4e0 100644 --- a/dist/scanner.ts +++ b/dist/scanner.ts @@ -5,7 +5,7 @@ export default class Scanner { rootToken: any; token: any; skipSpace: boolean; - re: any; + re: RegExp; expectedNext: boolean; _sOriginal: any; diff --git a/dist/sql_query.js b/dist/sql_query.js index e75b70583..66e1bbc1a 100644 --- a/dist/sql_query.js +++ b/dist/sql_query.js @@ -35,6 +35,15 @@ System.register(['lodash', 'app/core/utils/datemath', 'moment', './scanner'], fu } adhocFilters.forEach(function (af) { var parts = af.key.split('.'); + /* Wildcard table, substitute current target table */ + if (parts.length == 1) { + parts.unshift(self.target.table); + } + /* Wildcard database, substitute current target database */ + if (parts.length == 2) { + parts.unshift(self.target.database); + } + /* Expect fully qualified column name at this point */ if (parts.length < 3) { console.log("adhoc filters: filter " + af.key + "` has wrong format"); return; @@ -64,7 +73,7 @@ System.register(['lodash', 'app/core/utils/datemath', 'moment', './scanner'], fu } } catch (err) { - console.log('AST parser error: ', err.message); + console.log('AST parser error: ', err); } query = this.templateSrv.replace(query, options.scopedVars, SqlQuery.interpolateQueryExpr); query = SqlQuery.unescape(query); diff --git a/dist/sql_query.js.map b/dist/sql_query.js.map index 5910b84b6..d3fdd3dd3 100644 --- a/dist/sql_query.js.map +++ b/dist/sql_query.js.map @@ -1 +1 @@ -{"version":3,"file":"sql_query.js","sourceRoot":"","sources":["sql_query.ts"],"names":["SqlQuery","SqlQuery.constructor","SqlQuery.replace","SqlQuery.columns","SqlQuery._columns","SqlQuery.rateColumns","SqlQuery.rate","SqlQuery._fromIndex","SqlQuery._rate","SqlQuery._applyTimeFilter","SqlQuery.getTimeSeries","SqlQuery.getTimeFilter","SqlQuery.convertTimestamp","SqlQuery.round","SqlQuery.convertInterval","SqlQuery.interpolateQueryExpr","SqlQuery.clickhouseOperator","SqlQuery.clickhouseEscape","SqlQuery.unescape"],"mappings":"AAAA,iFAAiF;;;QAO7E,mBAAmB;;;;;;;;;;;;;;;;YAAnB,mBAAmB,GAAG,yBAAyB,CAAC;YAEpD;gBAKEA,gBAAgBA;gBAChBA,kBAAYA,MAAMA,EAAEA,WAAYA,EAAEA,OAAQA;oBACxCC,IAAIA,CAACA,MAAMA,GAAGA,MAAMA,CAACA;oBACrBA,IAAIA,CAACA,WAAWA,GAAGA,WAAWA,CAACA;oBAC/BA,IAAIA,CAACA,OAAOA,GAAGA,OAAOA,CAACA;gBACzBA,CAACA;gBAECD,0BAAOA,GAAPA,UAAQA,OAAOA,EAAEA,YAAYA;oBACzBE,IAAIA,IAAIA,GAAGA,IAAIA,EACXA,KAAKA,GAAGA,IAAIA,CAACA,MAAMA,CAACA,KAAKA,EACzBA,OAAOA,GAAGA,IAAIA,iBAAOA,CAACA,KAAKA,CAACA,EAC5BA,YAAYA,GAAGA,IAAIA,CAACA,MAAMA,CAACA,YAAYA,GAAGA,IAAIA,CAACA,MAAMA,CAACA,YAAYA,GAAGA,UAAUA,EAC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,YAAYA,CAACA;oBAC1BA,IAAIA,UAAUA,GAAGA,KAAKA,CAACA,OAAOA,CAACA,MAAMA,CAACA,CAACA;oBACvCA,OAAOA,UAAUA,KAAKA,CAACA,CAACA,EAAEA,CAACA;wBACvBA,IAAIA,WAAWA,GAAGA,KAAKA,CAACA,OAAOA,CAACA,GAAGA,EAAEA,UAAUA,CAACA,CAACA;wBACjDA,EAAEA,CAAAA,CAACA,WAAWA,KAAKA,CAACA,CAACA,CAACA,CAACA,CAACA;4BACpBA,MAAMA,EAACA,OAAOA,EAAEA,qDAAqDA,GAAGA,KAAKA,CAACA,SAASA,CAACA,CAACA,EAAEA,UAAUA,CAACA,EAACA,CAACA;wBAC5GA,CAACA;wBACDA,IAAIA,GAAGA,GAAGA,KAAKA,CAACA,SAASA,CAACA,UAAUA,GAACA,MAAMA,CAACA,MAAMA,EAAEA,WAAWA,CAACA;6BAC3DA,IAAIA,EAAEA,CAACA;wBACZA,GAAGA,GAAGA,GAAGA,CAACA,OAAOA,CAACA,OAAOA,EAAEA,EAAEA,CAACA,CAACA;wBAC/BA,KAAKA,GAAGA,KAAKA,CAACA,SAASA,CAACA,CAACA,EAAEA,UAAUA,CAACA,GAAGA,GAAGA,GAAGA,KAAKA,CAACA,SAASA,CAACA,WAAWA,GAACA,CAACA,EAAEA,KAAKA,CAACA,MAAMA,CAACA,CAACA;wBAC5FA,UAAUA,GAAGA,KAAKA,CAACA,OAAOA,CAACA,YAAYA,CAACA,CAACA;oBAC7CA,CAACA;oBACDA,MAAMA,CAACA,KAAKA,CAAAA;gBAChBA,CAACA;gBACLlB,eAACA;YAADA,CAACA,AArVD,IAqVC;YArVD,8BAqVC,CAAA"} \ No newline at end of file +{"version":3,"file":"sql_query.js","sourceRoot":"","sources":["sql_query.ts"],"names":["SqlQuery","SqlQuery.constructor","SqlQuery.replace","SqlQuery.columns","SqlQuery._columns","SqlQuery.rateColumns","SqlQuery.rate","SqlQuery._fromIndex","SqlQuery._rate","SqlQuery._applyTimeFilter","SqlQuery.getTimeSeries","SqlQuery.getTimeFilter","SqlQuery.convertTimestamp","SqlQuery.round","SqlQuery.convertInterval","SqlQuery.interpolateQueryExpr","SqlQuery.clickhouseOperator","SqlQuery.clickhouseEscape","SqlQuery.unescape"],"mappings":"AAAA,iFAAiF;;;QAO7E,mBAAmB;;;;;;;;;;;;;;;;YAAnB,mBAAmB,GAAG,yBAAyB,CAAC;YAEpD;gBAKEA,gBAAgBA;gBAChBA,kBAAYA,MAAMA,EAAEA,WAAYA,EAAEA,OAAQA;oBACxCC,IAAIA,CAACA,MAAMA,GAAGA,MAAMA,CAACA;oBACrBA,IAAIA,CAACA,WAAWA,GAAGA,WAAWA,CAACA;oBAC/BA,IAAIA,CAACA,OAAOA,GAAGA,OAAOA,CAACA;gBACzBA,CAACA;gBAECD,0BAAOA,GAAPA,UAAQA,OAAOA,EAAEA,YAAYA;oBACzBE,IAAIA,IAAIA,GAAGA,IAAIA,EACXA,KAAKA,GAAGA,IAAIA,CAACA,MAAMA,CAACA,KAAKA,EACzBA,OAAOA,GAAGA,IAAIA,iBAAOA,CAACA,KAAKA,CAACA,EAC5BA,YAAYA,GAAGA,IAAIA,CAACA,MAAMA,CAACA,YAAYA,GAAGA,IAAIA,CAACA,MAAMA,CAACA,YAAYA,GAAGA,UAAUA,EAC/EA,IAAIA,GAAGA,QAAQA,CAACA,gBAAgBA,CAACA,QAAQA,CAACA,KAAKA,CAACA,IAAIA,CAACA,OAAOA,CAACA,KAAKA,CAACA,IAAIA,EAAEA,IAAIA,CAACA,MAAMA,CAACA,KAAKA,CAACA,CAACA,EAC5FA,EAAEA,GAAGA,QAAQA,CAACA,gBAAgBA,CAACA,QAAQA,CAACA,KAAKA,CAACA,IAAIA,CAACA,OAAOA,CAACA,KAAKA,CAACA,EAAEA,EAAEA,IAAIA,CAACA,MAAMA,CAACA,KAAKA,CAACA,CAACA,EACxFA,UAAUA,GAAGA,QAAQA,CAACA,aAAaA,CAACA,YAAYA,CAACA,EACjDA,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CAACA,MAAMA,CAACA,CAACA;oBACvCA,OAAOA,UAAUA,KAAKA,CAACA,CAACA,EAAEA,CAACA;wBACvBA,IAAIA,WAAWA,GAAGA,KAAKA,CAACA,OAAOA,CAACA,GAAGA,EAAEA,UAAUA,CAACA,CAACA;wBACjDA,EAAEA,CAAAA,CAACA,WAAWA,KAAKA,CAACA,CAACA,CAACA,CAACA,CAACA;4BACpBA,MAAMA,EAACA,OAAOA,EAAEA,qDAAqDA,GAAGA,KAAKA,CAACA,SAASA,CAACA,CAACA,EAAEA,UAAUA,CAACA,EAACA,CAACA;wBAC5GA,CAACA;wBACDA,IAAIA,GAAGA,GAAGA,KAAKA,CAACA,SAASA,CAACA,UAAUA,GAACA,MAAMA,CAACA,MAAMA,EAAEA,WAAWA,CAACA;6BAC3DA,IAAIA,EAAEA,CAACA;wBACZA,GAAGA,GAAGA,GAAGA,CAACA,OAAOA,CAACA,OAAOA,EAAEA,EAAEA,CAACA,CAACA;wBAC/BA,KAAKA,GAAGA,KAAKA,CAACA,SAASA,CAACA,CAACA,EAAEA,UAAUA,CAACA,GAAGA,GAAGA,GAAGA,KAAKA,CAACA,SAASA,CAACA,WAAWA,GAACA,CAACA,EAAEA,KAAKA,CAACA,MAAMA,CAACA,CAACA;wBAC5FA,UAAUA,GAAGA,KAAKA,CAACA,OAAOA,CAACA,YAAYA,CAACA,CAACA;oBAC7CA,CAACA;oBACDA,MAAMA,CAACA,KAAKA,CAAAA;gBAChBA,CAACA;gBACLlB,eAACA;YAADA,CAACA,AA9VD,IA8VC;YA9VD,8BA8VC,CAAA"} \ No newline at end of file diff --git a/dist/sql_query.ts b/dist/sql_query.ts index 782d004c3..868344808 100644 --- a/dist/sql_query.ts +++ b/dist/sql_query.ts @@ -38,6 +38,15 @@ export default class SqlQuery { } adhocFilters.forEach(function(af) { let parts = af.key.split('.'); + /* Wildcard table, substitute current target table */ + if (parts.length == 1) { + parts.unshift(self.target.table); + } + /* Wildcard database, substitute current target database */ + if (parts.length == 2) { + parts.unshift(self.target.database); + } + /* Expect fully qualified column name at this point */ if (parts.length < 3) { console.log("adhoc filters: filter " + af.key + "` has wrong format"); return @@ -64,7 +73,7 @@ export default class SqlQuery { query = SqlQuery.rate(query, ast); } } catch (err) { - console.log('AST parser error: ', err.message) + console.log('AST parser error: ', err) } query = this.templateSrv.replace(query, options.scopedVars, SqlQuery.interpolateQueryExpr); diff --git a/dist/sql_series.d.ts b/dist/sql_series.d.ts index 8bdb8ac12..7ed296b5d 100644 --- a/dist/sql_series.d.ts +++ b/dist/sql_series.d.ts @@ -1,5 +1,6 @@ export default class SqlSeries { series: any; + keys: any; meta: any; tillNow: any; from: any; diff --git a/dist/sql_series.js b/dist/sql_series.js index 3cbde123b..9748f2926 100644 --- a/dist/sql_series.js +++ b/dist/sql_series.js @@ -15,6 +15,7 @@ System.register(['lodash'], function(exports_1) { this.tillNow = options.tillNow; this.from = options.from; this.to = options.to; + this.keys = options.keys || []; } SqlSeries.prototype.toTable = function () { var self = this, data = []; @@ -47,12 +48,27 @@ System.register(['lodash'], function(exports_1) { } // timeCol have to be the first column always var timeCol = self.meta[0], metrics = {}, intervals = [], t; + var keyColumns = self.keys.filter(function (name) { return name != timeCol.name; }); lodash_1.default.each(self.series, function (series) { t = SqlSeries._formatValue(series[timeCol.name]); intervals.push(t); // rm time value from series delete series[timeCol.name]; + /* Build composite key (categories) from GROUP BY */ + var metricKey = null; + if (keyColumns.length > 0) { + metricKey = keyColumns.map(function (name) { return series[name]; }).join(', '); + keyColumns.forEach(function (name) { + delete series[name]; + }); + } lodash_1.default.each(series, function (val, key) { + /* If composite key is specified, e.g. 'category1', + * use it instead of the metric name, e.g. count() + */ + if (metricKey) { + key = metricKey; + } if (lodash_1.default.isArray(val)) { lodash_1.default.each(val, function (arr) { (metrics[arr[0]] = metrics[arr[0]] || {})[t] = arr[1]; diff --git a/dist/sql_series.js.map b/dist/sql_series.js.map index e6e234a0c..54f07430b 100644 --- a/dist/sql_series.js.map +++ b/dist/sql_series.js.map @@ -1 +1 @@ -{"version":3,"file":"sql_series.js","sourceRoot":"","sources":["sql_series.ts"],"names":["SqlSeries","SqlSeries.constructor","SqlSeries.toTable","SqlSeries.toTimeSeries","SqlSeries.extrapolate","SqlSeries._toJSType","SqlSeries._formatValue"],"mappings":";;;;;;;;;YAEA;gBAOIA,gBAAgBA;gBAChBA,mBAAYA,OAAOA;oBACfC,IAAIA,CAACA,MAAMA,GAAGA,OAAOA,CAACA,MAAMA,CAACA;oBAC7BA,IAAIA,CAACA,IAAIA,GAAGA,OAAOA,CAACA,IAAIA,CAACA;oBACzBA,IAAIA,CAACA,OAAOA,GAAGA,OAAOA,CAACA,OAAOA,CAACA;oBAC/BA,IAAIA,CAACA,IAAIA,GAAGA,OAAOA,CAACA,IAAIA,CAACA;oBACzBA,IAAIA,CAACA,EAAEA,GAAGA,OAAOA,CAACA,EAAEA,CAACA;gBACzBA,CAACA;gBAEDD,2BAAOA,GAAPA;oBACIE,IAAIA,IAAIA,GAAGA,IAAIA,EAAEA,IAAIA,GAAGA,EAAEA,CAACA;oBAC3BA,EAAEA,CAACA,CAACA,IAAIA,CAACA,MAAMA,CAACA,MAAMA,KAAKA,CAACA,CAACA,CAACA,CAACA;wBAC3BA,MAAMA,CAACA,IAAIA,CAACA;oBAChBA,CAACA;oBAEDA,IAAIA,OAAOA,GAAGA,EAAEA,CAACA;oBACjBA,gBAACA,CAACA,IAAIA,CAACA,IAAIA,CAACA,IAAIA,EAAEA,UAASA,GAAGA;wBAC1B,OAAO,CAAC,IAAI,CAAC,EAAC,MAAM,EAAE,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAC,CAAC,CAAA;oBAC3E,CAAC,CAACA,CAACA;oBAEHA,IAAIA,IAAIA,GAAGA,EAAEA,CAACA;oBACdA,gBAACA,CAACA,IAAIA,CAACA,IAAIA,CAACA,MAAMA,EAAEA,UAAUA,GAAGA;wBAC7B,IA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AACA,CAACA,CAACA,CAACA,CAACA,GAAGA,GAAGA,CAACA;wBACxEA,IAAIA,IAAIA,CAACA,CAACA;wBACVA,EAAEA,CAACA,CAACA,KAAKA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA;4BACdA,IAAIA,GAAGA,CAACA,CAACA;wBACbA,CAACA;wBACDA,UAAUA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA,GAAGA,UAAUA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,IAAIA,CAACA,CAACA;oBACrDA,CAACA;oBAEDA,EAAEA,CAACA,CAACA,aAAaA,GAAGA,6BAA6BA,CAACA,CAACA,CAACA;wBAChDA,IAAIA,GAAGA,CAACA,CAACA,UAAUA,CAACA,UAAUA,CAACA,MAAMA,GAACA,CAACA,CAACA,CAACA,CAACA,CAACA,GAAGA,UAAUA,CAACA,UAAUA,CAACA,MAAMA,GAACA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA,GAAGA,UAAUA,CAACA,UAAUA,CAACA,MAAMA,GAACA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA,GAAGA,GAAGA,CAACA;wBAC9HA,IAAIA,IAAIA,CAACA,CAACA;wBACVA,EAAEA,CAACA,CAACA,KAAKA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA;4BACdA,IAAIA,GAAGA,CAACA,CAACA;wBACbA,CAACA;wBACDA,UAAUA,CAACA,UAAUA,CAACA,MAAMA,GAACA,CAACA,CAACA,CAACA,CAACA,CAACA,GAAGA,UAAUA,CAACA,UAAUA,CAACA,MAAMA,GAACA,CAACA,CAACA,CAACA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,IAAIA,CAACA,CAACA;oBACzFA,CAACA;oBAEDA,MAAMA,CAACA,UAAUA,CAACA;gBACtBA,CAACA;;gBAEMJ,mBAASA,GAAhBA,UAAiBA,IAAQA;oBACrBK,MAAMA,CAACA,CAACA,IAAIA,CAACA,CAACA,CAACA;wBACXA,KAAKA,OAAOA,CAACA;wBACbA,KAAKA,QAAQA,CAACA;wBACdA,KAAKA,QAAQA,CAACA;wBACdA,KAAKA,QAAQA,CAACA;wBACdA,KAAKA,MAAMA,CAACA;wBACZA,KAAKA,OAAOA,CAACA;wBACbA,KAAKA,OAAOA,CAACA;wBACbA,KAAKA,OAAOA;4BACRA,MAAMA,CAACA,QAAQA,CAACA;wBACpBA;4BACIA,MAAMA,CAACA,QAAQA,CAAAA;oBACvBA,CAACA;gBACLA,CAACA;gBAEML,sBAAYA,GAAnBA,UAAoBA,KAASA;oBACzBM,EAAEA,CAACA,CAACA,KAAKA,KAAKA,IAAIA,CAACA,CAACA,CAACA;wBACjBA,MAAMA,CAACA,KAAKA,CAAAA;oBAChBA,CAACA;oBAEDA,IAAIA,OAAOA,GAAGA,MAAMA,CAACA,KAAKA,CAACA,CAACA;oBAC5BA,EAAEA,CAACA,CAACA,KAAKA,CAACA,OAAOA,CAACA,CAACA,CAACA,CAACA;wBACjBA,MAAMA,CAACA,KAAKA,CAAAA;oBAChBA,CAACA;oBAACA,IAAIA,CAACA,CAACA;wBACJA,MAAMA,CAACA,OAAOA,CAAAA;oBAClBA,CAACA;gBACLA,CAACA;;gBACLN,gBAACA;YAADA,CAACA,AAnJD,IAmJC;YAnJD,+BAmJC,CAAA"} \ No newline at end of file +{"version":3,"file":"sql_series.js","sourceRoot":"","sources":["sql_series.ts"],"names":["SqlSeries","SqlSeries.constructor","SqlSeries.toTable","SqlSeries.toTimeSeries","SqlSeries.extrapolate","SqlSeries._toJSType","SqlSeries._formatValue"],"mappings":";;;;;;;;;YAEA;gBAQIA,gBAAgBA;gBAChBA,mBAAYA,OAAOA;oBACfC,IAAIA,CAACA,MAAMA,GAAGA,OAAOA,CAACA,MAAMA,CAACA;oBAC7BA,IAAIA,CAACA,IAAIA,GAAGA,OAAOA,CAACA,IAAIA,CAACA;oBACzBA,IAAIA,CAACA,OAAOA,GAAGA,OAAOA,CAACA,OAAOA,C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A,CAACA;oBACTA,4EAA4EA;oBAC5EA,EAAEA,CAACA,CAACA,eAAeA,GAAGA,6BAA6BA,IAAIA,UAAUA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA,KAAKA,CAACA,CAACA,CAACA,CAACA;wBAC5EA,IAAIA,GAAGA,CAACA,CAACA,UAAUA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA,GAAGA,UAAUA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA,GAAGA,UAAUA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA,GAAGA,GAAGA,CAACA;wBACxEA,IAAIA,IAAIA,CAACA,CAACA;wBACVA,EAAEA,CAACA,CAACA,KAAKA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA;4BACdA,IAAIA,GAAGA,CAACA,CAACA;wBACbA,CAACA;wBACDA,UAAUA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA,GAAGA,UAAUA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,IAAIA,CAACA,CAACA;oBACrDA,CAACA;oBAEDA,EAAEA,CAACA,CAACA,aAAaA,GAAGA,6BAA6BA,CAACA,CAACA,CAACA;wBAChDA,IAAIA,GAAGA,CAACA,CAACA,UAAUA,CAACA,UAAUA,CAACA,MAAMA,GAACA,CAACA,CAACA,CAACA,CAACA,CAACA,GAAGA,UAAUA,CAACA,UAAUA,CAACA,MAAMA,GAACA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA,GAAGA,UAAUA,CAACA,UAAUA,CAACA,MAAMA,GAACA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA,GAAGA,GAAGA,CAACA;wBAC9HA,IAAIA,IAAIA,CAACA,CAACA;wBACVA,EAAEA,CAACA,CAACA,KAAKA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA;4BACdA,IAAIA,GAAGA,CAACA,CAACA;wBACbA,CAACA;wBACDA,UAAUA,CAACA,UAAUA,CAACA,MAAMA,GAACA,CAACA,CAACA,CAACA,CAACA,CAACA,GAAGA,UAAUA,CAACA,UAAUA,CAACA,MAAMA,GAACA,CAACA,CAACA,CAACA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,IAAIA,CAACA,CAACA;oBACzFA,CAACA;oBAEDA,MAAMA,CAACA,UAAUA,CAACA;gBACtBA,CAACA;;gBAEMJ,mBAASA,GAAhBA,UAAiBA,IAAQA;oBACrBK,MAAMA,CAACA,CAACA,IAAIA,CAACA,CAACA,CAACA;wBACXA,KAAKA,OAAOA,CAACA;wBACbA,KAAKA,QAAQA,CAACA;wBACdA,KAAKA,QAAQA,CAACA;wBACdA,KAAKA,QAAQA,CAACA;wBACdA,KAAKA,MAAMA,CAACA;wBACZA,KAAKA,OAAOA,CAACA;wBACbA,KAAKA,OAAOA,CAACA;wBACbA,KAAKA,OAAOA;4BACRA,MAAMA,CAACA,QAAQA,CAACA;wBACpBA;4BACIA,MAAMA,CAACA,QAAQA,CAAAA;oBACvBA,CAACA;gBACLA,CAACA;gBAEML,sBAAYA,GAAnBA,UAAoBA,KAASA;oBACzBM,EAAEA,CAACA,CAACA,KAAKA,KAAKA,IAAIA,CAACA,CAACA,CAACA;wBACjBA,MAAMA,CAACA,KAAKA,CAAAA;oBAChBA,CAACA;oBAEDA,IAAIA,OAAOA,GAAGA,MAAMA,CAACA,KAAKA,CAACA,CAACA;oBAC5BA,EAAEA,CAACA,CAACA,KAAKA,CAACA,OAAOA,CAACA,CAACA,CAACA,CAACA;wBACjBA,MAAMA,CAACA,KAAKA,CAAAA;oBAChBA,CAACA;oBAACA,IAAIA,CAACA,CAACA;wBACJA,MAAMA,CAACA,OAAOA,CAAAA;oBAClBA,CAACA;gBACLA,CAACA;;gBACLN,gBAACA;YAADA,CAACA,AArKD,IAqKC;YArKD,+BAqKC,CAAA"} \ No newline at end of file diff --git a/dist/sql_series.ts b/dist/sql_series.ts index 89d21e0d7..8edf445f0 100644 --- a/dist/sql_series.ts +++ b/dist/sql_series.ts @@ -2,6 +2,7 @@ import _ from 'lodash'; export default class SqlSeries { series: any; + keys: any; meta: any; tillNow: any; from: any; @@ -14,6 +15,7 @@ export default class SqlSeries { this.tillNow = options.tillNow; this.from = options.from; this.to = options.to; + this.keys = options.keys || []; } toTable():any { @@ -53,12 +55,28 @@ export default class SqlSeries { // timeCol have to be the first column always let timeCol = self.meta[0], metrics = {}, intervals = [], t; + let keyColumns = self.keys.filter(name => name != timeCol.name); _.each(self.series, function(series) { t = SqlSeries._formatValue(series[timeCol.name]); intervals.push(t); // rm time value from series delete series[timeCol.name]; + /* Build composite key (categories) from GROUP BY */ + let metricKey = null; + if (keyColumns.length > 0) { + metricKey = keyColumns.map(name => series[name]).join(', '); + keyColumns.forEach(name => { + delete series[name]; + }); + } + _.each(series, function(val, key) { + /* If composite key is specified, e.g. 'category1', + * use it instead of the metric name, e.g. count() + */ + if (metricKey) { + key = metricKey; + } if (_.isArray(val)) { _.each(val, function(arr) { (metrics[arr[0]] = metrics[arr[0]] || {})[t] = arr[1]; diff --git a/src/adhoc.ts b/src/adhoc.ts index 6e7d7f88d..824155102 100644 --- a/src/adhoc.ts +++ b/src/adhoc.ts @@ -1,4 +1,5 @@ -const columnsQuery = "SELECT database, table, name, type FROM system.columns where database != 'system' ORDER BY database, table"; +const queryFilter = "database != 'system'" +const columnsQuery = "SELECT database, table, name, type FROM system.columns WHERE {filter} ORDER BY database, table"; const regexEnum = /'(?:[^']+|'')+'/gmi; export default class AdhocCtrl { @@ -16,10 +17,19 @@ export default class AdhocCtrl { if (this.tagKeys.length > 0) { return Promise.resolve(this.tagKeys); } - return datasource.metricFindQuery(columnsQuery) + let filter = queryFilter; + if (datasource.defaultDatabase.length > 0) { + filter = "database = '" + datasource.defaultDatabase + "' AND " + queryFilter; + } + let query = columnsQuery.replace('{filter}', queryFilter); + return datasource.metricFindQuery(query) .then(function(response){ + let columnNames = {}; response.forEach(function(item){ - let text = item.database + '.' + item.table + '.' + item.name; + let text = item.table + '.' + item.name; + if (datasource.defaultDatabase.length == 0) { + text = item.database + '.' + text; + } let value = item.name; self.tagKeys.push({text: text, value: value}); if (item.type.slice(0, 4) === 'Enum') { @@ -29,8 +39,14 @@ export default class AdhocCtrl { options.forEach(function(o) { self.tagValues[text].push({text: o, value: o}) }) + self.tagValues[item.name] = self.tagValues[text]; } } + columnNames[item.name] = true; + }); + /* Store unique column names with wildcard table */ + Object.keys(columnNames).forEach(columnName => { + self.tagKeys.push({text: columnName, value: columnName}); }); return Promise.resolve(self.tagKeys); }); diff --git a/src/datasource.ts b/src/datasource.ts index 14aaaa1d4..83d169bb5 100644 --- a/src/datasource.ts +++ b/src/datasource.ts @@ -6,6 +6,7 @@ import SqlSeries from './sql_series'; import SqlQuery from './sql_query'; import ResponseParser from './response_parser'; import AdhocCtrl from './adhoc'; +import Scanner from './scanner'; export class ClickHouseDatasource { type: string; @@ -16,6 +17,7 @@ export class ClickHouseDatasource { basicAuth: any; withCredentials: any; usePOST: boolean; + defaultDatabase: string; addCorsHeader: boolean; responseParser: any; adhocCtrl: AdhocCtrl; @@ -35,6 +37,7 @@ export class ClickHouseDatasource { this.withCredentials = instanceSettings.withCredentials; this.addCorsHeader = instanceSettings.jsonData.addCorsHeader; this.usePOST = instanceSettings.jsonData.usePOST; + this.defaultDatabase = instanceSettings.jsonData.defaultDatabase || ''; this.adhocCtrl = new AdhocCtrl(); } @@ -75,13 +78,20 @@ export class ClickHouseDatasource { query(options) { var queries = [], q, - adhocFilters = this.templateSrv.getAdhocFilters(this.name); + adhocFilters = this.templateSrv.getAdhocFilters(this.name), + keyColumns = []; _.map(options.targets, (target) => { if (!target.hide && target.query) { var queryModel = new SqlQuery(target, this.templateSrv, options); q = queryModel.replace(options, adhocFilters); queries.push(q); + try { + let queryAST = new Scanner(q).toAST(); + keyColumns.push(queryAST['group by'] || []); + } catch (err) { + console.log('AST parser error: ', err) + } } }); @@ -101,6 +111,8 @@ export class ClickHouseDatasource { var result = [], i = 0; _.each(responses, (response) => { var target = options.targets[i]; + var keys = keyColumns[i]; + i++; if (!response || !response.rows) { return; @@ -109,6 +121,7 @@ export class ClickHouseDatasource { var sqlSeries = new SqlSeries({ series: response.data, meta: response.meta, + keys: keys, tillNow: options.rangeRaw.to === 'now', from: SqlQuery.convertTimestamp(options.range.from), to: SqlQuery.convertTimestamp(options.range.to) diff --git a/src/partials/config.html b/src/partials/config.html index 57a9a6ff2..13084bfa4 100644 --- a/src/partials/config.html +++ b/src/partials/config.html @@ -4,18 +4,28 @@

Additional

- + checked="ctrl.current.jsonData.addCorsHeader" label-class="width-25" switch-class="max-width-5">
- + checked="ctrl.current.jsonData.usePOST" label-class="width-25" switch-class="max-width-5">
+ +
+
+ Default database + + + If you set default database for this datasource, it will be prefilled in the query builder, and used to make ad-hoc filters more convenient. + +
+
\ No newline at end of file diff --git a/src/query_ctrl.ts b/src/query_ctrl.ts index 9cd102587..6208bc809 100644 --- a/src/query_ctrl.ts +++ b/src/query_ctrl.ts @@ -47,8 +47,12 @@ class SqlQueryCtrl extends QueryCtrl { this.queryModel = new SqlQuery(this.target, templateSrv, this.panel.scopedVars); + let defaultDatabaseSegment = {fake: true, value: '-- database --'}; + if (this.datasource.defaultDatabase.length > 0) { + defaultDatabaseSegment = {fake: false, value: this.datasource.defaultDatabase}; + } this.databaseSegment = uiSegmentSrv.newSegment( - this.target.database || {fake: true, value: '-- database --'} + this.target.database || defaultDatabaseSegment ); this.tableSegment = uiSegmentSrv.newSegment( @@ -89,6 +93,11 @@ class SqlQueryCtrl extends QueryCtrl { if (this.target.query === defaultQuery) { this.target.query = this.format(); } + + /* Update database if default database is used to prepopulate the field */ + if (this.target.database === undefined && !defaultDatabaseSegment.fake) { + this.databaseChanged(); + } } getCollapsedText() { diff --git a/src/sql_query.ts b/src/sql_query.ts index 3d87b7bea..868344808 100644 --- a/src/sql_query.ts +++ b/src/sql_query.ts @@ -38,6 +38,15 @@ export default class SqlQuery { } adhocFilters.forEach(function(af) { let parts = af.key.split('.'); + /* Wildcard table, substitute current target table */ + if (parts.length == 1) { + parts.unshift(self.target.table); + } + /* Wildcard database, substitute current target database */ + if (parts.length == 2) { + parts.unshift(self.target.database); + } + /* Expect fully qualified column name at this point */ if (parts.length < 3) { console.log("adhoc filters: filter " + af.key + "` has wrong format"); return diff --git a/src/sql_series.ts b/src/sql_series.ts index 89d21e0d7..8edf445f0 100644 --- a/src/sql_series.ts +++ b/src/sql_series.ts @@ -2,6 +2,7 @@ import _ from 'lodash'; export default class SqlSeries { series: any; + keys: any; meta: any; tillNow: any; from: any; @@ -14,6 +15,7 @@ export default class SqlSeries { this.tillNow = options.tillNow; this.from = options.from; this.to = options.to; + this.keys = options.keys || []; } toTable():any { @@ -53,12 +55,28 @@ export default class SqlSeries { // timeCol have to be the first column always let timeCol = self.meta[0], metrics = {}, intervals = [], t; + let keyColumns = self.keys.filter(name => name != timeCol.name); _.each(self.series, function(series) { t = SqlSeries._formatValue(series[timeCol.name]); intervals.push(t); // rm time value from series delete series[timeCol.name]; + /* Build composite key (categories) from GROUP BY */ + let metricKey = null; + if (keyColumns.length > 0) { + metricKey = keyColumns.map(name => series[name]).join(', '); + keyColumns.forEach(name => { + delete series[name]; + }); + } + _.each(series, function(val, key) { + /* If composite key is specified, e.g. 'category1', + * use it instead of the metric name, e.g. count() + */ + if (metricKey) { + key = metricKey; + } if (_.isArray(val)) { _.each(val, function(arr) { (metrics[arr[0]] = metrics[arr[0]] || {})[t] = arr[1];