<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
# Database engine specifications
Superset uses [SQLAlchemy](https://www.sqlalchemy.org/) as an abstraction layer for running queries and fetching metadata from tables (like column names and types). Unfortunately, while SQLAlchemy offers enough functionality to allow connecting Superset to dozens of databases, there are still implementation details that differ across them. Because of this, Superset has an additional abstraction on top of SQLAlchemy, called a "database engine specification" or, simply, "DB engine spec".
DB engine specs were created initially because there's no SQL standard for computing aggregations at different time grains. For example, to compute a daily metric in Trino or Postgres we could run a query like this:
```sql
SELECT
date_trunc('day', CAST(time_column) AS TIMESTAMP) AS day,
COUNT(*) AS metric
FROM
some_table
GROUP BY
1
```
For MySQL, instead of using the `date_trunc` function, we would need to write:
```sql
SELECT
DATE(time_column) AS day,
COUNT(*) AS metric
FROM
some_table
GROUP BY
1
```
Over time, more and more functionality was added to DB engine specs, including validating SQL, estimating the cost of queries before they are run, and understanding the semantics of error messages. These are all described in detail in this document, and in the table below you can see a summary of what features are supported by each database.
Note that DB engine specs are completely optional. Superset can connect to any database supported by SQLAlchemy (or 3rd party dialects) even if there's no DB engine spec associated with it. But DB engine specs greatly improve the experience of working with a database in Superset.
## Features
The table below (generated via `python superset/db_engine_specs/lib.py`) summarizes the information about the status of all DB engine specs in Superset (note that this excludes 3rd party DB engine specs):
| Feature | Amazon Athena | Amazon DynamoDB | Amazon Redshift | Apache Drill | Apache Druid | Apache Hive | Apache Impala | Apache Kylin | Apache Pinot | Apache Solr | Apache Spark SQL | Ascend | Aurora MySQL (Data API) | Aurora PostgreSQL (Data API) | Azure Synapse | ClickHouse | ClickHouse Connect (Superset) | CockroachDB | CrateDB | Databricks | Databricks Interactive Cluster | Databricks SQL Endpoint | Dremio | DuckDB | ElasticSearch (OpenDistro SQL) | ElasticSearch (SQL API) | Exasol | Firebird | Firebolt | Google BigQuery | Google Sheets | IBM Db2 | IBM Netezza Performance Server | KustoKQL | KustoSQL | Microsoft SQL Server | MySQL | Ocient | Oracle | PostgreSQL | Presto | RisingWave | Rockset | SAP HANA | SQLite | Shillelagh | Snowflake | StarRocks | Teradata | Trino | Vertica | base |
| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---|
| Module | superset.db_engine_specs.athena | superset.db_engine_specs.dynamodb | superset.db_engine_specs.redshift | superset.db_engine_specs.drill | superset.db_engine_specs.druid | superset.db_engine_specs.hive | superset.db_engine_specs.impala | superset.db_engine_specs.kylin | superset.db_engine_specs.pinot | superset.db_engine_specs.solr | superset.db_engine_specs.spark | superset.db_engine_specs.ascend | superset.db_engine_specs.aurora | superset.db_engine_specs.aurora | superset.db_engine_specs.mssql | superset.db_engine_specs.clickhouse | superset.db_engine_specs.clickhouse | superset.db_engine_specs.cockroachdb | superset.db_engine_specs.crate | superset.db_engine_specs.databricks | superset.db_engine_specs.databricks | superset.db_engine_specs.databricks | superset.db_engine_specs.dremio | superset.db_engine_specs.duckdb | superset.db_engine_specs.elasticsearch | superset.db_engine_specs.elasticsearch | superset.db_engine_specs.exasol | superset.db_engine_specs.firebird | superset.db_engine_specs.firebolt | superset.db_engine_specs.bigquery | superset.db_engine_specs.gsheets | superset.db_engine_specs.db2 | superset.db_engine_specs.netezza | superset.db_engine_specs.kusto | superset.db_engine_specs.kusto | superset.db_engine_specs.mssql | superset.db_engine_specs.mysql | superset.db_engine_specs.ocient | superset.db_engine_specs.oracle | superset.db_engine_specs.postgres | superset.db_engine_specs.presto | superset.db_engine_specs.risingwave | superset.db_engine_specs.rockset | superset.db_engine_specs.hana | superset.db_engine_specs.sqlite | superset.db_engine_specs.shillelagh | superset.db_engine_specs.snowflake | superset.db_engine_specs.starrocks | superset.db_engine_specs.teradata | superset.db_engine_specs.trino | superset.db_engine_specs.vertica | superset.db_engine_specs.presto |
| Method used to limit the rows in the subquery | FORCE_LIMIT | FORCE_LIMIT | FORCE_LIMIT | FORCE_LIMIT | FORCE_LIMIT | FORCE_LIMIT | FORCE_LIMIT | FORCE_LIMIT | FORCE_LIMIT | FORCE_LIMIT | FORCE_LIMIT | FORCE_LIMIT | FORCE_LIMIT | FORCE_LIMIT | WRAP_SQL | FORCE_LIMIT | FORCE_LIMIT | FORCE_LIMIT | FORCE_LIMIT | FORCE_LIMIT | FORCE_LIMIT | FORCE_LIMIT | FORCE_LIMIT | FORCE_LIMIT | FORCE_LIMIT | FORCE_LIMIT | FORCE_LIMIT | FETCH_MANY | FORCE_LIMIT | FORCE_LIMIT | FORCE_LIMIT | WRAP_SQL | FORCE_LIMIT | WRAP_SQL | WRAP_SQL | WRAP_SQL | FORCE_LIMIT | FORCE_LIMIT | WRAP_SQL | FORCE_LIMIT | FORCE_LIMIT | FORCE_LIMIT | FORCE_LIMIT | WRAP_SQL | FORCE_LIMIT | FORCE_LIMIT | FORCE_LIMIT | FORCE_LIMIT | WRAP_SQL | FORCE_LIMIT | FORCE_LIMIT | FORCE_LIMIT |
| Supports JOINs | True | True | True | True | False | True | True | True | False | False | True | True | True | True | True | True | True | True | True | True | True | True | True | True | False | False | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True |
| Supports subqueries | True | True | True | True | True | True | True | True | False | False | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True |
| Allows aliases in the SELECT statement | True | True | True | True | True | True | True | True | False | True | True | True | True | True | True | True | True | True | True | True | True | True | False | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True |
| Allows referencing aliases in the ORDER BY statement | True | True | True | True | True | True | True | True | False | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | True | Tr
没有合适的资源?快使用搜索试试~ 我知道了~
superset学习相关
共2000个文件
py:1296个
js:276个
yaml:138个
需积分: 0 1 下载量 196 浏览量
2024-06-27
23:44:09
上传
评论
收藏 977.45MB ZIP 举报
温馨提示
superset学习相关
资源推荐
资源详情
资源评论
收起资源包目录
superset学习相关 (2000个子文件)
custom.css 2KB
CountryMap.css 2KB
style.css 1KB
color-styles.css 1KB
MapBox.css 883B
storybook.css 244B
storybook.css 39B
theme.html 55KB
paper-theme.html 24KB
basic.html 5KB
list_with_checkboxes.html 4KB
macros.html 3KB
404.html 3KB
500.html 3KB
search.html 3KB
import_dashboards.html 3KB
database_schemas_selector.html 2KB
base_list.html 2KB
navbar.html 2KB
baselayout.html 2KB
base.html 2KB
slice_data.html 2KB
asset_bundle.html 1KB
export_dashboards.html 1KB
list.html 1KB
edit.html 1KB
add.html 1KB
traceback.html 1KB
tail_js_custom_extra.html 1KB
oauth2.html 1KB
edit.html 1KB
list_role.html 994B
spa.html 992B
list.html 988B
macros.html 926B
public_welcome.html 908B
flash_wrapper.html 886B
cal-heatmap.js 111KB
d3.parcoords.js 69KB
sqlLab.js 40KB
NVD3Vis.js 39KB
sqlLab.test.js 33KB
utilities.js 25KB
dashboardState.js 24KB
sqlLab.js 23KB
Rose.js 19KB
chartAction.js 18KB
dashboardLayout.test.js 18KB
webpack.config.js 17KB
sqlLab.test.js 17KB
chartActions.test.js 14KB
utils.js 14KB
getDropPosition.test.js 13KB
.eslintrc.js 13KB
payload.js 13KB
Heatmap.js 13KB
getFilterScopeFromNodesTree.test.js 13KB
dashboardLayout.test.js 12KB
hydrate.js 12KB
Partition.js 11KB
docusaurus.config.js 11KB
exploreReducer.js 10KB
dashboardLayout.js 10KB
index.js 9KB
AdhocFilter.test.js 9KB
dashboardLayout.js 9KB
AdhocMetric.test.js 8KB
MainPreset.js 8KB
WorldMap.js 8KB
payload.js 8KB
getDetailedComponentWidth.test.js 7KB
payload.js 7KB
payload.js 7KB
CountryMap.js 7KB
Sankey.js 7KB
exploreActions.test.js 7KB
payload.js 7KB
mockDashboardLayout.js 7KB
dashboardState.js 7KB
dashboardState.test.js 6KB
mockSliceEntities.js 6KB
getDropPosition.js 6KB
dropOverflowsParent.test.js 6KB
mockDatasource.js 6KB
webpack.proxy-config.js 6KB
dashboardState.test.js 6KB
utils.test.js 5KB
getFilterScopeFromNodesTree.js 5KB
AdhocMetric.js 5KB
index.js 5KB
payload.js 5KB
payload.js 5KB
mockDashboardState.js 5KB
persistSqlLabStateEnhancer.js 5KB
chart.test.js 5KB
mockStore.js 5KB
transformProps.js 5KB
logger.test.js 5KB
actions.js 5KB
updateComponentParentsList.test.js 4KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
m0_64506933
- 粉丝: 0
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功