From commits-return-2778-archive-asf-public=cust-asf.ponee.io@superset.incubator.apache.org Sun Jun 2 13:14:13 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 87E1918064E for ; Sun, 2 Jun 2019 15:14:13 +0200 (CEST) Received: (qmail 11848 invoked by uid 500); 2 Jun 2019 13:14:12 -0000 Mailing-List: contact commits-help@superset.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@superset.incubator.apache.org Delivered-To: mailing list commits@superset.incubator.apache.org Received: (qmail 11836 invoked by uid 99); 2 Jun 2019 13:14:12 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Jun 2019 13:14:12 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id AEC518A816; Sun, 2 Jun 2019 13:14:12 +0000 (UTC) Date: Sun, 02 Jun 2019 13:14:12 +0000 To: "commits@superset.apache.org" Subject: [incubator-superset] branch master updated: Fixed Time Grain and Added Drill to README (#7635) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <155948125209.11384.14092187790385757973@gitbox.apache.org> From: villebro@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: incubator-superset X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 1dc17f357cf5c94f663f7a338a7814d5f79452e9 X-Git-Newrev: 257c100c5966c431abf19f6e813842aef8e588b5 X-Git-Rev: 257c100c5966c431abf19f6e813842aef8e588b5 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. villebro 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 257c100 Fixed Time Grain and Added Drill to README (#7635) 257c100 is described below commit 257c100c5966c431abf19f6e813842aef8e588b5 Author: Charles S. Givre AuthorDate: Sun Jun 2 09:13:59 2019 -0400 Fixed Time Grain and Added Drill to README (#7635) * Fixed Time Grain and Added Drill to README * Capitalization Fix --- README.md | 1 + superset/db_engine_specs.py | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 962c8c9..396b8b6 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,7 @@ Superset can be used to visualize data out of most databases: * Redshift * Clickhouse * Apache Kylin +* Apache Drill * Google BigQuery * **more!** look for the availability of a SQLAlchemy dialect for your database to find out whether it will work with Superset diff --git a/superset/db_engine_specs.py b/superset/db_engine_specs.py index 89e677b..5136bca 100644 --- a/superset/db_engine_specs.py +++ b/superset/db_engine_specs.py @@ -753,16 +753,16 @@ class DrillEngineSpec(BaseEngineSpec): time_grain_functions = { None: '{col}', - 'PT1S': "nearestDate({col}, 'SECOND')", - 'PT1M': "nearestDate({col}, 'MINUTE')", - 'PT15M': "nearestDate({col}, 'QUARTER_HOUR')", - 'PT0.5H': "nearestDate({col}, 'HALF_HOUR')", - 'PT1H': "nearestDate({col}, 'HOUR')", - 'P1D': 'TO_DATE({col})', - 'P1W': "nearestDate({col}, 'WEEK_SUNDAY')", - 'P1M': "nearestDate({col}, 'MONTH')", - 'P0.25Y': "nearestDate({col}, 'QUARTER')", - 'P1Y': "nearestDate({col}, 'YEAR')", + 'PT1S': "NEARESTDATE({col}, 'SECOND')", + 'PT1M': "NEARESTDATE({col}, 'MINUTE')", + 'PT15M': "NEARESTDATE({col}, 'QUARTER_HOUR')", + 'PT0.5H': "NEARESTDATE({col}, 'HALF_HOUR')", + 'PT1H': "NEARESTDATE({col}, 'HOUR')", + 'P1D': "NEARESTDATE({col}, 'DAY')", + 'P1W': "NEARESTDATE({col}, 'WEEK_SUNDAY')", + 'P1M': "NEARESTDATE({col}, 'MONTH')", + 'P0.25Y': "NEARESTDATE({col}, 'QUARTER')", + 'P1Y': "NEARESTDATE({col}, 'YEAR')", } # Returns a function to convert a Unix timestamp in milliseconds to a date