diff --git a/README.md b/README.md index 2361ecbf739..cf2558c9216 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,6 @@ Here are some of the major database solutions that are supported: druid firebolt timescale - rockset postgresql mysql mssql-server diff --git a/docs/docs/configuration/databases.mdx b/docs/docs/configuration/databases.mdx index 0aeee2afa06..2b293e79c86 100644 --- a/docs/docs/configuration/databases.mdx +++ b/docs/docs/configuration/databases.mdx @@ -71,7 +71,6 @@ are compatible with Superset. | [Parseable](/docs/configuration/databases#parseable) | `pip install sqlalchemy-parseable` | `parseable://:@/` | | [PostgreSQL](/docs/configuration/databases#postgres) | `pip install psycopg2` | `postgresql://:@/` | | [Presto](/docs/configuration/databases#presto) | `pip install pyhive` | `presto://{username}:{password}@{hostname}:{port}/{database}` | -| [Rockset](/docs/configuration/databases#rockset) | `pip install rockset-sqlalchemy` | `rockset://:@` | | [SAP Hana](/docs/configuration/databases#hana) | `pip install hdbcli sqlalchemy-hana` or `pip install apache_superset[hana]` | `hana://{username}:{password}@{host}:{port}` | | [SingleStore](/docs/configuration/databases#singlestore) | `pip install sqlalchemy-singlestoredb` | `singlestoredb://{username}:{password}@{host}:{port}/{database}` | | [StarRocks](/docs/configuration/databases#starrocks) | `pip install starrocks` | `starrocks://:@:/.` | @@ -1174,25 +1173,6 @@ The expected connection string is formatted as follows: risingwave://root@{hostname}:{port}/{database}?sslmode=disable ``` -#### Rockset - -The connection string for Rockset is: - -``` -rockset://{api key}:@{api server} -``` - -Get your API key from the [Rockset console](https://console.rockset.com/apikeys). -Find your API server from the [API reference](https://rockset.com/docs/rest-api/#introduction). Omit the `https://` portion of the URL. - -To target to a specific virtual instance, use this URI format: - -``` -rockset://{api key}:@{api server}/{VI ID} -``` - -For more complete instructions, we recommend the [Rockset documentation](https://docs.rockset.com/apache-superset/). - #### Snowflake ##### Install Snowflake Driver diff --git a/docs/src/resources/data.js b/docs/src/resources/data.js index 7bd418778ee..4a8ba52c386 100644 --- a/docs/src/resources/data.js +++ b/docs/src/resources/data.js @@ -50,7 +50,7 @@ export const Databases = [ }, { title: 'Apache Druid', - href: 'http://druid.io/', + href: 'https://druid.apache.org/', imgName: 'druid.png', }, { @@ -69,17 +69,12 @@ export const Databases = [ }, { title: 'ClickHouse', - href: 'https://clickhouse.tech/', + href: 'https://clickhouse.com/', imgName: 'clickhouse.png', }, - { - title: 'Rockset', - href: 'https://rockset.com/', - imgName: 'rockset.png', - }, { title: 'Dremio', - href: 'https://dremio.com/', + href: 'https://www.dremio.com/', imgName: 'dremio.png', }, { @@ -104,12 +99,12 @@ export const Databases = [ }, { title: 'IBM Db2', - href: 'https://www.ibm.com/analytics/db2', + href: 'https://www.ibm.com/products/db2', imgName: 'ibmdb2.png', }, { title: 'SAP Hana', - href: 'https://www.sap.com/products/technology-platform/hana.html', + href: 'https://www.sap.com/products/data-cloud/hana.html', imgName: 'sap-hana.jpg', }, { @@ -139,7 +134,7 @@ export const Databases = [ }, { title: 'TDengine', - href: 'https://www.tdengine.com/', + href: 'https://tdengine.com/', imgName: 'tdengine.png', }, ]; diff --git a/docs/static/img/databases/rockset.png b/docs/static/img/databases/rockset.png deleted file mode 100644 index c38350619c9..00000000000 Binary files a/docs/static/img/databases/rockset.png and /dev/null differ diff --git a/pyproject.toml b/pyproject.toml index 0e43176a27e..50584028f10 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -164,7 +164,6 @@ presto = ["pyhive[presto]>=0.6.5"] trino = ["trino>=0.328.0"] prophet = ["prophet>=1.1.5, <2"] redshift = ["sqlalchemy-redshift>=0.8.1, <0.9"] -rockset = ["rockset-sqlalchemy>=0.0.1, <1"] risingwave = ["sqlalchemy-risingwave"] shillelagh = ["shillelagh[all]>=1.2.18, <2"] singlestore = ["sqlalchemy-singlestoredb>=1.1.1, <2"] diff --git a/superset-frontend/src/assets/images/rockset.png b/superset-frontend/src/assets/images/rockset.png deleted file mode 100644 index b94b9e040fd..00000000000 Binary files a/superset-frontend/src/assets/images/rockset.png and /dev/null differ diff --git a/superset/db_engine_specs/README.md b/superset/db_engine_specs/README.md index 75ab7351544..34904b79e74 100644 --- a/superset/db_engine_specs/README.md +++ b/superset/db_engine_specs/README.md @@ -53,9 +53,9 @@ Note that DB engine specs are completely optional. Superset can connect to any d 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 | +| 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 | 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 | +| 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.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 | diff --git a/superset/db_engine_specs/rockset.py b/superset/db_engine_specs/rockset.py deleted file mode 100644 index 73ca57ac06b..00000000000 --- a/superset/db_engine_specs/rockset.py +++ /dev/null @@ -1,72 +0,0 @@ -# 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. -from datetime import datetime -from typing import Any, Optional, TYPE_CHECKING - -from sqlalchemy import types - -from superset.constants import TimeGrain -from superset.db_engine_specs.base import BaseEngineSpec - -if TYPE_CHECKING: - from superset.connectors.sqla.models import TableColumn - - -class RocksetEngineSpec(BaseEngineSpec): - engine = "rockset" - engine_name = "Rockset" - - _time_grain_expressions = { - None: "{col}", - TimeGrain.SECOND: "DATE_TRUNC('second', {col})", - TimeGrain.MINUTE: "DATE_TRUNC('minute', {col})", - TimeGrain.HOUR: "DATE_TRUNC('hour', {col})", - TimeGrain.DAY: "DATE_TRUNC('day', {col})", - TimeGrain.WEEK: "DATE_TRUNC('week', {col})", - TimeGrain.MONTH: "DATE_TRUNC('month', {col})", - TimeGrain.QUARTER: "DATE_TRUNC('quarter', {col})", - TimeGrain.YEAR: "DATE_TRUNC('year', {col})", - } - - @classmethod - def epoch_to_dttm(cls) -> str: - return "{col} * 1000" - - @classmethod - def epoch_ms_to_dttm(cls) -> str: - return "{col}" - - @classmethod - def convert_dttm( - cls, target_type: str, dttm: datetime, db_extra: Optional[dict[str, Any]] = None - ) -> Optional[str]: - sqla_type = cls.get_sqla_column_type(target_type) - - if isinstance(sqla_type, types.Date): - return f"DATE '{dttm.date().isoformat()}'" - if isinstance(sqla_type, types.TIMESTAMP): - dttm_formatted = dttm.isoformat(timespec="microseconds") - return f"""TIMESTAMP '{dttm_formatted}'""" - if isinstance(sqla_type, types.DateTime): - dttm_formatted = dttm.isoformat(sep=" ", timespec="microseconds") - return f"""DATETIME '{dttm_formatted}'""" - return None - - @classmethod - def alter_new_orm_column(cls, orm_col: "TableColumn") -> None: - if orm_col.type == "TIMESTAMP": - orm_col.python_date_format = "epoch_ms" diff --git a/superset/sql/parse.py b/superset/sql/parse.py index 0d53d47d51a..93fe328d1c0 100644 --- a/superset/sql/parse.py +++ b/superset/sql/parse.py @@ -26,13 +26,22 @@ from collections.abc import Iterable from dataclasses import dataclass from typing import Any, Generic, TYPE_CHECKING, TypeVar -import sqlglot +import sqlglot # pylint: disable=disallowed-sql-import from jinja2 import nodes, Template -from sqlglot import exp -from sqlglot.dialects.dialect import Dialect, Dialects -from sqlglot.errors import ParseError -from sqlglot.optimizer.pushdown_predicates import pushdown_predicates -from sqlglot.optimizer.scope import Scope, ScopeType, traverse_scope +from sqlglot import exp # pylint: disable=disallowed-sql-import +from sqlglot.dialects.dialect import ( # pylint: disable=disallowed-sql-import + Dialect, + Dialects, +) +from sqlglot.errors import ParseError # pylint: disable=disallowed-sql-import +from sqlglot.optimizer.pushdown_predicates import ( # pylint: disable=disallowed-sql-import + pushdown_predicates, +) +from sqlglot.optimizer.scope import ( # pylint: disable=disallowed-sql-import + Scope, + ScopeType, + traverse_scope, +) from superset.exceptions import QueryClauseValidationException, SupersetParseError from superset.sql.dialects import Dremio, Firebolt @@ -91,7 +100,6 @@ SQLGLOT_DIALECTS = { "pydoris": Dialects.DORIS, "redshift": Dialects.REDSHIFT, "risingwave": Dialects.RISINGWAVE, - # "rockset": ??? "shillelagh": Dialects.SQLITE, "singlestore": Dialects.MYSQL, "snowflake": Dialects.SNOWFLAKE, diff --git a/tests/unit_tests/db_engine_specs/test_rockset.py b/tests/unit_tests/db_engine_specs/test_rockset.py deleted file mode 100644 index 2d5f23c1800..00000000000 --- a/tests/unit_tests/db_engine_specs/test_rockset.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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. - -from datetime import datetime -from typing import Optional - -import pytest - -from tests.unit_tests.db_engine_specs.utils import assert_convert_dttm -from tests.unit_tests.fixtures.common import dttm # noqa: F401 - - -@pytest.mark.parametrize( - "target_type,expected_result", - [ - ("Date", "DATE '2019-01-02'"), - ("DateTime", "DATETIME '2019-01-02 03:04:05.678900'"), - ("Timestamp", "TIMESTAMP '2019-01-02T03:04:05.678900'"), - ("UnknownType", None), - ], -) -def test_convert_dttm( - target_type: str, - expected_result: Optional[str], - dttm: datetime, # noqa: F811 -) -> None: - from superset.db_engine_specs.rockset import RocksetEngineSpec as spec # noqa: N813 - - assert_convert_dttm(spec, target_type, expected_result, dttm) diff --git a/tests/unit_tests/sql/parse_tests.py b/tests/unit_tests/sql/parse_tests.py index 5d56ab343af..1ab7174a184 100644 --- a/tests/unit_tests/sql/parse_tests.py +++ b/tests/unit_tests/sql/parse_tests.py @@ -1163,7 +1163,6 @@ def test_custom_dialect(app: None) -> None: "pydoris", "redshift", "risingwave", - "rockset", "shillelagh", "snowflake", "solr",