This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Retention(RetentionPolicy.RUNTIME) | |
@Target({ElementType.FIELD}) | |
public @interface ColumnField { | |
/** | |
* field data types enum | |
*/ | |
enum FieldType { | |
STRING, BOOLEAN, LONG, INTEGER, OBJECT | |
} | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- Phoenix SQL query on the agent metrics table for processing the following Analytics API call | |
-- | |
-- https://../agent?from=2018-10-02T00:00:00&to=2018-10-09T00:00:00&granularity=daily&timezone=Asia/Kolkata&limit=1000 | |
-- &next_key=BASE64(1234cdgd67-bc123-73dbsd37;0;hscustomer_agent_bcdre432dc) | |
-- | |
-- where 1234cdgd67-bc123-73dbsd37 is CURSOR_ID, 0 is CURRENT OFFSET and hscustomer_agent_bcdre432dc is the current cursor agent ID | |
-- | |
SELECT agentId, | |
TO_CHAR(CONVERT_TIMEZONE(time_bucket, 'Etc/UTC', 'Asia/Kolkata'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- RVC (Row Value Constructor) query doing a range scan | |
-- using composite primary key columns for start and end row marker | |
-- | |
SELECT * FROM issue_metrics_table | |
WHERE (customer_name, created_at, issueId) | |
BETWEEN ('hscustomer','2018–10–01–1030','451') AND | |
('hscustomer','2018–10–11–1230') | |
LIMIT 1001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- Using LIMIT OFFSET for getting the second | |
-- page of the SQL query | |
-- | |
SELECT agentId, | |
TO_CHAR(CONVERT_TIMEZONE(time_bucket, 'Etc/UTC', 'Asia/Kolkata'), | |
'yyyy-MM-dd\'T\'00:00:00') AS time, | |
SUM(ttfr), | |
SUM(ttr), | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT agentId, | |
TO_CHAR(CONVERT_TIMEZONE(time_bucket, 'Etc/UTC', 'Asia/Kolkata'), | |
'yyyy-MM-dd\'T\'00:00:00') AS time, | |
SUM(ttfr), | |
SUM(ttr), | |
... | |
... | |
AVG(csat) | |
FROM agent_metrics_table | |
WHERE customer_name = 'hscustomer' AND |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- Phoenix SQL query on the agent metrics table for processing the following Analytics API call | |
-- https://../agent?from=2018-10-02T00:00:00&to=2018-10-09T00:00:00&granularity=daily&timezone=Asia/Kolkata&limit=1000 | |
-- | |
SELECT agentId, | |
TO_CHAR(CONVERT_TIMEZONE(time_bucket, 'Etc/UTC', 'Asia/Kolkata'), | |
'yyyy-MM-dd\'T\'00:00:00') AS time, | |
SUM(ttfr), | |
SUM(ttr), | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* WHY SQL? | |
**/ | |
"SELECT * FROM foo WHERE bar > 30" | |
"versus" | |
HTable t = new HTable("foo"); | |
RegionScanner s = t.getScanner(new Scan(.., |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/analytics/support/?granularity=hourly | |
&from=2019–01–01T00:00:00 | |
&to=2019–05–01T00:00:00 --Default Timezone UTC | |
&aggregate-on=app&aggregate-on=platform_type --Custom pivots) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"results":[ | |
{ | |
"time":"2019-01-01T00:00:00", | |
"agentid":"hscustomer_agent_bcgh632", | |
"ttfr":580040, | |
"ttr":685070, | |
.. | |
.. | |
"csat":5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/analytics/agent/?granularity=daily --Custom time granularity | |
&from=2019-01-01T00:00:00 --Time range start | |
&to=2019-05-01T00:00:00 --Time range end | |
&timezone=Asia/Kolkata&limit=1000 --Custom time zone |