This is an automated email from the ASF dual-hosted git repository.
maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push:
new 71d6ff4 partition and clustering bigquery keys (#6212)
71d6ff4 is described below
commit 71d6ff40d060a073422846a01a3deedcf1568a18
Author: Sumedh Sakdeo <[email protected]>
AuthorDate: Mon Oct 29 11:23:21 2018 -0700
partition and clustering bigquery keys (#6212)
* partition and clustering bigquery keys
* flake8
---
superset/db_engine_specs.py | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/superset/db_engine_specs.py b/superset/db_engine_specs.py
index 8ab5c07..79ef886 100644
--- a/superset/db_engine_specs.py
+++ b/superset/db_engine_specs.py
@@ -1434,6 +1434,28 @@ class BQEngineSpec(BaseEngineSpec):
return mutated_label
@classmethod
+ def extra_table_metadata(cls, database, table_name, schema_name):
+ indexes = database.get_indexes(table_name, schema_name)
+ if not indexes:
+ return {}
+ partitions_columns = [
+ index.get('column_names', []) for index in indexes
+ if index.get('name') == 'partition'
+ ]
+ cluster_columns = [
+ index.get('column_names', []) for index in indexes
+ if index.get('name') == 'clustering'
+ ]
+ return {
+ 'partitions': {
+ 'cols': partitions_columns,
+ },
+ 'clustering': {
+ 'cols': cluster_columns,
+ },
+ }
+
+ @classmethod
def _get_fields(cls, cols):
"""
BigQuery dialect requires us to not use backtick in the fieldname
which are