-
Notifications
You must be signed in to change notification settings - Fork 862
Druid Connector #1647
Comments
Here's an example query and how it could translate to GraphQL: Druidquery{
"queryType": "timeseries",
"dataSource": "sample_datasource",
"granularity": "day",
"descending": "true",
"filter": {
"type": "and",
"fields": [
{ "type": "selector", "dimension": "sample_dimension1", "value": "sample_value1" },
{ "type": "or",
"fields": [
{ "type": "selector", "dimension": "sample_dimension2", "value": "sample_value2" },
{ "type": "selector", "dimension": "sample_dimension3", "value": "sample_value3" }
]
}
]
},
"aggregations": [
{ "type": "longSum", "name": "sample_name1", "fieldName": "sample_fieldName1" },
{ "type": "doubleSum", "name": "sample_name2", "fieldName": "sample_fieldName2" }
],
"postAggregations": [
{ "type": "arithmetic",
"name": "sample_divide",
"fn": "/",
"fields": [
{ "type": "fieldAccess", "name": "postAgg__sample_name1", "fieldName": "sample_name1" },
{ "type": "fieldAccess", "name": "postAgg__sample_name2", "fieldName": "sample_name2" }
]
}
],
"intervals": [ "2012-01-01T00:00:00.000/2012-01-03T00:00:00.000" ]
} result[
{
"timestamp": "2012-01-01T00:00:00.000Z",
"result": { "sample_name1": "<some_value>", "sample_name2": "<some_value>", "sample_divide": "<some_value>" }
},
{
"timestamp": "2012-01-02T00:00:00.000Z",
"result": { "sample_name1": "<some_value>", "sample_name2": "<some_value>", "sample_divide": "<some_value>" }
}
] GraphQLquery{
timeseries {
sample_datasource(
granularity: "day" # enum: all, none, second, minute, fifteen_minute, thirty_minute, hour, day, week, month, quarter, year
descending: true
filter: {
sample_dimension1: "sample_value1"
OR: {
sample_dimension2: "sample_value2"
sample_dimension3: "sample_value3"
}
}
"intervals": [ "2012-01-01T00:00:00.000/2012-01-03T00:00:00.000" ]) {
timestamp
aggregations {
sample_name1: longSum {
sample_fieldname1
}
sample_name2: doubleSum {
sample_fieldname2
}
}
postAggregations {
sample_divide: arithmetic(fn: "/", fields: [])
}
}
}
} result{
"timeseries": [
{
"timestamp": "2012-01-01T00:00:00.000Z"
"aggregations" {
"sample_name1": { "sample_name1": "<some_value>", "sample_name2": "<some_value>" }
},
"postAggregations": {
"sample_divide": "<some_value>"
}
},
{
"timestamp": "2012-01-02T00:00:00.000Z"
"aggregations" {
"sample_name1": { "sample_name1": "<some_value>", "sample_name2": "<some_value>" }
},
"postAggregations": {
"sample_divide": "<some_value>"
}
}
]
} One thing to note is that Druid doesn't preserve the structure of the query in the output, and GraphQL does. I think this is an advantage of GraphQL, but it does make the output more verbose. |
@sorenbs this is awesome! 👍 🎉 |
I second the awesome! Would love to help push this idea forward =) |
Absence of input union types support can introduce issues with highly polymorphic Druid query API. |
This is great !! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions. |
Good day. I did not find information about connector to Druid Db. Where I can get it? SELECT postgresql.Title, druid.indicator, druid.unit, druid.value Thanks |
This feature requests serves as a central place to discuss development and progress for the Druid connector.
The text was updated successfully, but these errors were encountered: