You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2017/02/13 22:13:19 UTC

[11/50] [abbrv] ambari git commit: AMBARI-19949. Hive View 2.0: Introduce validation for expression precision >= scale. (dipayanb)

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/branch-feature-AMBARI-12556
Commit: 232b585bdd0350f5b2fb8c2c7ebf200cd3286fa7
Parents: 09e35e1
Author: Dipayan Bhowmick <di...@gmail.com>
Authored: Fri Feb 10 15:09:29 2017 +0530
Committer: Dipayan Bhowmick <di...@gmail.com>
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"});
       }
 
     }