Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Unknown aggregation type: stringFirst #35

Open
Jaymin-adzmedia opened this issue Nov 12, 2019 · 0 comments
Open

Error: Unknown aggregation type: stringFirst #35

Jaymin-adzmedia opened this issue Nov 12, 2019 · 0 comments

Comments

@Jaymin-adzmedia
Copy link

Jaymin-adzmedia commented Nov 12, 2019

Hello

I am using timeseries query. I also want few fields value. Dimension is not supporting in timeseries query so i am using aggregations[]. I using below query to execute in druid endpoint server.
which is working but not in node JS.

"queryType": "timeseries", "dataSource": "dsp_report_full_new", "granularity": "hour", "aggregations": [ { "type": "count", "name": "rows" }, { "type": "stringFirst", "name": "country", "fieldName": "country" }, { "type": "stringFirst", "name": "campid", "fieldName": "campid" }, { "type": "doubleSum", "name": "impressions", "fieldName": "impressions" }, { "type": "doubleSum", "name": "conversions", "fieldName": "conversions" }, { "type": "doubleSum", "name": "wins", "fieldName": "wins" }, { "type": "doubleSum", "name": "spend", "fieldName": "spend" }, { "type": "doubleSum", "name": "bids", "fieldName": "bids" }, { "type": "doubleSum", "name": "payout", "fieldName": "payout" }, { "type": "doubleSum", "name": "pixels", "fieldName": "pixels" }, { "type": "doubleSum", "name": "OneHplusOld", "fieldName": "OneHplus" }, { "type": "doubleSum", "name": "clicks", "fieldName": "clicks" } ], "postAggregations": [ { "type": "arithmetic", "name": "cr", "fn": "*", "fields": [ { "type": "constant", "name": "hundred", "value": 100 }, { "type": "arithmetic", "name": "cbyp", "fn": "/", "fields": [ { "type": "fieldAccess", "name": "conversions", "fieldName": "conversions" }, { "type": "fieldAccess", "name": "pixels", "fieldName": "pixels" } ] } ] }, { "type": "arithmetic", "name": "ctr", "fn": "*", "fields": [ { "type": "constant", "name": "hundred", "value": 100 }, { "type": "arithmetic", "name": "cbyp", "fn": "/", "fields": [ { "type": "fieldAccess", "name": "clicks", "fieldName": "clicks" }, { "type": "fieldAccess", "name": "impressions", "fieldName": "impressions" } ] } ] }, { "type": "arithmetic", "name": "OneHplus", "fn": "*", "fields": [ { "type": "constant", "name": "hundred", "value": 100 }, { "type": "arithmetic", "name": "OneHdividedByConversions", "fn": "/", "fields": [ { "type": "fieldAccess", "name": "OneHplusOld", "fieldName": "OneHplusOld" }, { "type": "fieldAccess", "name": "conversions", "fieldName": "conversions" } ] } ] }, { "type": "arithmetic", "name": "clear_rate", "fn": "/", "fields": [ { "type": "fieldAccess", "name": "bids", "fieldName": "bids" }, { "type": "fieldAccess", "name": "impressions", "fieldName": "impressions" } ] }, { "type": "arithmetic", "name": "win_rate", "fn": "/", "fields": [ { "type": "fieldAccess", "name": "bids", "fieldName": "bids" }, { "type": "fieldAccess", "name": "wins", "fieldName": "wins" } ] }, { "type": "arithmetic", "name": "ecpa", "fn": "/", "fields": [ { "type": "fieldAccess", "name": "spend", "fieldName": "spend" }, { "type": "fieldAccess", "name": "conversions", "fieldName": "conversions" } ] }, { "type": "arithmetic", "name": "ecpm", "fn": "/", "fields": [ { "type": "fieldAccess", "name": "spend", "fieldName": "spend" }, { "type": "arithmetic", "name": "per1000impressions", "fn": "/", "fields": [ { "type": "fieldAccess", "name": "impressions", "fieldName": "impressions" }, { "type": "constant", "name": "thousand", "value": 1000 } ] } ] } ], "intervals": [ "2019-11-11T00:00:00.000Z/2019-11-11T23:59:59.059Z" ], "filter": { "type": "and", "fields": [ { "type": "in", "dimension": "campid", "values": [ 2016] } ] }

JS code : expReportQ.aggregation('stringFirst', 'campid', 'campid');

Please help me to fix node js issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant