Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sparksql engine spec #244

Merged
merged 3 commits into from
Aug 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
## [Unreleased]
<details>
<summary>
Changes that have landed in master but are not yet released.
Click to see more.

### Fixed

- Timestamp type not mapped correctly from Spark SQL to Hive ([#227](https://github.com/src-d/sourced-ui/issues/227))

</summary>

</details>
Expand Down
15 changes: 10 additions & 5 deletions superset/contrib/docker/superset_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,16 @@ class CeleryConfig(object):
if GITBASE_PASSWORD:
GITBASE_AUTH += ':%s' % GITBASE_PASSWORD
GITBASE_AUTH += '@'
GITBASE_DATABASE_URI = '%s://%s%s:%s/%s?charset=utf8' % (GITBASE_PREFIX,
GITBASE_AUTH,
GITBASE_HOST,
GITBASE_PORT,
GITBASE_DB)

GITBASE_QUERY_PARAMS = ''
if not IS_EE:
GITBASE_QUERY_PARAMS = '?charset=utf8'
GITBASE_DATABASE_URI = '%s://%s%s:%s/%s%s' % (GITBASE_PREFIX,
GITBASE_AUTH,
GITBASE_HOST,
GITBASE_PORT,
GITBASE_DB,
GITBASE_QUERY_PARAMS)

SQLLAB_DEFAULT_DBID = 2 # set gitbase as default DB in SQL Lab

Expand Down
10 changes: 10 additions & 0 deletions superset/superset/db_engine_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,16 @@ def execute(cursor, query, async_=False):
cursor.execute(query, **kwargs)


class SparkSQLEngineSpec(HiveEngineSpec):
"""Reuses HiveEngineSpec functionality."""

engine = 'sparksql'

@classmethod
def get_view_names(cls, inspector, schema):
return BaseEngineSpec.get_view_names(inspector, schema)


class MssqlEngineSpec(BaseEngineSpec):
engine = 'mssql'
epoch_to_dttm = "dateadd(S, {col}, '1970-01-01')"
Expand Down