2014-01-24 16:12:10 -08:00
---
layout: doc_page
---
2014-10-29 12:32:24 -07: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 16:12:10 -08:00
### Table Data Source
2014-10-29 12:32:24 -07:00
The table data source is the most common type. It's represented by a string, or by the full structure:
2014-01-24 16:12:10 -08:00
```json
{
"type": "table",
2014-11-11 11:56:22 -08:00
"name": "< string_value > "
2014-01-24 16:12:10 -08:00
}
```
2014-10-29 12:32:24 -07:00
### Union Data Source
2014-10-31 11:07:55 -07:00
This data source unions two or more table data sources.
2014-10-29 12:32:24 -07:00
```json
{
"type": "union",
2014-11-11 11:56:22 -08:00
"dataSources": ["< string_value1 > ", "< string_value2 > ", "< string_value3 > ", ... ]
2014-10-29 12:32:24 -07:00
}
```
2014-11-11 11:56:22 -08:00
Note that the data sources being unioned should have the same schema.
2014-01-24 16:12:10 -08:00
### Query Data Source
```json
{
"type": "query",
"query": {
"type": "groupBy",
...
}
}
```