kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject [1/3] kudu git commit: KUDU-1522 Fix AlterTable Timestamp col with default value
Date Mon, 15 Aug 2016 19:32:16 GMT
Repository: kudu
Updated Branches:
  refs/heads/master 3dcf28f16 -> 74210b254


KUDU-1522 Fix AlterTable Timestamp col with default value

Change-Id: I7d0b8c79213330f92f6f85e7ed74aa271d8fda92
Reviewed-on: http://gerrit.cloudera.org:8080/3980
Tested-by: Kudu Jenkins
Reviewed-by: Todd Lipcon <todd@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/7132b56c
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/7132b56c
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/7132b56c

Branch: refs/heads/master
Commit: 7132b56cc48d0e4451174580030085af49256644
Parents: 3dcf28f
Author: Ram Mettu <ram.mettu@rms.com>
Authored: Sun Aug 14 01:21:04 2016 -0400
Committer: Todd Lipcon <todd@apache.org>
Committed: Mon Aug 15 17:08:50 2016 +0000

----------------------------------------------------------------------
 .../src/test/java/org/apache/kudu/client/TestKuduTable.java    | 6 ++++--
 src/kudu/common/types.h                                        | 1 +
 2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/7132b56c/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduTable.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduTable.java b/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduTable.java
index 6affc33..7983b53 100644
--- a/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduTable.java
+++ b/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduTable.java
@@ -72,10 +72,12 @@ public class TestKuduTable extends BaseKuduTest {
       ato = new AlterTableOptions().renameTable(tableName);
       submitAlterAndCheck(ato, newTableName, tableName);
 
-      // Try adding two columns, where one is nullable.
+      // Add 3 columns, where one has default value, nullable and Timestamp with default
value
       ato = new AlterTableOptions()
           .addColumn("testaddmulticolnotnull", Type.INT32, 4)
-          .addNullableColumn("testaddmulticolnull", Type.STRING);
+          .addNullableColumn("testaddmulticolnull", Type.STRING)
+          .addColumn("testaddmulticolTimestampcol", Type.TIMESTAMP,
+              (System.currentTimeMillis() * 1000));
       submitAlterAndCheck(ato, tableName);
 
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/7132b56c/src/kudu/common/types.h
----------------------------------------------------------------------
diff --git a/src/kudu/common/types.h b/src/kudu/common/types.h
index f10e6d7..670206a 100644
--- a/src/kudu/common/types.h
+++ b/src/kudu/common/types.h
@@ -579,6 +579,7 @@ class Variant {
       case INT32:        return &(numeric_.i32);
       case UINT32:       return &(numeric_.u32);
       case INT64:        return &(numeric_.i64);
+      case TIMESTAMP:    return &(numeric_.i64);
       case UINT64:       return &(numeric_.u64);
       case FLOAT:        return (&numeric_.float_val);
       case DOUBLE:       return (&numeric_.double_val);


Mime
View raw message