Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D4048200C17 for ; Fri, 10 Feb 2017 10:40:47 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id D2BAF160B5C; Fri, 10 Feb 2017 09:40:47 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 25201160B5B for ; Fri, 10 Feb 2017 10:40:46 +0100 (CET) Received: (qmail 47507 invoked by uid 500); 10 Feb 2017 09:40:46 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 47498 invoked by uid 99); 10 Feb 2017 09:40:46 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Feb 2017 09:40:46 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 2D8D5DFBDB; Fri, 10 Feb 2017 09:40:46 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dbhowmick@apache.org To: commits@ambari.apache.org Message-Id: <9a26530fdda64d18b9270213be5e5137@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: AMBARI-19949. Hive View 2.0: Introduce validation for expression precision >= scale. (dipayanb) Date: Fri, 10 Feb 2017 09:40:46 +0000 (UTC) archived-at: Fri, 10 Feb 2017 09:40:48 -0000 Repository: ambari Updated Branches: refs/heads/trunk 09e35e1e3 -> 232b585bd AMBARI-19949. Hive View 2.0: Introduce validation for expression precision >= scale. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/232b585b Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/232b585b Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/232b585b Branch: refs/heads/trunk Commit: 232b585bdd0350f5b2fb8c2c7ebf200cd3286fa7 Parents: 09e35e1 Author: Dipayan Bhowmick Authored: Fri Feb 10 15:09:29 2017 +0530 Committer: Dipayan Bhowmick Committed: Fri Feb 10 15:10:17 2017 +0530 ---------------------------------------------------------------------- contrib/views/hive20/src/main/resources/ui/app/models/column.js | 2 ++ 1 file changed, 2 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/232b585b/contrib/views/hive20/src/main/resources/ui/app/models/column.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/models/column.js b/contrib/views/hive20/src/main/resources/ui/app/models/column.js index 1d9ccce..f38309b 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/models/column.js +++ b/contrib/views/hive20/src/main/resources/ui/app/models/column.js @@ -87,6 +87,8 @@ let Column = Ember.Object.extend(Ember.Copyable,{ this.get('errors').pushObject({type: 'precision', error: "Precision can only be a number"}); } else if(this.get('precision') <= 0) { this.get('errors').pushObject({type: 'precision', error: "Precision can only be greater than zero"}); + } else if(this.get('type.hasScale') && this.get('scale') && (this.get('precision') < this.get('scale'))) { + this.get('errors').pushObject({type: 'precision', error: "Precision can only be greater than scale"}); } }