druid/docs/content/DataSource.md

42 lines
848 B
Markdown
Raw Normal View History

2014-01-24 19:12:10 -05:00
---
layout: doc_page
---
2014-10-29 15:32:24 -04:00
## Datasources
A data source is the Druid equivalent of a database table. However, a query can also masquerade as a data source, providing subquery-like functionality. Query data sources are currently supported only by [GroupBy](GroupByQuery.html) queries.
2014-01-24 19:12:10 -05:00
### Table Data Source
2014-10-29 15:32:24 -04:00
The table data source is the most common type. It's represented by a string, or by the full structure:
2014-01-24 19:12:10 -05:00
```json
{
"type": "table",
"name": "<string_value>"
2014-01-24 19:12:10 -05:00
}
```
2014-10-29 15:32:24 -04:00
### Union Data Source
This data source unions two or more table data sources.
2014-10-29 15:32:24 -04:00
```json
{
"type": "union",
"dataSources": ["<string_value1>", "<string_value2>", "<string_value3>", ... ]
2014-10-29 15:32:24 -04:00
}
```
Note that the data sources being unioned should have the same schema.
2014-01-24 19:12:10 -05:00
### Query Data Source
```json
{
"type": "query",
"query": {
"type": "groupBy",
...
}
}
```