DruidDotNet exposes a simple API to work with Druid.
Install-Package Druid.Net
var request = new IndexSpecBuilder("DataSourceName")
.SetParser("string", "json", "TimestampField", "auto")
//type of granularity, segment granularity, query granularity, intervals startDate and endDate
.SetGranularity("uniform", new SimpleGranularity(SimpleGranularityTypes.Year),
new SimpleGranularity(SimpleGranularityTypes.None), DateTime.Now.Date.AddDays(-1), DateTime.Now.Date)
.SetFirehose(new LocalFirehose("/path", "*.json"))
.SetForceExtendableShard(true)
.AddDimensions("dimension1", "dimension2")
.AddExcludedDimensions("dim_to_exclude")
.AddMetric(new CountAggregator("count"))
.GetRequest();
var api = new IndexerClient("http://druid.com:8081/");
var result = await api.IndexAndWait(request, TimeSpan.FromMinutes(1));
- Indexer
- Add Indexer Builder
- Add Granularity Enum
- Add Druid Index ViewModel / Mapping.
- Add more Indexer Types.
- Add more enums.
- Query