Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

- QueryEngine - druid/cassandra/ES

- ExecutionFrequency - DailyDAILY/WeeklyWEEKLY/MonthlyMONTHLY

- ChannelId

- ReportInterval

...

  • Request Object

    Code Block
    language
    themeRDark
    borderStylesolid
    linenumberstrue
    collapsefalse
     {
      "id":"sunbird.analytics.report.submit",
      "ver":"1.0",
      "ts":"2019-03-07T12:40:40+05:30",
      "params":{
         "msgid":"4406df37-cd54-4d8a-ab8d-3939e0223580",
         "client_key":"analytics-team"
      },
      "request":{
         "channel_id":"in.ekstep",
         "report_name":"avg_collection_downloads",
         "query_engine": "druid",
         "execution_frequency": "DailyDAILY",
         "report_interval":"LAST_7_DAYS",
         "output_format": "json"
         "query_json":{
            "queryType":"groupBy",
            "dataSource":"telemetry-events",
            "granularity":"day",
            "dimensions":[
               "eid"
            ],
            "aggregations":[
               { "type":"count", "name":"context_did", fieldName":"context_did" }
            ],
            "filter":{
               "type":"and",
               "fields":[
                  { "type":"selector", "name":"eid", fieldName":"IMPRESSION" },
                  { "type":"selector", "name":"edata_type", fieldName":"detail" },
                  { "type":"selector", "name":"edata_pageid", fieldName":"collection-detail" },
                  { "type":"selector", "name":"context_pdata_id", fieldName":"prod.diksha.app" }
               ]
            },
            "postAggregations":[
               {
                  "type":"arithmetic",
                  "name":"avg__edata_value",
                  "fn":"/",
                  "fields":[
                     { "type":"fieldAccess", "name":"total_edata_value", "fieldName":"total_edata_value" },
                     { "type":"fieldAccess", "name":"rows", "fieldName":"rows" }
                  ]
               }
            ],
            "intervals":[
               "2019-02-20T00:00:00.000/2019-01-27T23:59:59.000"
            ]
         }
      }
     }
     


  • Output:

The individual report configurations can be saved to a Cassandra table. The druid query JSON will be saved to Azure blob storage and the following will be the fields in the report configuration table.

Code Block
themeRDark
borderStylesolid
   # Schema of table
   TABLE platform_db.druid_report_config (
     report_id text,
     report_name text,
     report_interval text,
     query_engine text,
     execution_frequency text,
     is_enabled boolean,
     report_query_location text,
     report_output_format text,
     report_output_location text,
     report_output_filename text,
     PRIMARY KEY (report_id) );
   )


  • Output location Location and file format of query in azure:

    Code Block
    themeRDark
    borderStylesolid
    /druid-reports/query/druid/report-id.json
    /druid-reports/query/cassandra/report-id.cql
    


...