ritik02 edited a comment on issue #6977: Design of MaterializedViewQuery
URL: https://github.com/apache/druid/issues/6977#issuecomment-582742602
 
 
   BaseDatasource - Prebid_Auction_Participants
   
   >  SpecSheet - {
   
       "type": "kafka",
       "dataSchema": {
           "dataSource": "Prebid_Auction_Participants",
           "parser": {
               "parseSpec": {
                   "dimensionsSpec": {
                       "dimensions": [
                           "dn",
                           "cid",
                           "cc",
                           "abte",
                           "pvid",
                           "crid",
                           "s",
                           "di",
                           "dt",
                           "dtc",
                           "wsip",
                           "size",
                           "ckfl",
                           "act",
                           "lper",
                           "dbf",
                           "dfpbd",
                           "cs",
                           "iwb",
                           "prspt",
                           "sbdrid",
                           "bbdrid",
                           "nbr",
                           "abs",
                           "toconsider",
                           "tref",
                           "rfc",
                           "g",
                           "udbg",
                           "itype",
                           "ptype",
                           "exid",
                           "sckfl",
                           "mnet_ckfl",
                           "slotVisibility",
                           "sc",
                           "mnrf",
                           "csip",
                           "pid",
                           "bfs",
                           "apid",
                           "fpuReq",
                           "gdpr",
                           "seat",
                           "viewability",
                           "app",
                           "sat",
                           "dfpDiv",
                           "appname",
                           "stagid",
                           "mx_bsProfile",
                           "mx_bsBucket",
                           "rtype",
                           "apTags",
                           "apActs",
                           "yErpmFlag",
                           "spIvt",
                           "spID",
                           "ugd",
                           "apPrfs",
                           "spIsReq",
                           "spFst",
                           "yob",
                           "smsrc",
                           "svr",
                           "__bid",
                           "__oid",
                           "__dtype",
                           "strg",
                           "mnrfc",
                           "mx_dgf",
                           "pgcatiab",
                           "dStat",
                           "smbrid",
                           "dcs",
                           "psrc",
                           "pgcatiab2",
                           "pgcatsprig",
                           "adtypes",
                           "acsn",
                           "csex",
                           "mx_aqcpl_crid",
                           "cxtSgmt",
                           "cliIPType",
                           "pc",
                           "vls",
                           "mx_SD",
                           "usp_status",
                           "usp_enf",
                           "usp_string",
                           "usp_ldf",
                           "ufca",
                           "exp",
                           "gdpr_enf",
                           "gdfstr"
                       ]
                   },
                   "timestampSpec": {
                       "column": "time_stamp",
                       "format": "yyyy-MM-dd HH:mm:ss"
                   },
                   "format": "json"
               },
               "type": "string"
           },
           "metricsSpec": [
               {
                   "type": "count",
                   "name": "m_count_responses"
               },
               {
                   "type": "javascript",
                   "name": "m_count",
                   "fieldNames": [
                       "lper"
                   ],
                   "fnAggregate": "function(current,lper)     { var m_lper = 
isNaN(parseInt(lper)) ? 1 : parseInt(lper); return current+m_lper; }",
                   "fnReset": "function()                         { return 0;}",
                   "fnCombine": "function(partialA, partialB)      {return 
partialA+partialB;}"
               },
               {
                   "type": "javascript",
                   "name": "m_cbdp",
                   "fieldNames": [
                       "lper",
                       "cbdp"
                   ],
                   "fnAggregate": "function(current,lper,cbdp)     { var m_lper 
= isNaN(parseInt(lper)) ? 1 : parseInt(lper); var m_cbdp = 
isNaN(parseFloat(cbdp))?0:parseFloat(cbdp); return current + m_lper*m_cbdp;}",
                   "fnReset": "function() { return 0;}",
                   "fnCombine": "function(partialA, partialB) { return partialA 
+ partialB; }"
               },
               {
                   "type": "javascript",
                   "name": "m_obdp",
                   "fieldNames": [
                       "lper",
                       "ogbdp"
                   ],
                   "fnAggregate": "function(current,lper,ogbdp)     { var 
m_lper = isNaN(parseInt(lper)) ? 1 : parseInt(lper); var m_ogbdp = 
isNaN(parseFloat(ogbdp)) ? 0 : parseFloat(ogbdp); return current + 
m_lper*m_ogbdp;}",
                   "fnReset": "function() { return 0;}",
                   "fnCombine": "function(partialA, partialB) { return partialA 
+ partialB; }"
               },
               {
                   "type": "javascript",
                   "name": "m_bidflr",
                   "fieldNames": [
                       "lper",
                       "bidflr"
                   ],
                   "fnAggregate": "function(current,lper,bidflr)     { var 
m_lper = isNaN(parseInt(lper)) ? 1 : parseInt(lper); var m_bidflr = 
isNaN(parseFloat(bidflr)) ? 0 : parseFloat(bidflr); return current + 
m_lper*m_bidflr;}",
                   "fnReset": "function() { return 0;}",
                   "fnCombine": "function(partialA, partialB) { return partialA 
+ partialB; }"
               },
               {
                   "type": "javascript",
                   "name": "m_pbidflr",
                   "fieldNames": [
                       "lper",
                       "pbidflr"
                   ],
                   "fnAggregate": "function(current,lper,pbidflr)     { var 
m_lper = isNaN(parseInt(lper)) ? 1 : parseInt(lper); var m_pbidflr = 
isNaN(parseFloat(pbidflr)) ? 0 : parseFloat(pbidflr); return current + 
m_lper*m_pbidflr;}",
                   "fnReset": "function() { return 0;}",
                   "fnCombine": "function(partialA, partialB) { return partialA 
+ partialB; }"
               },
               {
                   "type": "javascript",
                   "name": "m_opbidflr",
                   "fieldNames": [
                       "lper",
                       "opbidflr"
                   ],
                   "fnAggregate": "function(current,lper,opbidflr)     { var 
m_lper = isNaN(parseInt(lper)) ? 1 : parseInt(lper); var m_opbidflr = 
isNaN(parseFloat(opbidflr)) ? 0 : parseFloat(opbidflr); return current + 
m_lper*m_opbidflr;}",
                   "fnReset": "function() { return 0;}",
                   "fnCombine": "function(partialA, partialB) { return partialA 
+ partialB; }"
               },
               {
                   "type": "javascript",
                   "name": "m_filteredsumactltime",
                   "fieldNames": [
                       "lper",
                       "actltime"
                   ],
                   "fnAggregate": "function(current,lper,actltime)     { var 
m_lper = isNaN(parseInt(lper)) ? 1 : parseInt(lper); 
actltime=parseFloat(actltime); if (actltime>=0 && actltime <=20000) return 
current + m_lper*actltime; else return current; }",
                   "fnReset": "function()                         { return 0;}",
                   "fnCombine": "function(partialA, partialB)      {return 
partialA+partialB;}"
               },
               {
                   "type": "javascript",
                   "name": "m_filteredsumltime",
                   "fieldNames": [
                       "lper",
                       "ltime"
                   ],
                   "fnAggregate": "function(current,lper,ltime)     { var 
m_lper = isNaN(parseInt(lper)) ? 1 : parseInt(lper); ltime=parseFloat(ltime); 
if (ltime>=0 && ltime <=20000) return current + m_lper*ltime; else return 
current; }",
                   "fnReset": "function()                         { return 0;}",
                   "fnCombine": "function(partialA, partialB)      {return 
partialA+partialB;}"
               },
               {
                   "type": "javascript",
                   "name": "m_rtime",
                   "fieldNames": [
                       "lper",
                       "rtime"
                   ],
                   "fnAggregate": "function(current,lper,rtime)     { var 
m_lper = isNaN(parseInt(lper)) ? 1 : parseInt(lper); rtime=parseFloat(rtime); 
if (rtime>=0 && rtime <=20000) return current+ m_lper*rtime; else return 
current; }",
                   "fnReset": "function()                         { return 0;}",
                   "fnCombine": "function(partialA, partialB)      {return 
partialA+partialB;}"
               },
               {
                   "type": "javascript",
                   "name": "m_dspltime",
                   "fieldNames": [
                       "lper",
                       "dspltime"
                   ],
                   "fnAggregate": "function(current,lper,dspltime)     { var 
m_lper = isNaN(parseInt(lper)) ? 1 : parseInt(lper); 
dspltime=parseFloat(dspltime); if (dspltime>=0 && dspltime <=50000) return 
current+ m_lper*dspltime; else return current; }",
                   "fnReset": "function()                         { return 0;}",
                   "fnCombine": "function(partialA, partialB)      {return 
partialA+partialB;}"
               },
               {
                   "type": "javascript",
                   "name": "m_bdp",
                   "fieldNames": [
                       "lper",
                       "bdp"
                   ],
                   "fnAggregate": "function(current,lper,bdp)     { var m_lper 
= isNaN(parseInt(lper)) ? 1 : parseInt(lper); var m_bdp = 
isNaN(parseFloat(bdp)) ? 0 : parseFloat(bdp); if(m_bdp>=0) return 
current+m_bdp*m_lper; else return current; }",
                   "fnReset": "function()                         { return 0;}",
                   "fnCombine": "function(partialA, partialB)      {return 
partialA+partialB;}"
               },
               {
                   "type": "javascript",
                   "name": "m_dfpBd",
                   "fieldNames": [
                       "lper",
                       "dfpBd"
                   ],
                   "fnAggregate": "function(current,lper,dfpBd)     { var 
m_lper = isNaN(parseInt(lper)) ? 1 : parseInt(lper); var m_dfpBd = 
isNaN(parseFloat(dfpBd)) ? 0 : parseFloat(dfpBd); return current + m_lper * 
m_dfpBd;}",
                   "fnReset": "function() { return 0;}",
                   "fnCombine": "function(partialA, partialB) { return partialA 
+ partialB; }"
               },
               {
                   "type": "javascript",
                   "name": "m_ttfd",
                   "fieldNames": [
                       "lper",
                       "ttfd"
                   ],
                   "fnAggregate": "function(current,lper,ttfd)     { var m_lper 
= isNaN(parseInt(lper)) ? 1 : parseInt(lper); var m_ttfd = 
isNaN(parseFloat(ttfd)) ? 0 : parseFloat(ttfd); return current + m_lper * 
m_ttfd;}",
                   "fnReset": "function() { return 0;}",
                   "fnCombine": "function(partialA, partialB) { return partialA 
+ partialB; }"
               },
               {
                   "type": "javascript",
                   "name": "m_ybnca_erpm",
                   "fieldNames": [
                       "lper",
                       "ybnca_erpm"
                   ],
                   "fnAggregate": "function(current,lper,ybnca_erpm)     { var 
m_lper = isNaN(parseInt(lper)) ? 1 : parseInt(lper); var m_ybnca_erpm = 
isNaN(parseFloat(ybnca_erpm)) ? 0 : parseFloat(ybnca_erpm); if(m_ybnca_erpm>=0) 
return current+m_ybnca_erpm*m_lper; else return current; }",
                   "fnReset": "function()                         { return 0;}",
                   "fnCombine": "function(partialA, partialB)      {return 
partialA+partialB;}"
               },
               {
                   "type": "doubleSum",
                   "name": "m_ecp",
                   "fieldName": "ecp",
                   "expression": null
               },
               {
                   "type": "javascript",
                   "name": "m_mx_aurt",
                   "fieldNames": [
                       "lper",
                       "mx_aurt"
                   ],
                   "fnAggregate": "function(current,lper,mx_aurt)     { var 
m_lper = isNaN(parseInt(lper)) ? 1 : parseInt(lper); var m_mx_aurt = 
isNaN(parseFloat(mx_aurt)) ? 0 : parseFloat(mx_aurt); return 
current+m_mx_aurt*m_lper; }",
                   "fnReset": "function()                         { return 0;}",
                   "fnCombine": "function(partialA, partialB)      {return 
partialA+partialB;}"
               }
           ],
           "granularitySpec": {
               "type": "uniform",
               "segmentGranularity": "HOUR",
               "queryGranularity": "MINUTE",
               "rollup": true,
               "intervals": null
           },
           "transformSpec": {
               "filter": null,
               "transforms": []
           }
       },
       "tuningConfig": {
           "type": "kafka",
           "maxRowsInMemory": 1000000000,
           "maxBytesInMemory": 536870912,
           "maxRowsPerSegment": 1000000000,
           "maxTotalRows": null,
           "intermediatePersistPeriod": "PT20M",
           "basePersistDirectory": "/tmp/1550676580622-0",
           "maxPendingPersists": 0,
           "indexSpec": {
               "bitmap": {
                   "type": "concise"
               },
               "dimensionCompression": "lz4",
               "metricCompression": "lz4",
               "longEncoding": "longs"
           },
           "buildV9Directly": true,
           "reportParseExceptions": false,
           "handoffConditionTimeout": 0,
           "resetOffsetAutomatically": true,
           "segmentWriteOutMediumFactory": null,
           "workerThreads": null,
           "chatThreads": null,
           "chatRetries": 8,
           "httpTimeout": "PT10S",
           "shutdownTimeout": "PT80S",
           "offsetFetchPeriod": "PT10S",
           "intermediateHandoffPeriod": "P2147483647D",
           "logParseExceptions": true,
           "maxParseExceptions": 2147483647,
           "maxSavedParseExceptions": 0
       },
       "ioConfig": {
           "topicRegex": "c[0-9]*\\.prebid_auction_participants(.*)",
           "replicas": 1,
           "taskCount": 42,
           "taskDuration": "PT10800S",
           "consumerProperties": {
               "bootstrap.servers": 
"c8-logging-kafka-5-prod.srv.media.net:9092,c8-logging-kafka-6-prod.srv.media.net:9092,c8-logging-kafka-7-prod.srv.media.net:9092,c8-logging-kafka-8-prod.srv.media.net:9092,c8-logging-kafka-9-prod.srv.media.net:9092,c8-logging-kafka-10-prod.srv.media.net:9092,c8-logging-kafka-11-prod.srv.media.net:9092"
           },
           "startDelay": "PT5S",
           "period": "PT30S",
           "useEarliestOffset": false,
           "completionTimeout": "PT7200S",
           "lateMessageRejectionPeriod": "PT7200S",
           "earlyMessageRejectionPeriod": null,
           "skipOffsetGaps": true
       },
       "context": {
           "druid.indexer.fork.property.druid.processing.buffer.sizeBytes": 
134217728,
           "druid.indexer.fork.property.druid.processing.numThreads": 4,
           "druid.indexer.runner.javaOpts": "-server -Xms1g -Xmx5g 
-XX:MaxDirectMemorySize=5g -XX:+UnlockDiagnosticVMOptions 
-XX:+PrintGCApplicationStoppedTime -XX:+PrintGCApplicationConcurrentTime 
-XX:+PrintSafepointStatistics  -XX:PrintSafepointStatisticsCount=1 
-XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintFlagsFinal 
-XX:+PrintReferenceGC -XX:+UseG1GC  -XX:InitiatingHeapOccupancyPercent=50 
-XX:-UseBiasedLocking -XX:ParallelGCThreads=5 -XX:ConcGCThreads=1",
           "druid.indexer.fork.property.druid.processing.numMergeBuffers": 1
       },
       "suspended": false
   }
   ---------------
   Derived Datasource - Prebid_Auction_Participants_MView
   SpecSheet - 
   
   > {
   
       "type": "derivativeDataSource",
       "baseDataSource": "Prebid_Auction_Participants",
       "dimensionsSpec": {
           "dimensions": [
               {
                   "type": "string",
                   "name": "pvid",
                   "multiValueHandling": "SORTED_ARRAY",
                   "createBitmapIndex": true
               },
               {
                   "type": "string",
                   "name": "itype",
                   "multiValueHandling": "SORTED_ARRAY",
                   "createBitmapIndex": true
               },
               {
                   "type": "string",
                   "name": "cid",
                   "multiValueHandling": "SORTED_ARRAY",
                   "createBitmapIndex": true
               },
               {
                   "type": "string",
                   "name": "crid",
                   "multiValueHandling": "SORTED_ARRAY",
                   "createBitmapIndex": true
               },
               {
                   "type": "string",
                   "name": "nbr",
                   "multiValueHandling": "SORTED_ARRAY",
                   "createBitmapIndex": true
               },
               {
                   "type": "string",
                   "name": "dn",
                   "multiValueHandling": "SORTED_ARRAY",
                   "createBitmapIndex": true
               },
               {
                   "type": "string",
                   "name": "dtc",
                   "multiValueHandling": "SORTED_ARRAY",
                   "createBitmapIndex": true
               },
               {
                   "type": "string",
                   "name": "abte",
                   "multiValueHandling": "SORTED_ARRAY",
                   "createBitmapIndex": true
               },
               {
                   "type": "string",
                   "name": "sc",
                   "multiValueHandling": "SORTED_ARRAY",
                   "createBitmapIndex": true
               },
               {
                   "type": "string",
                   "name": "s",
                   "multiValueHandling": "SORTED_ARRAY",
                   "createBitmapIndex": true
               },
               {
                   "type": "string",
                   "name": "cc",
                   "multiValueHandling": "SORTED_ARRAY",
                   "createBitmapIndex": true
               },
               {
                   "type": "string",
                   "name": "size",
                   "multiValueHandling": "SORTED_ARRAY",
                   "createBitmapIndex": true
               },
               {
                   "type": "string",
                   "name": "usp_string",
                   "multiValueHandling": "SORTED_ARRAY",
                   "createBitmapIndex": true
               },
               {
                   "type": "string",
                   "name": "strg",
                   "multiValueHandling": "SORTED_ARRAY",
                   "createBitmapIndex": true
               },
               {
                   "type": "string",
                   "name": "usp_enf",
                   "multiValueHandling": "SORTED_ARRAY",
                   "createBitmapIndex": true
               },
               {
                   "type": "string",
                   "name": "iwb",
                   "multiValueHandling": "SORTED_ARRAY",
                   "createBitmapIndex": true
               },
               {
                   "type": "string",
                   "name": "pid",
                   "multiValueHandling": "SORTED_ARRAY",
                   "createBitmapIndex": true
               },
               {
                   "type": "string",
                   "name": "pc",
                   "multiValueHandling": "SORTED_ARRAY",
                   "createBitmapIndex": true
               },
               {
                   "type": "string",
                   "name": "ufca",
                   "multiValueHandling": "SORTED_ARRAY",
                   "createBitmapIndex": true
               },
               {
                   "type": "string",
                   "name": "__dtype",
                   "multiValueHandling": "SORTED_ARRAY",
                   "createBitmapIndex": true
               },
               {
                   "type": "string",
                   "name": "usp_status",
                   "multiValueHandling": "SORTED_ARRAY",
                   "createBitmapIndex": true
               },
               {
                   "type": "string",
                   "name": "mnet_ckfl",
                   "multiValueHandling": "SORTED_ARRAY",
                   "createBitmapIndex": true
               },
               {
                   "type": "string",
                   "name": "__bid",
                   "multiValueHandling": "SORTED_ARRAY",
                   "createBitmapIndex": true
               },
               {
                   "type": "string",
                   "name": "di",
                   "multiValueHandling": "SORTED_ARRAY",
                   "createBitmapIndex": true
               },
               {
                   "type": "string",
                   "name": "exp",
                   "multiValueHandling": "SORTED_ARRAY",
                   "createBitmapIndex": true
               },
               {
                   "type": "string",
                   "name": "pgcatiab2",
                   "multiValueHandling": "SORTED_ARRAY",
                   "createBitmapIndex": true
               },
               {
                   "type": "string",
                   "name": "usp_ldf",
                   "multiValueHandling": "SORTED_ARRAY",
                   "createBitmapIndex": true
               },
               {
                   "type": "string",
                   "name": "ckfl",
                   "multiValueHandling": "SORTED_ARRAY",
                   "createBitmapIndex": true
               },
               {
                   "type": "string",
                   "name": "app",
                   "multiValueHandling": "SORTED_ARRAY",
                   "createBitmapIndex": true
               },
               {
                   "type": "string",
                   "name": "sbdrid",
                   "multiValueHandling": "SORTED_ARRAY",
                   "createBitmapIndex": true
               }
           ],
           "dimensionExclusions": []
       },
       "metricsSpec": [
           {
               "type": "count",
               "name": "m_count_responses"
           },
           {
               "type": "javascript",
               "name": "m_count",
               "fieldNames": [
                   "lper"
               ],
               "fnAggregate": "function(current,lper)     { var m_lper = 
isNaN(parseInt(lper)) ? 1 : parseInt(lper); return current+m_lper; }",
               "fnReset": "function()                         { return 0;}",
               "fnCombine": "function(partialA, partialB)      {return 
partialA+partialB;}"
           },
           {
               "type": "javascript",
               "name": "m_cbdp",
               "fieldNames": [
                   "lper",
                   "cbdp"
               ],
               "fnAggregate": "function(current,lper,cbdp)     { var m_lper = 
isNaN(parseInt(lper)) ? 1 : parseInt(lper); var m_cbdp = 
isNaN(parseFloat(cbdp))?0:parseFloat(cbdp); return current + m_lper*m_cbdp;}",
               "fnReset": "function() { return 0;}",
               "fnCombine": "function(partialA, partialB) { return partialA + 
partialB; }"
           },
           {
               "type": "javascript",
               "name": "m_obdp",
               "fieldNames": [
                   "lper",
                   "ogbdp"
               ],
               "fnAggregate": "function(current,lper,ogbdp)     { var m_lper = 
isNaN(parseInt(lper)) ? 1 : parseInt(lper); var m_ogbdp = 
isNaN(parseFloat(ogbdp)) ? 0 : parseFloat(ogbdp); return current + 
m_lper*m_ogbdp;}",
               "fnReset": "function() { return 0;}",
               "fnCombine": "function(partialA, partialB) { return partialA + 
partialB; }"
           },
           {
               "type": "javascript",
               "name": "m_bidflr",
               "fieldNames": [
                   "lper",
                   "bidflr"
               ],
               "fnAggregate": "function(current,lper,bidflr)     { var m_lper = 
isNaN(parseInt(lper)) ? 1 : parseInt(lper); var m_bidflr = 
isNaN(parseFloat(bidflr)) ? 0 : parseFloat(bidflr); return current + 
m_lper*m_bidflr;}",
               "fnReset": "function() { return 0;}",
               "fnCombine": "function(partialA, partialB) { return partialA + 
partialB; }"
           },
           {
               "type": "javascript",
               "name": "m_pbidflr",
               "fieldNames": [
                   "lper",
                   "pbidflr"
               ],
               "fnAggregate": "function(current,lper,pbidflr)     { var m_lper 
= isNaN(parseInt(lper)) ? 1 : parseInt(lper); var m_pbidflr = 
isNaN(parseFloat(pbidflr)) ? 0 : parseFloat(pbidflr); return current + 
m_lper*m_pbidflr;}",
               "fnReset": "function() { return 0;}",
               "fnCombine": "function(partialA, partialB) { return partialA + 
partialB; }"
           },
           {
               "type": "javascript",
               "name": "m_opbidflr",
               "fieldNames": [
                   "lper",
                   "opbidflr"
               ],
               "fnAggregate": "function(current,lper,opbidflr)     { var m_lper 
= isNaN(parseInt(lper)) ? 1 : parseInt(lper); var m_opbidflr = 
isNaN(parseFloat(opbidflr)) ? 0 : parseFloat(opbidflr); return current + 
m_lper*m_opbidflr;}",
               "fnReset": "function() { return 0;}",
               "fnCombine": "function(partialA, partialB) { return partialA + 
partialB; }"
           },
           {
               "type": "javascript",
               "name": "m_filteredsumactltime",
               "fieldNames": [
                   "lper",
                   "actltime"
               ],
               "fnAggregate": "function(current,lper,actltime)     { var m_lper 
= isNaN(parseInt(lper)) ? 1 : parseInt(lper); actltime=parseFloat(actltime); if 
(actltime>=0 && actltime <=20000) return current + m_lper*actltime; else return 
current; }",
               "fnReset": "function()                         { return 0;}",
               "fnCombine": "function(partialA, partialB)      {return 
partialA+partialB;}"
           },
           {
               "type": "javascript",
               "name": "m_filteredsumltime",
               "fieldNames": [
                   "lper",
                   "ltime"
               ],
               "fnAggregate": "function(current,lper,ltime)     { var m_lper = 
isNaN(parseInt(lper)) ? 1 : parseInt(lper); ltime=parseFloat(ltime); if 
(ltime>=0 && ltime <=20000) return current + m_lper*ltime; else return current; 
}",
               "fnReset": "function()                         { return 0;}",
               "fnCombine": "function(partialA, partialB)      {return 
partialA+partialB;}"
           },
           {
               "type": "javascript",
               "name": "m_rtime",
               "fieldNames": [
                   "lper",
                   "rtime"
               ],
               "fnAggregate": "function(current,lper,rtime)     { var m_lper = 
isNaN(parseInt(lper)) ? 1 : parseInt(lper); rtime=parseFloat(rtime); if 
(rtime>=0 && rtime <=20000) return current+ m_lper*rtime; else return current; 
}",
               "fnReset": "function()                         { return 0;}",
               "fnCombine": "function(partialA, partialB)      {return 
partialA+partialB;}"
           },
           {
               "type": "javascript",
               "name": "m_dspltime",
               "fieldNames": [
                   "lper",
                   "dspltime"
               ],
               "fnAggregate": "function(current,lper,dspltime)     { var m_lper 
= isNaN(parseInt(lper)) ? 1 : parseInt(lper); dspltime=parseFloat(dspltime); if 
(dspltime>=0 && dspltime <=50000) return current+ m_lper*dspltime; else return 
current; }",
               "fnReset": "function()                         { return 0;}",
               "fnCombine": "function(partialA, partialB)      {return 
partialA+partialB;}"
           },
           {
               "type": "javascript",
               "name": "m_bdp",
               "fieldNames": [
                   "lper",
                   "bdp"
               ],
               "fnAggregate": "function(current,lper,bdp)     { var m_lper = 
isNaN(parseInt(lper)) ? 1 : parseInt(lper); var m_bdp = isNaN(parseFloat(bdp)) 
? 0 : parseFloat(bdp); if(m_bdp>=0) return current+m_bdp*m_lper; else return 
current; }",
               "fnReset": "function()                         { return 0;}",
               "fnCombine": "function(partialA, partialB)      {return 
partialA+partialB;}"
           },
           {
               "type": "javascript",
               "name": "m_dfpBd",
               "fieldNames": [
                   "lper",
                   "dfpBd"
               ],
               "fnAggregate": "function(current,lper,dfpBd)     { var m_lper = 
isNaN(parseInt(lper)) ? 1 : parseInt(lper); var m_dfpBd = 
isNaN(parseFloat(dfpBd)) ? 0 : parseFloat(dfpBd); return current + m_lper * 
m_dfpBd;}",
               "fnReset": "function() { return 0;}",
               "fnCombine": "function(partialA, partialB) { return partialA + 
partialB; }"
           },
           {
               "type": "javascript",
               "name": "m_ttfd",
               "fieldNames": [
                   "lper",
                   "ttfd"
               ],
               "fnAggregate": "function(current,lper,ttfd)     { var m_lper = 
isNaN(parseInt(lper)) ? 1 : parseInt(lper); var m_ttfd = 
isNaN(parseFloat(ttfd)) ? 0 : parseFloat(ttfd); return current + m_lper * 
m_ttfd;}",
               "fnReset": "function() { return 0;}",
               "fnCombine": "function(partialA, partialB) { return partialA + 
partialB; }"
           },
           {
               "type": "javascript",
               "name": "m_ybnca_erpm",
               "fieldNames": [
                   "lper",
                   "ybnca_erpm"
               ],
               "fnAggregate": "function(current,lper,ybnca_erpm)     { var 
m_lper = isNaN(parseInt(lper)) ? 1 : parseInt(lper); var m_ybnca_erpm = 
isNaN(parseFloat(ybnca_erpm)) ? 0 : parseFloat(ybnca_erpm); if(m_ybnca_erpm>=0) 
return current+m_ybnca_erpm*m_lper; else return current; }",
               "fnReset": "function()                         { return 0;}",
               "fnCombine": "function(partialA, partialB)      {return 
partialA+partialB;}"
           },
           {
               "type": "doubleSum",
               "name": "m_ecp",
               "fieldName": "ecp",
               "expression": null
           },
           {
               "type": "javascript",
               "name": "m_mx_aurt",
               "fieldNames": [
                   "lper",
                   "mx_aurt"
               ],
               "fnAggregate": "function(current,lper,mx_aurt)     { var m_lper 
= isNaN(parseInt(lper)) ? 1 : parseInt(lper); var m_mx_aurt = 
isNaN(parseFloat(mx_aurt)) ? 0 : parseFloat(mx_aurt); return 
current+m_mx_aurt*m_lper; }",
               "fnReset": "function()                         { return 0;}",
               "fnCombine": "function(partialA, partialB)      {return 
partialA+partialB;}"
           }
       ],
       "tuningConfig": {
           "type": "hadoop",
           "workingPath": null,
           "version": "2020-02-05T13:43:39.680Z",
           "partitionsSpec": {
               "type": "hashed",
               "targetPartitionSize": -1,
               "maxPartitionSize": -1,
               "assumeGrouped": false,
               "numShards": 10,
               "partitionDimensions": []
           },
           "shardSpecs": {},
           "indexSpec": {
               "bitmap": {
                   "type": "roaring",
                   "compressRunOnSerialization": true
               },
               "dimensionCompression": "lz4",
               "metricCompression": "lz4",
               "longEncoding": "longs"
           },
           "maxRowsInMemory": 75000,
           "maxBytesInMemory": 0,
           "leaveIntermediate": false,
           "cleanupOnFailure": true,
           "overwriteFiles": false,
           "ignoreInvalidRows": false,
           "jobProperties": {
               "mapreduce.reduce.memory.mb": "20000",
               "mapreduce.reduce.maxattempts": "1"
           },
           "combineText": false,
           "useCombiner": false,
           "buildV9Directly": true,
           "numBackgroundPersistThreads": 0,
           "forceExtendableShardSpecs": false,
           "useExplicitVersion": false,
           "allowedHadoopPrefix": [],
           "logParseExceptions": false,
           "maxParseExceptions": 0
       },
       "dataSource": "Prebid_Auction_Participants_MView",
       "hadoopCoordinates": null,
       "hadoopDependencyCoordinates": [
           "org.apache.hadoop:hadoop-client:2.7.2"
       ],
       "classpathPrefix": null,
       "context": {
           "maxTaskCount": 5,
           "minDataLagMs": 21600000
       },
       "suspended": false
   }
   ----------------------------
   Respective Query Results -
   
   View Query on base datasource: 
   
   > {  "queryType": "view",
            "query": {
              "queryType": "topN",
     "dataSource": "Prebid_Auction_Participants",
     "dimension": "pvid",
     "threshold": 5,
     "metric": "m_count",
     "granularity": "all",
     "aggregations": [
       {
         "type": "longSum",
         "name": "m_count",
         "fieldName": "m_count"
       }
     ],
     "postAggregations": [],
     "intervals": [
       "2020-02-05T04:00Z/2020-02-05T07:00Z"
     ]
   }
   }
   Result 
   
   > -[
   
       {
           "timestamp": "2020-02-05T04:00:00.000Z",
           "result": [
               {
                   "pvid": "0",
                   "m_count": 2536512056
               },
               {
                   "pvid": "178",
                   "m_count": 1324703685
               },
               {
                   "pvid": "4",
                   "m_count": 1274119793
               },
               {
                   "pvid": "175",
                   "m_count": 1204064436
               },
               {
                   "pvid": "201",
                   "m_count": 463075403
               }
           ]
       }
   ]
   ----------------------------------------
   TopN query on baseDataSource - 
   
   > {
      "queryType": "topN",
     "dataSource": "Prebid_Auction_Participants",
     "dimension": "pvid",
     "threshold": 5,
     "metric": "m_count",
     "granularity": "all",
     "aggregations": [
       {
         "type": "longSum",
         "name": "m_count",
         "fieldName": "m_count"
       }
     ],
     "postAggregations": [],
     "intervals": [
       "2020-02-05T04:00Z/2020-02-05T07:00Z"
     ]     
   }
   
   Result - 
   
   > [
   
       {
           "timestamp": "2020-02-05T04:00:00.000Z",
           "result": [
               {
                   "pvid": "0",
                   "m_count": 1869052138
               },
               {
                   "pvid": "178",
                   "m_count": 975872452
               },
               {
                   "pvid": "4",
                   "m_count": 939643460
               },
               {
                   "pvid": "175",
                   "m_count": 887658267
               },
               {
                   "pvid": "157",
                   "m_count": 829774487
               }
           ]
       }
   ]
   
   -----------------------------
   TopN Query on derivedDatasource -
   
   >  {
       "queryType": "topN",
     "dataSource": "Prebid_Auction_Participants_MView",
     "dimension": "pvid",
     "threshold": 5,
     "metric": "m_count",
     "granularity": "all",
     "aggregations": [
       {
         "type": "longSum",
         "name": "m_count",
         "fieldName": "m_count"
       }
     ],
     "postAggregations": [],
     "intervals": [
       "2020-02-05T04:00Z/2020-02-05T07:00Z"
     ]     
   }
   Result - 
   
   > [
   
       {
           "timestamp": "2020-02-05T04:00:00.000Z",
           "result": [
               {
                   "pvid": "0",
                   "m_count": 1869052138
               },
               {
                   "pvid": "178",
                   "m_count": 975872452
               },
               {
                   "pvid": "4",
                   "m_count": 939643460
               },
               {
                   "pvid": "175",
                   "m_count": 887658267
               },
               {
                   "pvid": "157",
                   "m_count": 829774487
               }
           ]
       }
   ]            
   }
   
   ----------------------
   Also the issue seems to arise only for intervals - 
2020-02-05T04:00Z/2020-02-05T07:00Z , rest of the intervals give the same 
results in all three cases.
   I have data ingested in derived datasource from 2020-02-03 10:00 to 
2020-02-05 18:00 .
   
   > 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to