kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danburk...@apache.org
Subject incubator-kudu git commit: Remove default table partitioning
Date Thu, 26 May 2016 22:50:03 GMT
Repository: incubator-kudu
Updated Branches:
  refs/heads/master 4ef25249e -> 0e7c257f9


Remove default table partitioning

This commit removes the current default of creating tables with range
partitioning over the primary key columns with no splits. This default is
problematic because it results in a single tablet, which is a known
anti-pattern. Kudu can't predict appropriate split rows without knowledge of the
dataset, so creating default splits is not technically feasible.

A better default to range partitioning would be to hash partition on the primary
key columns with a number of buckets based on the number of tablet servers.
Unfortunately, it's similarly difficult to predict an appopriate number of hash
buckets with knowledge of the data set.

Since changing the default would be a breaking change, and we don't currently
have a bullet-proof default option, this commit changes the table creator in the
C++ and Java clients to force users to explicitly specify at least range or
hash partitioning. Users who really do want a table with no partitioning (a
single tablet), can still explicitly set the range partition columns to an
empty list and provide no split rows.

Change-Id: I7021d7950f8dbb4918503ea6fab2e6ee35076064
Reviewed-on: http://gerrit.cloudera.org:8080/3131
Tested-by: Kudu Jenkins
Reviewed-by: Misty Stanley-Jones <misty@apache.org>


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

Branch: refs/heads/master
Commit: 0e7c257f950e8875fe9d6a541cc03918ae23912e
Parents: 4ef2524
Author: Dan Burkert <dan@cloudera.com>
Authored: Wed May 18 14:22:17 2016 -0700
Committer: Misty Stanley-Jones <misty@apache.org>
Committed: Thu May 26 22:24:20 2016 +0000

----------------------------------------------------------------------
 docs/release_notes.adoc                         |  5 +++
 docs/schema_design.adoc                         | 27 ++++++++------
 .../tools/IntegrationTestBigLinkedList.java     |  3 +-
 .../org/kududb/mapreduce/tools/ITImportCsv.java |  5 ++-
 .../java/org/kududb/client/AsyncKuduClient.java | 23 +++++-------
 .../org/kududb/client/CreateTableOptions.java   | 19 ++++++----
 .../main/java/org/kududb/client/KuduClient.java | 11 ------
 .../java/org/kududb/client/BaseKuduTest.java    | 38 +++++++-------------
 .../org/kududb/client/TestAsyncKuduClient.java  |  7 ++--
 .../org/kududb/client/TestAsyncKuduSession.java |  4 ++-
 .../kududb/client/TestFlexiblePartitioning.java | 10 +++++-
 .../java/org/kududb/client/TestHybridTime.java  |  4 ++-
 .../java/org/kududb/client/TestKuduClient.java  | 27 +++++++++-----
 .../java/org/kududb/client/TestKuduSession.java | 13 ++++---
 .../java/org/kududb/client/TestKuduTable.java   |  8 +++--
 .../org/kududb/client/TestLeaderFailover.java   |  2 +-
 .../org/kududb/client/TestMasterFailover.java   |  2 +-
 .../java/org/kududb/client/TestRowErrors.java   |  5 +--
 .../java/org/kududb/client/TestRowResult.java   |  3 +-
 .../org/kududb/client/TestScanPredicate.java    | 27 ++++++++------
 .../kududb/client/TestScannerMultiTablet.java   |  4 ++-
 .../java/org/kududb/client/TestStatistics.java  |  2 +-
 .../java/org/kududb/client/TestTimeouts.java    |  3 +-
 .../org/kududb/flume/sink/KuduSinkTest.java     | 13 ++++---
 .../mapreduce/ITKuduTableInputFormat.java       |  2 +-
 .../mapreduce/ITKuduTableOutputFormat.java      |  2 +-
 .../org/kududb/mapreduce/ITOutputFormatJob.java |  2 +-
 .../kududb/spark/kudu/DefaultSourceTest.scala   | 12 ++++---
 .../org/kududb/spark/kudu/TestContext.scala     |  4 ++-
 python/kudu/client.pyx                          |  5 ++-
 python/kudu/tests/common.py                     |  9 +++--
 python/kudu/tests/test_client.py                |  5 +--
 src/kudu/benchmarks/tpch/rpc_line_item_dao.cc   |  1 +
 src/kudu/client/client-test.cc                  | 12 +++++++
 src/kudu/client/client.cc                       |  6 ++++
 src/kudu/client/client.h                        | 15 +++++---
 src/kudu/client/predicate-test.cc               |  1 +
 src/kudu/client/samples/sample.cc               |  4 +++
 src/kudu/integration-tests/all_types-itest.cc   |  1 +
 .../alter_table-randomized-test.cc              |  1 +
 src/kudu/integration-tests/alter_table-test.cc  |  2 ++
 .../integration-tests/create-table-itest.cc     |  3 ++
 .../create-table-stress-test.cc                 |  1 +
 src/kudu/integration-tests/delete_table-test.cc |  1 +
 .../full_stack-insert-scan-test.cc              |  1 +
 src/kudu/integration-tests/fuzz-itest.cc        |  1 +
 .../integration-tests/linked_list-test-util.h   |  1 +
 .../integration-tests/master_failover-itest.cc  |  1 +
 .../master_replication-itest.cc                 |  1 +
 .../integration-tests/remote_bootstrap-itest.cc |  1 +
 src/kudu/integration-tests/test_workload.cc     |  1 +
 src/kudu/integration-tests/ts_itest-base.h      |  1 +
 .../ts_tablet_manager-itest.cc                  |  1 +
 .../update_scan_delta_compact-test.cc           |  1 +
 .../integration-tests/write_throttling-itest.cc |  1 +
 src/kudu/tools/ksck_remote-test.cc              |  1 +
 56 files changed, 226 insertions(+), 140 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/docs/release_notes.adoc
----------------------------------------------------------------------
diff --git a/docs/release_notes.adoc b/docs/release_notes.adoc
index 44ec278..826d911 100644
--- a/docs/release_notes.adoc
+++ b/docs/release_notes.adoc
@@ -66,6 +66,11 @@ Hadoop storage technologies.
 
 - The kudu-spark subproject was been renamed to follow naming conventions for scala kudu-spark_2.10
 
+- Default table partitioning has been removed. All tables must now be created
+  with explicit partitioning. Existing tables are unaffected. See the
+  link:schema_design.html#no_default_partitioning[schema design guide] for more
+  details.
+
 [[rn_0.9.0_new_features]]
 ==== New features
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/docs/schema_design.adoc
----------------------------------------------------------------------
diff --git a/docs/schema_design.adoc b/docs/schema_design.adoc
index 7cd1230..e6a7f44 100644
--- a/docs/schema_design.adoc
+++ b/docs/schema_design.adoc
@@ -160,6 +160,15 @@ can be improved if all of the data for the scan is located in the same
 tablet. Understanding these fundamental trade-offs is central to designing an effective
 partition schema.
 
+[[no_default_partitioning]]
+[IMPORTANT]
+.No Default Partitioning
+===
+Kudu does not provide a default partitioning strategy when creating tables. It
+is strongly recommended to ensure that new tables have at least as many tablets
+as tablet servers (but Kudu can support many tablets per tablet server).
+===
+
 Kudu provides two types of partition schema: <<range-partitioning, range partitioning>> and
 <<hash-bucketing,hash bucketing>>. These schema types can be <<hash-and-range, used
 together>> or independently. Kudu does not yet allow tablets to be split after
@@ -171,21 +180,19 @@ a sufficient number of tablets are created.
 
 With range partitioning, rows are distributed into tablets using a totally-ordered
 distribution key. Each tablet is assigned a contiguous segment of the table's
-distribution keyspace. By default, the distribution key uses all of the columns of the
-primary key, but it may be configured to use any subset of the primary key
-columns.
+distribution keyspace. Tables may be range partitioned on any subset of the
+primary key columns.
 
 During table creation, tablet boundaries are specified as a sequence of _split
 rows_. Consider the following table schema (using SQL syntax for clarity):
 
 [source,sql]
 ----
-CREATE TABLE customers (
-  first_name STRING NOT NULL,
-  last_name STRING NOT NULL,
-  order_count INT32,
-  PRIMARY KEY (last_name, first_name),
-)
+CREATE TABLE customers (last_name STRING NOT NULL,
+                        first_name STRING NOT NULL,
+                        order_count INT32)
+PRIMARY KEY (last_name, first_name)
+DISTRIBUTE BY RANGE (last_name, first_name);
 ----
 
 Specifying the split rows as `\(("b", ""), ("c", ""), ("d", ""), .., ("z", ""))`
@@ -226,7 +233,7 @@ CREATE TABLE metrics (
 )
 ----
 
-If you use the default range partitioning over the primary key columns, inserts will
+If you use range partitioning over the primary key columns, inserts will
 tend to only go to the tablet covering the current time, which limits the
 maximum write throughput to the throughput of a single tablet. If you use hash
 partitioning, you can guarantee a number of parallel writes equal to the number

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/java/kudu-client-tools/src/main/java/org/kududb/mapreduce/tools/IntegrationTestBigLinkedList.java
----------------------------------------------------------------------
diff --git a/java/kudu-client-tools/src/main/java/org/kududb/mapreduce/tools/IntegrationTestBigLinkedList.java b/java/kudu-client-tools/src/main/java/org/kududb/mapreduce/tools/IntegrationTestBigLinkedList.java
index 64bf30b..1d836bd 100644
--- a/java/kudu-client-tools/src/main/java/org/kududb/mapreduce/tools/IntegrationTestBigLinkedList.java
+++ b/java/kudu-client-tools/src/main/java/org/kududb/mapreduce/tools/IntegrationTestBigLinkedList.java
@@ -611,7 +611,8 @@ public class IntegrationTestBigLinkedList extends Configured implements Tool {
         }
 
         CreateTableOptions builder =
-            new CreateTableOptions().setNumReplicas(parser.getNumReplicas());
+            new CreateTableOptions().setNumReplicas(parser.getNumReplicas())
+                                    .setRangePartitionColumns(ImmutableList.of("key1"));
         if (numTablets > 1) {
           BigInteger min = BigInteger.valueOf(Long.MIN_VALUE);
           BigInteger max = BigInteger.valueOf(Long.MAX_VALUE);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/java/kudu-client-tools/src/test/java/org/kududb/mapreduce/tools/ITImportCsv.java
----------------------------------------------------------------------
diff --git a/java/kudu-client-tools/src/test/java/org/kududb/mapreduce/tools/ITImportCsv.java b/java/kudu-client-tools/src/test/java/org/kududb/mapreduce/tools/ITImportCsv.java
index a065112..d7b8352 100644
--- a/java/kudu-client-tools/src/test/java/org/kududb/mapreduce/tools/ITImportCsv.java
+++ b/java/kudu-client-tools/src/test/java/org/kududb/mapreduce/tools/ITImportCsv.java
@@ -38,6 +38,8 @@ import java.util.ArrayList;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
+import com.google.common.collect.ImmutableList;
+
 public class ITImportCsv extends BaseKuduTest {
 
   private static final String TABLE_NAME =
@@ -66,7 +68,8 @@ public class ITImportCsv extends BaseKuduTest {
         .build());
     schema = new Schema(columns);
 
-    createTable(TABLE_NAME, schema, new CreateTableOptions());
+    createTable(TABLE_NAME, schema,
+                new CreateTableOptions().setRangePartitionColumns(ImmutableList.of("key")));
   }
 
   @AfterClass

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/java/kudu-client/src/main/java/org/kududb/client/AsyncKuduClient.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/main/java/org/kududb/client/AsyncKuduClient.java b/java/kudu-client/src/main/java/org/kududb/client/AsyncKuduClient.java
index d237e3b..bfda23e 100644
--- a/java/kudu-client/src/main/java/org/kududb/client/AsyncKuduClient.java
+++ b/java/kudu-client/src/main/java/org/kududb/client/AsyncKuduClient.java
@@ -280,18 +280,6 @@ public class AsyncKuduClient implements AutoCloseable {
   }
 
   /**
-   * Create a table on the cluster with the specified name and schema. Default table
-   * configurations are used, mainly the table will have one tablet.
-   * @param name the table's name
-   * @param schema the table's schema
-   * @return a deferred object to track the progress of the createTable command that gives
-   * an object to communicate with the created table
-   */
-  public Deferred<KuduTable> createTable(String name, Schema schema) {
-    return this.createTable(name, schema, new CreateTableOptions());
-  }
-
-  /**
    * Create a table on the cluster with the specified name, schema, and table configurations.
    * @param name the table's name
    * @param schema the table's schema
@@ -303,10 +291,15 @@ public class AsyncKuduClient implements AutoCloseable {
                                          CreateTableOptions builder) {
     checkIsClosed();
     if (builder == null) {
-      builder = new CreateTableOptions();
+      throw new IllegalArgumentException("CreateTableOptions may not be null");
+    }
+    if (!builder.getBuilder().getPartitionSchema().hasRangeSchema() &&
+        builder.getBuilder().getPartitionSchema().getHashBucketSchemasCount() == 0) {
+      throw new IllegalArgumentException("Table partitioning must be specified using " +
+                                         "setRangePartitionColumns or addHashPartitions");
+
     }
-    CreateTableRequest create = new CreateTableRequest(this.masterTable, name, schema,
-        builder);
+    CreateTableRequest create = new CreateTableRequest(this.masterTable, name, schema, builder);
     create.setTimeoutMillis(defaultAdminOperationTimeoutMs);
     return sendRpcToTablet(create).addCallbackDeferring(
         new Callback<Deferred<KuduTable>, CreateTableResponse>() {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/java/kudu-client/src/main/java/org/kududb/client/CreateTableOptions.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/main/java/org/kududb/client/CreateTableOptions.java b/java/kudu-client/src/main/java/org/kududb/client/CreateTableOptions.java
index da8c2bc..05479fe 100644
--- a/java/kudu-client/src/main/java/org/kududb/client/CreateTableOptions.java
+++ b/java/kudu-client/src/main/java/org/kududb/client/CreateTableOptions.java
@@ -16,14 +16,15 @@
 // under the License.
 package org.kududb.client;
 
-import org.kududb.Common;
 import com.google.common.collect.Lists;
+
+import java.util.List;
+
+import org.kududb.Common;
 import org.kududb.annotations.InterfaceAudience;
 import org.kududb.annotations.InterfaceStability;
 import org.kududb.master.Master;
 
-import java.util.List;
-
 /**
  * This is a builder class for all the options that can be provided while creating a table.
  */
@@ -94,10 +95,14 @@ public class CreateTableOptions {
   /**
    * Set the columns on which the table will be range-partitioned.
    *
-   * Every column must be a part of the table's primary key. If not set, the
-   * table will be created with the primary-key columns as the range-partition
-   * columns. If called with an empty vector, the table will be created without
-   * range partitioning.
+   * Every column must be a part of the table's primary key. If not set or if
+   * called with an empty vector, the table will be created without range
+   * partitioning.
+   *
+   * Tables must be created with either range, hash, or range and hash
+   * partitioning. To force the use of a single tablet (not recommended),
+   * call this method with an empty list and set no split rows and no hash
+   * partitions.
    *
    * @param columns the range partitioned columns
    * @return this instance

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/java/kudu-client/src/main/java/org/kududb/client/KuduClient.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/main/java/org/kududb/client/KuduClient.java b/java/kudu-client/src/main/java/org/kududb/client/KuduClient.java
index fe2a214..db432c8 100644
--- a/java/kudu-client/src/main/java/org/kududb/client/KuduClient.java
+++ b/java/kudu-client/src/main/java/org/kududb/client/KuduClient.java
@@ -48,17 +48,6 @@ public class KuduClient implements AutoCloseable {
   }
 
   /**
-   * Create a table on the cluster with the specified name and schema. Default table
-   * configurations are used, mainly the table will have one tablet.
-   * @param name Table's name
-   * @param schema Table's schema
-   * @return an object to communicate with the created table
-   */
-  public KuduTable createTable(String name, Schema schema) throws Exception {
-    return createTable(name, schema, new CreateTableOptions());
-  }
-
-  /**
    * Create a table on the cluster with the specified name, schema, and table configurations.
    * @param name the table's name
    * @param schema the table's schema

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/java/kudu-client/src/test/java/org/kududb/client/BaseKuduTest.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/kududb/client/BaseKuduTest.java b/java/kudu-client/src/test/java/org/kududb/client/BaseKuduTest.java
index 9d945c0..92e7cf4 100644
--- a/java/kudu-client/src/test/java/org/kududb/client/BaseKuduTest.java
+++ b/java/kudu-client/src/test/java/org/kududb/client/BaseKuduTest.java
@@ -70,8 +70,8 @@ public class BaseKuduTest {
   // We create both versions of the client for ease of use.
   protected static AsyncKuduClient client;
   protected static KuduClient syncClient;
-  protected static Schema basicSchema = getBasicSchema();
-  protected static Schema allTypesSchema = getSchemaWithAllTypes();
+  protected static final Schema basicSchema = getBasicSchema();
+  protected static final Schema allTypesSchema = getSchemaWithAllTypes();
 
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
@@ -114,29 +114,9 @@ public class BaseKuduTest {
   }
 
   protected static KuduTable createTable(String tableName, Schema schema,
-                                         CreateTableOptions builder) {
+                                         CreateTableOptions builder) throws Exception {
     LOG.info("Creating table: {}", tableName);
-    Deferred<KuduTable> d = client.createTable(tableName, schema, builder);
-    final AtomicBoolean gotError = new AtomicBoolean(false);
-    d.addErrback(new Callback<Object, Object>() {
-      @Override
-      public Object call(Object arg) throws Exception {
-        gotError.set(true);
-        LOG.error("Error : " + arg);
-        return null;
-      }
-    });
-    KuduTable table = null;
-    try {
-      table = d.join(DEFAULT_SLEEP);
-    } catch (Exception e) {
-      fail("Timed out");
-    }
-    if (gotError.get()) {
-      fail("Got error during table creation, is the Kudu master running at " +
-          masterAddresses + "?");
-    }
-    return table;
+    return client.syncClient().createTable(tableName, schema, builder);
   }
 
   /**
@@ -189,7 +169,7 @@ public class BaseKuduTest {
   private static final int[] KEYS = new int[] {10, 20, 30};
   protected static KuduTable createFourTabletsTableWithNineRows(String tableName) throws
       Exception {
-    CreateTableOptions builder = new CreateTableOptions();
+    CreateTableOptions builder = getBasicCreateTableOptions();
     for (int i : KEYS) {
       PartialRow splitRow = basicSchema.newPartialRow();
       splitRow.addInt(0, i);
@@ -234,6 +214,10 @@ public class BaseKuduTest {
     return new Schema(columns);
   }
 
+  public static CreateTableOptions getAllTypesCreateTableOptions() {
+    return new CreateTableOptions().setRangePartitionColumns(ImmutableList.of("int8"));
+  }
+
   public static Schema getBasicSchema() {
     ArrayList<ColumnSchema> columns = new ArrayList<ColumnSchema>(5);
     columns.add(new ColumnSchema.ColumnSchemaBuilder("key", Type.INT32).key(true).build());
@@ -249,6 +233,10 @@ public class BaseKuduTest {
     return new Schema(columns);
   }
 
+  public static CreateTableOptions getBasicCreateTableOptions() {
+    return new CreateTableOptions().setRangePartitionColumns(ImmutableList.of("key"));
+  }
+
   protected Insert createBasicSchemaInsert(KuduTable table, int key) {
     Insert insert = table.newInsert();
     PartialRow row = insert.getRow();

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/java/kudu-client/src/test/java/org/kududb/client/TestAsyncKuduClient.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/kududb/client/TestAsyncKuduClient.java b/java/kudu-client/src/test/java/org/kududb/client/TestAsyncKuduClient.java
index 1bd90b3..9879169 100644
--- a/java/kudu-client/src/test/java/org/kududb/client/TestAsyncKuduClient.java
+++ b/java/kudu-client/src/test/java/org/kududb/client/TestAsyncKuduClient.java
@@ -20,6 +20,9 @@ import com.google.common.base.Charsets;
 import com.google.common.base.Stopwatch;
 import com.google.protobuf.ByteString;
 import com.stumbleupon.async.Deferred;
+
+import java.util.concurrent.TimeUnit;
+
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.kududb.Common;
@@ -28,8 +31,6 @@ import org.kududb.master.Master;
 
 import static org.junit.Assert.*;
 
-import java.util.concurrent.TimeUnit;
-
 public class TestAsyncKuduClient extends BaseKuduTest {
 
   private static final String TABLE_NAME =
@@ -40,7 +41,7 @@ public class TestAsyncKuduClient extends BaseKuduTest {
   public static void setUpBeforeClass() throws Exception {
     BaseKuduTest.setUpBeforeClass();
     // Set to 1 for testDisconnect to always test disconnecting the right server.
-    CreateTableOptions options = new CreateTableOptions().setNumReplicas(1);
+    CreateTableOptions options = getBasicCreateTableOptions().setNumReplicas(1);
     table = createTable(TABLE_NAME, basicSchema, options);
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/java/kudu-client/src/test/java/org/kududb/client/TestAsyncKuduSession.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/kududb/client/TestAsyncKuduSession.java b/java/kudu-client/src/test/java/org/kududb/client/TestAsyncKuduSession.java
index 6e47df8..328b6ea 100644
--- a/java/kudu-client/src/test/java/org/kududb/client/TestAsyncKuduSession.java
+++ b/java/kudu-client/src/test/java/org/kududb/client/TestAsyncKuduSession.java
@@ -19,6 +19,8 @@ package org.kududb.client;
 import org.kududb.Schema;
 import org.kududb.WireProtocol.AppStatusPB;
 import org.kududb.tserver.Tserver.TabletServerErrorPB;
+
+import com.google.common.collect.ImmutableList;
 import com.stumbleupon.async.Callback;
 import com.stumbleupon.async.Deferred;
 import com.stumbleupon.async.TimeoutException;
@@ -54,7 +56,7 @@ public class TestAsyncKuduSession extends BaseKuduTest {
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
     BaseKuduTest.setUpBeforeClass();
-    table = createTable(TABLE_NAME, schema, new CreateTableOptions());
+    table = createTable(TABLE_NAME, schema, getBasicCreateTableOptions());
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/java/kudu-client/src/test/java/org/kududb/client/TestFlexiblePartitioning.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/kududb/client/TestFlexiblePartitioning.java b/java/kudu-client/src/test/java/org/kududb/client/TestFlexiblePartitioning.java
index 2fc2656..1efba5a 100644
--- a/java/kudu-client/src/test/java/org/kududb/client/TestFlexiblePartitioning.java
+++ b/java/kudu-client/src/test/java/org/kududb/client/TestFlexiblePartitioning.java
@@ -247,7 +247,8 @@ public class TestFlexiblePartitioning extends BaseKuduTest {
   @Test
   public void testSimplePartitionedTable() throws Exception {
     Schema schema = createSchema();
-    CreateTableOptions tableBuilder = new CreateTableOptions();
+    CreateTableOptions tableBuilder =
+        new CreateTableOptions().setRangePartitionColumns(ImmutableList.of("a", "b", "c"));
 
     PartialRow split = schema.newPartialRow();
     split.addString("c", "3");
@@ -261,6 +262,13 @@ public class TestFlexiblePartitioning extends BaseKuduTest {
     testPartitionSchema(tableBuilder);
   }
 
+  @Test
+  public void testUnpartitionedTable() throws Exception {
+    CreateTableOptions tableBuilder =
+        new CreateTableOptions().setRangePartitionColumns(ImmutableList.<String>of());
+    testPartitionSchema(tableBuilder);
+  }
+
   public static class Row implements Comparable<Row> {
     private final String a;
     private final String b;

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/java/kudu-client/src/test/java/org/kududb/client/TestHybridTime.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/kududb/client/TestHybridTime.java b/java/kudu-client/src/test/java/org/kududb/client/TestHybridTime.java
index 2ce3cde..666ac38 100644
--- a/java/kudu-client/src/test/java/org/kududb/client/TestHybridTime.java
+++ b/java/kudu-client/src/test/java/org/kududb/client/TestHybridTime.java
@@ -16,6 +16,7 @@
 // under the License.
 package org.kududb.client;
 
+import com.google.common.collect.ImmutableList;
 import com.stumbleupon.async.Deferred;
 import org.kududb.ColumnSchema;
 import org.kududb.Schema;
@@ -55,7 +56,8 @@ public class TestHybridTime extends BaseKuduTest {
 
     // Using multiple tablets doesn't work with the current way this test works since we could
     // jump from one TS to another which changes the logical clock.
-    CreateTableOptions builder = new CreateTableOptions();
+    CreateTableOptions builder =
+        new CreateTableOptions().setRangePartitionColumns(ImmutableList.of("key"));
     table = createTable(TABLE_NAME, schema, builder);
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/java/kudu-client/src/test/java/org/kududb/client/TestKuduClient.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/kududb/client/TestKuduClient.java b/java/kudu-client/src/test/java/org/kududb/client/TestKuduClient.java
index 67f0ec6..8ee0eb4 100644
--- a/java/kudu-client/src/test/java/org/kududb/client/TestKuduClient.java
+++ b/java/kudu-client/src/test/java/org/kududb/client/TestKuduClient.java
@@ -77,13 +77,17 @@ public class TestKuduClient extends BaseKuduTest {
     return new Schema(columns);
   }
 
+  private static CreateTableOptions createTableOptions() {
+    return new CreateTableOptions().setRangePartitionColumns(ImmutableList.of("key"));
+  }
+
   /**
    * Test creating and deleting a table through a KuduClient.
    */
   @Test(timeout = 100000)
   public void testCreateDeleteTable() throws Exception {
     // Check that we can create a table.
-    syncClient.createTable(tableName, basicSchema);
+    syncClient.createTable(tableName, basicSchema, getBasicCreateTableOptions());
     assertFalse(syncClient.getTablesList().getTablesList().isEmpty());
     assertTrue(syncClient.getTablesList().getTablesList().contains(tableName));
 
@@ -95,7 +99,7 @@ public class TestKuduClient extends BaseKuduTest {
     List<ColumnSchema> columns = new ArrayList<>(basicSchema.getColumns());
     columns.add(new ColumnSchema.ColumnSchemaBuilder("one more", Type.STRING).build());
     Schema newSchema = new Schema(columns);
-    syncClient.createTable(tableName, newSchema);
+    syncClient.createTable(tableName, newSchema, getBasicCreateTableOptions());
 
     // Check that we can open a table and see that it has the new schema.
     KuduTable table = syncClient.openTable(tableName);
@@ -116,7 +120,7 @@ public class TestKuduClient extends BaseKuduTest {
   @Test(timeout = 100000)
   public void testStrings() throws Exception {
     Schema schema = createManyStringsSchema();
-    syncClient.createTable(tableName, schema);
+    syncClient.createTable(tableName, schema, createTableOptions());
 
     KuduSession session = syncClient.newSession();
     KuduTable table = syncClient.openTable(tableName);
@@ -170,7 +174,7 @@ public class TestKuduClient extends BaseKuduTest {
   @Test(timeout = 100000)
   public void testUTF8() throws Exception {
     Schema schema = createManyStringsSchema();
-    syncClient.createTable(tableName, schema);
+    syncClient.createTable(tableName, schema, createTableOptions());
 
     KuduSession session = syncClient.newSession();
     KuduTable table = syncClient.openTable(tableName);
@@ -197,7 +201,7 @@ public class TestKuduClient extends BaseKuduTest {
   @Test(timeout = 100000)
   public void testBinaryColumns() throws Exception {
     Schema schema = createSchemaWithBinaryColumns();
-    syncClient.createTable(tableName, schema);
+    syncClient.createTable(tableName, schema, createTableOptions());
 
     byte[] testArray = new byte[] {1, 2, 3, 4, 5, 6 ,7, 8, 9};
 
@@ -240,7 +244,7 @@ public class TestKuduClient extends BaseKuduTest {
   @Test(timeout = 100000)
   public void testTimestampColumns() throws Exception {
     Schema schema = createSchemaWithTimestampColumns();
-    syncClient.createTable(tableName, schema);
+    syncClient.createTable(tableName, schema, createTableOptions());
 
     List<Long> timestamps = new ArrayList<>();
 
@@ -288,7 +292,7 @@ public class TestKuduClient extends BaseKuduTest {
   @Test
   public void testScanWithPredicates() throws Exception {
     Schema schema = createManyStringsSchema();
-    syncClient.createTable(tableName, schema);
+    syncClient.createTable(tableName, schema, createTableOptions());
 
     KuduSession session = syncClient.newSession();
     session.setFlushMode(SessionConfiguration.FlushMode.AUTO_FLUSH_BACKGROUND);
@@ -408,7 +412,7 @@ public class TestKuduClient extends BaseKuduTest {
   @Test(timeout = 100000)
   public void testAutoClose() throws Exception {
     try (KuduClient localClient = new KuduClient.KuduClientBuilder(masterAddresses).build()) {
-      localClient.createTable(tableName, basicSchema);
+      localClient.createTable(tableName, basicSchema, getBasicCreateTableOptions());
       KuduTable table = localClient.openTable(tableName);
       KuduSession session = localClient.newSession();
 
@@ -432,7 +436,7 @@ public class TestKuduClient extends BaseKuduTest {
         .build();
     long buildTime = (System.nanoTime() - startTime) / 1000000000L;
     assertTrue("Building KuduClient is slow, maybe netty get stuck", buildTime < 3);
-    localClient.createTable(tableName, basicSchema);
+    localClient.createTable(tableName, basicSchema, getBasicCreateTableOptions());
     Thread[] threads = new Thread[4];
     for (int t = 0; t < 4; t++) {
       final int id = t;
@@ -460,4 +464,9 @@ public class TestKuduClient extends BaseKuduTest {
     }
     localClient.shutdown();
   }
+
+  @Test(expected=IllegalArgumentException.class)
+  public void testNoDefaultPartitioning() throws Exception {
+    syncClient.createTable(tableName, basicSchema, new CreateTableOptions());
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/java/kudu-client/src/test/java/org/kududb/client/TestKuduSession.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/kududb/client/TestKuduSession.java b/java/kudu-client/src/test/java/org/kududb/client/TestKuduSession.java
index 4c07421..8ccd30b 100644
--- a/java/kudu-client/src/test/java/org/kududb/client/TestKuduSession.java
+++ b/java/kudu-client/src/test/java/org/kududb/client/TestKuduSession.java
@@ -16,7 +16,6 @@
 // under the License.
 package org.kududb.client;
 
-import java.util.ArrayList;
 import java.util.List;
 
 import org.junit.Test;
@@ -33,7 +32,7 @@ public class TestKuduSession extends BaseKuduTest {
   @Test(timeout = 100000)
   public void testBasicOps() throws Exception {
     String tableName = TABLE_NAME_PREFIX + "-testBasicOps";
-    table = createTable(tableName, basicSchema, new CreateTableOptions());
+    table = createTable(tableName, basicSchema, getBasicCreateTableOptions());
 
     KuduSession session = syncClient.newSession();
     for (int i = 0; i < 10; i++) {
@@ -56,7 +55,7 @@ public class TestKuduSession extends BaseKuduTest {
   @Test(timeout = 100000)
   public void testIgnoreAllDuplicateRows() throws Exception {
     String tableName = TABLE_NAME_PREFIX + "-testIgnoreAllDuplicateRows";
-    table = createTable(tableName, basicSchema, new CreateTableOptions());
+    table = createTable(tableName, basicSchema, getBasicCreateTableOptions());
 
     KuduSession session = syncClient.newSession();
     session.setIgnoreAllDuplicateRows(true);
@@ -88,7 +87,7 @@ public class TestKuduSession extends BaseKuduTest {
   @Test(timeout = 100000)
   public void testBatchWithSameRow() throws Exception {
     String tableName = TABLE_NAME_PREFIX + "-testBatchWithSameRow";
-    table = createTable(tableName, basicSchema, new CreateTableOptions());
+    table = createTable(tableName, basicSchema, getBasicCreateTableOptions());
 
     KuduSession session = syncClient.newSession();
     session.setFlushMode(SessionConfiguration.FlushMode.MANUAL_FLUSH);
@@ -125,7 +124,7 @@ public class TestKuduSession extends BaseKuduTest {
   @Test(timeout = 10000)
   public void testConcurrentFlushes() throws Exception {
     String tableName = TABLE_NAME_PREFIX + "-testConcurrentFlushes";
-    CreateTableOptions builder = new CreateTableOptions();
+    CreateTableOptions builder = getBasicCreateTableOptions();
     int numTablets = 4;
     int numRowsPerTablet = 100;
 
@@ -155,7 +154,7 @@ public class TestKuduSession extends BaseKuduTest {
   @Test(timeout = 10000)
   public void testOverWritingValues() throws Exception {
     String tableName = TABLE_NAME_PREFIX + "-OverridingValues";
-    table = createTable(tableName, basicSchema, null);
+    table = createTable(tableName, basicSchema, getBasicCreateTableOptions());
     KuduSession session = syncClient.newSession();
     Insert insert = createInsert(0);
     PartialRow row = insert.getRow();
@@ -192,7 +191,7 @@ public class TestKuduSession extends BaseKuduTest {
   @Test(timeout = 10000)
   public void testUpsert() throws Exception {
     String tableName = TABLE_NAME_PREFIX + "-Upsert";
-    table = createTable(tableName, basicSchema, null);
+    table = createTable(tableName, basicSchema, getBasicCreateTableOptions());
     KuduSession session = syncClient.newSession();
 
     // Test an Upsert that acts as an Insert.

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/java/kudu-client/src/test/java/org/kududb/client/TestKuduTable.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/kududb/client/TestKuduTable.java b/java/kudu-client/src/test/java/org/kududb/client/TestKuduTable.java
index 34e6cc9..584a8b1 100644
--- a/java/kudu-client/src/test/java/org/kududb/client/TestKuduTable.java
+++ b/java/kudu-client/src/test/java/org/kududb/client/TestKuduTable.java
@@ -29,6 +29,8 @@ import java.util.List;
 
 import static org.junit.Assert.*;
 
+import com.google.common.collect.ImmutableList;
+
 public class TestKuduTable extends BaseKuduTest {
 
   private static final Logger LOG = LoggerFactory.getLogger(TestKuduTable.class);
@@ -45,7 +47,7 @@ public class TestKuduTable extends BaseKuduTest {
   @Test(timeout = 100000)
   public void testAlterTable() throws Exception {
     String tableName = BASE_TABLE_NAME + System.currentTimeMillis();
-    createTable(tableName, basicSchema, null);
+    createTable(tableName, basicSchema, getBasicCreateTableOptions());
 
     // Add a col.
     AlterTableOptions ato = new AlterTableOptions().addColumn("testaddint", Type.INT32, 4);
@@ -115,7 +117,7 @@ public class TestKuduTable extends BaseKuduTest {
     }
     // Test with defaults
     String tableWithDefault = BASE_TABLE_NAME + "WithDefault" + System.currentTimeMillis();
-    CreateTableOptions builder = new CreateTableOptions();
+    CreateTableOptions builder = getBasicCreateTableOptions();
     List<ColumnSchema> columns = new ArrayList<ColumnSchema>(schema.getColumnCount());
     int defaultInt = 30;
     String defaultString = "data";
@@ -211,7 +213,7 @@ public class TestKuduTable extends BaseKuduTest {
 
   public KuduTable createTableWithSplitsAndTest(int splitsCount) throws Exception {
     String tableName = BASE_TABLE_NAME + System.currentTimeMillis();
-    CreateTableOptions builder = new CreateTableOptions();
+    CreateTableOptions builder = getBasicCreateTableOptions();
 
     if (splitsCount != 0) {
       for (int i = 1; i <= splitsCount; i++) {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/java/kudu-client/src/test/java/org/kududb/client/TestLeaderFailover.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/kududb/client/TestLeaderFailover.java b/java/kudu-client/src/test/java/org/kududb/client/TestLeaderFailover.java
index 544feab..08926f7 100644
--- a/java/kudu-client/src/test/java/org/kududb/client/TestLeaderFailover.java
+++ b/java/kudu-client/src/test/java/org/kududb/client/TestLeaderFailover.java
@@ -31,7 +31,7 @@ public class TestLeaderFailover extends BaseKuduTest {
   public static void setUpBeforeClass() throws Exception {
     BaseKuduTest.setUpBeforeClass();
 
-    CreateTableOptions builder = new CreateTableOptions().setNumReplicas(3);
+    CreateTableOptions builder = getBasicCreateTableOptions();
     createTable(TABLE_NAME, basicSchema, builder);
 
     table = openTable(TABLE_NAME);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/java/kudu-client/src/test/java/org/kududb/client/TestMasterFailover.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/kududb/client/TestMasterFailover.java b/java/kudu-client/src/test/java/org/kududb/client/TestMasterFailover.java
index edbfdc7..2f91a6e 100644
--- a/java/kudu-client/src/test/java/org/kududb/client/TestMasterFailover.java
+++ b/java/kudu-client/src/test/java/org/kududb/client/TestMasterFailover.java
@@ -36,7 +36,7 @@ public class TestMasterFailover extends BaseKuduTest {
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
     BaseKuduTest.setUpBeforeClass();
-    createTable(TABLE_NAME, basicSchema, new CreateTableOptions());
+    createTable(TABLE_NAME, basicSchema, getBasicCreateTableOptions());
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/java/kudu-client/src/test/java/org/kududb/client/TestRowErrors.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/kududb/client/TestRowErrors.java b/java/kudu-client/src/test/java/org/kududb/client/TestRowErrors.java
index 39e977d..90d11aa 100644
--- a/java/kudu-client/src/test/java/org/kududb/client/TestRowErrors.java
+++ b/java/kudu-client/src/test/java/org/kududb/client/TestRowErrors.java
@@ -23,6 +23,8 @@ import java.util.List;
 
 import static org.junit.Assert.*;
 
+import com.google.common.collect.ImmutableList;
+
 public class TestRowErrors extends BaseKuduTest {
 
   private static KuduTable table;
@@ -33,11 +35,10 @@ public class TestRowErrors extends BaseKuduTest {
 
   }
 
-
   @Test(timeout = 100000)
   public void singleTabletTest() throws Exception {
     String tableName = TestRowErrors.class.getName() + "-" + System.currentTimeMillis();
-    createTable(tableName, basicSchema, new CreateTableOptions());
+    createTable(tableName, basicSchema, getBasicCreateTableOptions());
     table = openTable(tableName);
     AsyncKuduSession session = client.newSession();
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/java/kudu-client/src/test/java/org/kududb/client/TestRowResult.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/kududb/client/TestRowResult.java b/java/kudu-client/src/test/java/org/kududb/client/TestRowResult.java
index 5febcbd..1b302c1 100644
--- a/java/kudu-client/src/test/java/org/kududb/client/TestRowResult.java
+++ b/java/kudu-client/src/test/java/org/kududb/client/TestRowResult.java
@@ -37,8 +37,7 @@ public class TestRowResult extends BaseKuduTest {
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
     BaseKuduTest.setUpBeforeClass();
-    createTable(TABLE_NAME, allTypesSchema, new CreateTableOptions());
-
+    createTable(TABLE_NAME, allTypesSchema, getAllTypesCreateTableOptions());
     table = openTable(TABLE_NAME);
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/java/kudu-client/src/test/java/org/kududb/client/TestScanPredicate.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/kududb/client/TestScanPredicate.java b/java/kudu-client/src/test/java/org/kududb/client/TestScanPredicate.java
index 5501d5d..d67380b 100644
--- a/java/kudu-client/src/test/java/org/kududb/client/TestScanPredicate.java
+++ b/java/kudu-client/src/test/java/org/kududb/client/TestScanPredicate.java
@@ -39,6 +39,9 @@ public class TestScanPredicate extends BaseKuduTest {
     return new Schema(ImmutableList.of(key, val));
   }
 
+  private static CreateTableOptions createTableOptions() {
+    return new CreateTableOptions().setRangePartitionColumns(ImmutableList.of("key"));
+  }
 
   private int countRows(KuduTable table, KuduPredicate... predicates) throws Exception {
     KuduScanner.KuduScannerBuilder scanBuilder =  new KuduScanner.KuduScannerBuilder(client, table);
@@ -213,7 +216,7 @@ public class TestScanPredicate extends BaseKuduTest {
   @Test
   public void testBoolPredicates() throws Exception {
     Schema schema = createTableSchema(Type.BOOL);
-    syncClient.createTable("bool-table", schema);
+    syncClient.createTable("bool-table", schema, createTableOptions());
     KuduTable table = syncClient.openTable("bool-table");
 
     NavigableSet<Boolean> values = ImmutableSortedSet.of(false, true);
@@ -265,7 +268,7 @@ public class TestScanPredicate extends BaseKuduTest {
   @Test
   public void testBytePredicates() throws Exception {
     Schema schema = createTableSchema(Type.INT8);
-    syncClient.createTable("byte-table", schema);
+    syncClient.createTable("byte-table", schema, createTableOptions());
     KuduTable table = syncClient.openTable("byte-table");
 
     NavigableSet<Long> values = createIntegerValues(Type.INT8);
@@ -290,7 +293,9 @@ public class TestScanPredicate extends BaseKuduTest {
   @Test
   public void testShortPredicates() throws Exception {
     Schema schema = createTableSchema(Type.INT16);
-    syncClient.createTable("short-table", schema);
+    syncClient.createTable("short-table", schema,
+                           new CreateTableOptions().setRangePartitionColumns(
+                               ImmutableList.<String>of()));
     KuduTable table = syncClient.openTable("short-table");
 
     NavigableSet<Long> values = createIntegerValues(Type.INT16);
@@ -315,7 +320,7 @@ public class TestScanPredicate extends BaseKuduTest {
   @Test
   public void testIntPredicates() throws Exception {
     Schema schema = createTableSchema(Type.INT32);
-    syncClient.createTable("int-table", schema);
+    syncClient.createTable("int-table", schema, createTableOptions());
     KuduTable table = syncClient.openTable("int-table");
 
     NavigableSet<Long> values = createIntegerValues(Type.INT32);
@@ -340,7 +345,9 @@ public class TestScanPredicate extends BaseKuduTest {
   @Test
   public void testLongPredicates() throws Exception {
     Schema schema = createTableSchema(Type.INT64);
-    syncClient.createTable("long-table", schema);
+    syncClient.createTable("long-table", schema,
+                           new CreateTableOptions().setRangePartitionColumns(
+                               ImmutableList.<String>of()));
     KuduTable table = syncClient.openTable("long-table");
 
     NavigableSet<Long> values = createIntegerValues(Type.INT64);
@@ -365,7 +372,7 @@ public class TestScanPredicate extends BaseKuduTest {
   @Test
   public void testTimestampPredicate() throws Exception {
     Schema schema = createTableSchema(Type.INT64);
-    syncClient.createTable("timestamp-table", schema);
+    syncClient.createTable("timestamp-table", schema, createTableOptions());
     KuduTable table = syncClient.openTable("timestamp-table");
 
     NavigableSet<Long> values = createIntegerValues(Type.INT64);
@@ -390,7 +397,7 @@ public class TestScanPredicate extends BaseKuduTest {
   @Test
   public void testFloatPredicates() throws Exception {
     Schema schema = createTableSchema(Type.FLOAT);
-    syncClient.createTable("float-table", schema);
+    syncClient.createTable("float-table", schema, createTableOptions());
     KuduTable table = syncClient.openTable("float-table");
 
     NavigableSet<Float> values = createFloatValues();
@@ -443,7 +450,7 @@ public class TestScanPredicate extends BaseKuduTest {
   @Test
   public void testDoublePredicates() throws Exception {
     Schema schema = createTableSchema(Type.DOUBLE);
-    syncClient.createTable("double-table", schema);
+    syncClient.createTable("double-table", schema, createTableOptions());
     KuduTable table = syncClient.openTable("double-table");
 
     NavigableSet<Double> values = createDoubleValues();
@@ -496,7 +503,7 @@ public class TestScanPredicate extends BaseKuduTest {
   @Test
   public void testStringPredicates() throws Exception {
     Schema schema = createTableSchema(Type.STRING);
-    syncClient.createTable("string-table", schema);
+    syncClient.createTable("string-table", schema, createTableOptions());
     KuduTable table = syncClient.openTable("string-table");
 
     NavigableSet<String> values = createStringValues();
@@ -549,7 +556,7 @@ public class TestScanPredicate extends BaseKuduTest {
   @Test
   public void testBinaryPredicates() throws Exception {
     Schema schema = createTableSchema(Type.BINARY);
-    syncClient.createTable("binary-table", schema);
+    syncClient.createTable("binary-table", schema, createTableOptions());
     KuduTable table = syncClient.openTable("binary-table");
 
     NavigableSet<String> values = createStringValues();

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/java/kudu-client/src/test/java/org/kududb/client/TestScannerMultiTablet.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/kududb/client/TestScannerMultiTablet.java b/java/kudu-client/src/test/java/org/kududb/client/TestScannerMultiTablet.java
index d2b7d7e..251057f 100644
--- a/java/kudu-client/src/test/java/org/kududb/client/TestScannerMultiTablet.java
+++ b/java/kudu-client/src/test/java/org/kududb/client/TestScannerMultiTablet.java
@@ -16,6 +16,7 @@
 // under the License.
 package org.kududb.client;
 
+import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Lists;
 import com.stumbleupon.async.Deferred;
 import org.kududb.ColumnSchema;
@@ -41,7 +42,8 @@ public class TestScannerMultiTablet extends BaseKuduTest {
   public static void setUpBeforeClass() throws Exception {
     BaseKuduTest.setUpBeforeClass();
     // create a 4-tablets table for scanning
-    CreateTableOptions builder = new CreateTableOptions();
+    CreateTableOptions builder =
+        new CreateTableOptions().setRangePartitionColumns(ImmutableList.of("key1", "key2"));
 
     for (int i = 1; i < 4; i++){
       PartialRow splitRow = schema.newPartialRow();

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/java/kudu-client/src/test/java/org/kududb/client/TestStatistics.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/kududb/client/TestStatistics.java b/java/kudu-client/src/test/java/org/kududb/client/TestStatistics.java
index 63f2230..6cfbee7 100644
--- a/java/kudu-client/src/test/java/org/kududb/client/TestStatistics.java
+++ b/java/kudu-client/src/test/java/org/kududb/client/TestStatistics.java
@@ -31,7 +31,7 @@ public class TestStatistics extends BaseKuduTest {
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
     BaseKuduTest.setUpBeforeClass();
-    CreateTableOptions options = new CreateTableOptions().setNumReplicas(1);
+    CreateTableOptions options = getBasicCreateTableOptions().setNumReplicas(1);
     table = createTable(TABLE_NAME, basicSchema, options);
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/java/kudu-client/src/test/java/org/kududb/client/TestTimeouts.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/kududb/client/TestTimeouts.java b/java/kudu-client/src/test/java/org/kududb/client/TestTimeouts.java
index 57494c3..4393505 100644
--- a/java/kudu-client/src/test/java/org/kududb/client/TestTimeouts.java
+++ b/java/kudu-client/src/test/java/org/kududb/client/TestTimeouts.java
@@ -18,6 +18,7 @@ package org.kududb.client;
 
 import static org.junit.Assert.fail;
 
+import com.google.common.collect.ImmutableList;
 import com.stumbleupon.async.TimeoutException;
 import org.junit.Test;
 
@@ -44,7 +45,7 @@ public class TestTimeouts extends BaseKuduTest {
       // Expected.
     }
 
-    createTable(TABLE_NAME, basicSchema, new CreateTableOptions());
+    createTable(TABLE_NAME, basicSchema, getBasicCreateTableOptions());
     KuduTable table = openTable(TABLE_NAME);
 
     KuduSession lowTimeoutSession = lowTimeoutsClient.newSession();

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/java/kudu-flume-sink/src/test/java/org/kududb/flume/sink/KuduSinkTest.java
----------------------------------------------------------------------
diff --git a/java/kudu-flume-sink/src/test/java/org/kududb/flume/sink/KuduSinkTest.java b/java/kudu-flume-sink/src/test/java/org/kududb/flume/sink/KuduSinkTest.java
index a0910dd..d732b71 100644
--- a/java/kudu-flume-sink/src/test/java/org/kududb/flume/sink/KuduSinkTest.java
+++ b/java/kudu-flume-sink/src/test/java/org/kududb/flume/sink/KuduSinkTest.java
@@ -20,6 +20,8 @@ package org.kududb.flume.sink;
 
 import com.google.common.base.Charsets;
 import com.google.common.base.Throwables;
+import com.google.common.collect.ImmutableList;
+
 import org.apache.flume.Channel;
 import org.apache.flume.Context;
 import org.apache.flume.Event;
@@ -52,14 +54,15 @@ import static org.junit.Assert.fail;
 public class KuduSinkTest extends BaseKuduTest {
   private static final Logger LOG = LoggerFactory.getLogger(KuduSinkTest.class);
 
-  private KuduTable createNewTable(String tableName) {
+  private KuduTable createNewTable(String tableName) throws Exception {
     LOG.info("Creating new table...");
 
-    CreateTableOptions options = new CreateTableOptions().setNumReplicas(1);
     ArrayList<ColumnSchema> columns = new ArrayList<>(1);
     columns.add(new ColumnSchema.ColumnSchemaBuilder("payload", Type.BINARY).key(true).build());
-    basicSchema = new Schema(columns);
-    KuduTable table = createTable(tableName, basicSchema, options);
+    CreateTableOptions createOptions =
+        new CreateTableOptions().setRangePartitionColumns(ImmutableList.of("payload"))
+                                .setNumReplicas(1);
+    KuduTable table = createTable(tableName, new Schema(columns), createOptions);
 
     LOG.info("Created new table.");
 
@@ -131,7 +134,7 @@ public class KuduSinkTest extends BaseKuduTest {
     doTestDuplicateRows(false);
   }
 
-  private void doTestDuplicateRows(boolean ignoreDuplicateRows) {
+  private void doTestDuplicateRows(boolean ignoreDuplicateRows) throws Exception {
     KuduTable table = createNewTable("testDuplicateRows" + ignoreDuplicateRows);
     String tableName = table.getName();
     Context sinkContext = new Context();

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/java/kudu-mapreduce/src/test/java/org/kududb/mapreduce/ITKuduTableInputFormat.java
----------------------------------------------------------------------
diff --git a/java/kudu-mapreduce/src/test/java/org/kududb/mapreduce/ITKuduTableInputFormat.java b/java/kudu-mapreduce/src/test/java/org/kududb/mapreduce/ITKuduTableInputFormat.java
index f981250..ff4d81a 100644
--- a/java/kudu-mapreduce/src/test/java/org/kududb/mapreduce/ITKuduTableInputFormat.java
+++ b/java/kudu-mapreduce/src/test/java/org/kududb/mapreduce/ITKuduTableInputFormat.java
@@ -38,7 +38,7 @@ public class ITKuduTableInputFormat extends BaseKuduTest {
 
   @Test
   public void test() throws Exception {
-    createTable(TABLE_NAME, getBasicSchema(), new CreateTableOptions());
+    createTable(TABLE_NAME, getBasicSchema(), getBasicCreateTableOptions());
 
     KuduTable table = openTable(TABLE_NAME);
     Schema schema = getBasicSchema();

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/java/kudu-mapreduce/src/test/java/org/kududb/mapreduce/ITKuduTableOutputFormat.java
----------------------------------------------------------------------
diff --git a/java/kudu-mapreduce/src/test/java/org/kududb/mapreduce/ITKuduTableOutputFormat.java b/java/kudu-mapreduce/src/test/java/org/kududb/mapreduce/ITKuduTableOutputFormat.java
index 47381ca..86452ed 100644
--- a/java/kudu-mapreduce/src/test/java/org/kududb/mapreduce/ITKuduTableOutputFormat.java
+++ b/java/kudu-mapreduce/src/test/java/org/kududb/mapreduce/ITKuduTableOutputFormat.java
@@ -37,7 +37,7 @@ public class ITKuduTableOutputFormat extends BaseKuduTest {
 
   @Test
   public void test() throws Exception {
-    createTable(TABLE_NAME, getBasicSchema(), new CreateTableOptions());
+    createTable(TABLE_NAME, getBasicSchema(), getBasicCreateTableOptions());
 
     KuduTableOutputFormat output = new KuduTableOutputFormat();
     Configuration conf = new Configuration();

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/java/kudu-mapreduce/src/test/java/org/kududb/mapreduce/ITOutputFormatJob.java
----------------------------------------------------------------------
diff --git a/java/kudu-mapreduce/src/test/java/org/kududb/mapreduce/ITOutputFormatJob.java b/java/kudu-mapreduce/src/test/java/org/kududb/mapreduce/ITOutputFormatJob.java
index 0acc4c5..dff2400 100644
--- a/java/kudu-mapreduce/src/test/java/org/kududb/mapreduce/ITOutputFormatJob.java
+++ b/java/kudu-mapreduce/src/test/java/org/kududb/mapreduce/ITOutputFormatJob.java
@@ -45,7 +45,7 @@ public class ITOutputFormatJob extends BaseKuduTest {
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
     BaseKuduTest.setUpBeforeClass();
-    createTable(TABLE_NAME, getBasicSchema(), new CreateTableOptions());
+    createTable(TABLE_NAME, getBasicSchema(), getBasicCreateTableOptions());
   }
 
   @AfterClass

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/java/kudu-spark/src/test/scala/org/kududb/spark/kudu/DefaultSourceTest.scala
----------------------------------------------------------------------
diff --git a/java/kudu-spark/src/test/scala/org/kududb/spark/kudu/DefaultSourceTest.scala b/java/kudu-spark/src/test/scala/org/kududb/spark/kudu/DefaultSourceTest.scala
index 19295e9..ec929d7 100644
--- a/java/kudu-spark/src/test/scala/org/kududb/spark/kudu/DefaultSourceTest.scala
+++ b/java/kudu-spark/src/test/scala/org/kududb/spark/kudu/DefaultSourceTest.scala
@@ -21,13 +21,14 @@ import java.text.SimpleDateFormat
 import java.util.TimeZone
 
 import org.apache.spark.sql.SQLContext
+import org.apache.spark.sql.functions._
 import org.junit.Assert._
 import org.junit.runner.RunWith
 import org.kududb.client.CreateTableOptions
-import org.scalatest.{BeforeAndAfter, FunSuite}
 import org.scalatest.junit.JUnitRunner
-import org.apache.spark.sql.functions._
+import org.scalatest.{BeforeAndAfter, FunSuite}
 
+import scala.collection.JavaConverters._
 import scala.collection.immutable.IndexedSeq
 
 @RunWith(classOf[JUnitRunner])
@@ -67,8 +68,7 @@ class DefaultSourceTest extends FunSuite with TestContext with BeforeAndAfter {
       "kudu.table" -> tableName,
       "kudu.master" -> miniCluster.getMasterAddresses)
 
-    sqlContext.read.options(kuduOptions).kudu
-      .registerTempTable(tableName)
+    sqlContext.read.options(kuduOptions).kudu.registerTempTable(tableName)
   }
 
   test("table creation") {
@@ -78,7 +78,9 @@ class DefaultSourceTest extends FunSuite with TestContext with BeforeAndAfter {
 
     val df = sqlContext.read.options(kuduOptions).kudu
 
-    kuduContext.createTable("testcreatetable", df.schema, Seq("key"), new CreateTableOptions().setNumReplicas(1))
+    kuduContext.createTable("testcreatetable", df.schema, Seq("key"),
+                            new CreateTableOptions().setRangePartitionColumns(List("key").asJava)
+                                                    .setNumReplicas(1))
 
     // now use new options to refer to the new table name
     val newOptions: Map[String, String] = Map(

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/java/kudu-spark/src/test/scala/org/kududb/spark/kudu/TestContext.scala
----------------------------------------------------------------------
diff --git a/java/kudu-spark/src/test/scala/org/kududb/spark/kudu/TestContext.scala b/java/kudu-spark/src/test/scala/org/kududb/spark/kudu/TestContext.scala
index 1613251..1664401 100644
--- a/java/kudu-spark/src/test/scala/org/kududb/spark/kudu/TestContext.scala
+++ b/java/kudu-spark/src/test/scala/org/kududb/spark/kudu/TestContext.scala
@@ -27,6 +27,7 @@ import org.kududb.client.{CreateTableOptions, KuduClient, KuduTable, MiniKuduClu
 import org.kududb.{Schema, Type}
 import org.scalatest.{BeforeAndAfterAll, Suite}
 
+import scala.collection.JavaConverters._
 import scala.collection.immutable.IndexedSeq
 
 trait TestContext extends BeforeAndAfterAll { self: Suite =>
@@ -74,7 +75,8 @@ trait TestContext extends BeforeAndAfterAll { self: Suite =>
 
     kuduContext = new KuduContext(miniCluster.getMasterAddresses)
 
-    val tableOptions = new CreateTableOptions().setNumReplicas(1)
+    val tableOptions = new CreateTableOptions().setRangePartitionColumns(List("key").asJava)
+                                               .setNumReplicas(1)
     table = kuduClient.createTable(tableName, schema, tableOptions)
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/python/kudu/client.pyx
----------------------------------------------------------------------
diff --git a/python/kudu/client.pyx b/python/kudu/client.pyx
index 036ecda..de816c4 100644
--- a/python/kudu/client.pyx
+++ b/python/kudu/client.pyx
@@ -226,7 +226,7 @@ cdef class Client:
         # Nothing yet to clean up here
         pass
 
-    def create_table(self, table_name, Schema schema, partitioning=None):
+    def create_table(self, table_name, Schema schema, partitioning):
         """
         Creates a new Kudu table from the passed Schema and options.
 
@@ -244,8 +244,7 @@ cdef class Client:
         try:
             c.table_name(tobytes(table_name))
             c.schema(schema.schema)
-            if partitioning is not None:
-                self._apply_partitioning(c, partitioning)
+            self._apply_partitioning(c, partitioning)
             s = c.Create()
             check_status(s)
         finally:

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/python/kudu/tests/common.py
----------------------------------------------------------------------
diff --git a/python/kudu/tests/common.py b/python/kudu/tests/common.py
index ba01260..2ab48e2 100644
--- a/python/kudu/tests/common.py
+++ b/python/kudu/tests/common.py
@@ -27,7 +27,7 @@ import tempfile
 import time
 
 import kudu
-
+from kudu.client import Partitioning
 
 class KuduTestBase(object):
 
@@ -132,11 +132,12 @@ class KuduTestBase(object):
         cls.client = kudu.connect(cls.master_host, cls.master_port)
 
         cls.schema = cls.example_schema()
+        cls.partitioning = cls.example_partitioning()
 
         cls.ex_table = 'example-table'
         if cls.client.table_exists(cls.ex_table):
             cls.client.delete_table(cls.ex_table)
-        cls.client.create_table(cls.ex_table, cls.schema)
+        cls.client.create_table(cls.ex_table, cls.schema, cls.partitioning)
 
     @classmethod
     def tearDownClass(cls):
@@ -151,3 +152,7 @@ class KuduTestBase(object):
         builder.set_primary_keys(['key'])
 
         return builder.build()
+
+    @classmethod
+    def example_partitioning(cls):
+        return Partitioning().set_range_partition_columns(['key'])

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/python/kudu/tests/test_client.py
----------------------------------------------------------------------
diff --git a/python/kudu/tests/test_client.py b/python/kudu/tests/test_client.py
index 8174421..ddc973e 100644
--- a/python/kudu/tests/test_client.py
+++ b/python/kudu/tests/test_client.py
@@ -61,10 +61,11 @@ class TestClient(KuduTestBase, unittest.TestCase):
 
     def test_list_tables(self):
         schema = self.example_schema()
+        partitioning = self.example_partitioning()
 
         to_create = ['foo1', 'foo2', 'foo3']
         for name in to_create:
-            self.client.create_table(name, schema)
+            self.client.create_table(name, schema, partitioning)
 
         result = self.client.list_tables()
         expected = [self.ex_table] + to_create
@@ -81,7 +82,7 @@ class TestClient(KuduTestBase, unittest.TestCase):
 
     def test_delete_table(self):
         name = "peekaboo"
-        self.client.create_table(name, self.schema)
+        self.client.create_table(name, self.schema, self.partitioning)
         self.client.delete_table(name)
         assert not self.client.table_exists(name)
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/src/kudu/benchmarks/tpch/rpc_line_item_dao.cc
----------------------------------------------------------------------
diff --git a/src/kudu/benchmarks/tpch/rpc_line_item_dao.cc b/src/kudu/benchmarks/tpch/rpc_line_item_dao.cc
index 12d1c3f..71818aa 100644
--- a/src/kudu/benchmarks/tpch/rpc_line_item_dao.cc
+++ b/src/kudu/benchmarks/tpch/rpc_line_item_dao.cc
@@ -111,6 +111,7 @@ void RpcLineItemDAO::Init() {
     CHECK_OK(table_creator->table_name(table_name_)
              .schema(&schema)
              .num_replicas(1)
+             .set_range_partition_columns({ tpch::kOrderKeyColName, tpch::kLineNumberColName })
              .split_rows(tablet_splits_)
              .Create());
     CHECK_OK(client_->OpenTable(table_name_, &client_table_));

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/src/kudu/client/client-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/client-test.cc b/src/kudu/client/client-test.cc
index 8d455e5..b0725ed 100644
--- a/src/kudu/client/client-test.cc
+++ b/src/kudu/client/client-test.cc
@@ -399,6 +399,7 @@ class ClientTest : public KuduTest {
     ASSERT_OK(table_creator->table_name(table_name)
                             .schema(&schema_)
                             .num_replicas(num_replicas)
+                            .set_range_partition_columns({ "key" })
                             .split_rows(split_rows)
                             .Create());
 
@@ -2706,6 +2707,7 @@ TEST_F(ClientTest, TestDeadlockSimulation) {
 TEST_F(ClientTest, TestCreateDuplicateTable) {
   gscoped_ptr<KuduTableCreator> table_creator(client_->NewTableCreator());
   ASSERT_TRUE(table_creator->table_name(kTableName)
+              .set_range_partition_columns({ "key" })
               .schema(&schema_)
               .num_replicas(1)
               .Create().IsAlreadyPresent());
@@ -2723,6 +2725,7 @@ TEST_F(ClientTest, TestCreateTableWithTooManyTablets) {
   gscoped_ptr<KuduTableCreator> table_creator(client_->NewTableCreator());
   Status s = table_creator->table_name("foobar")
       .schema(&schema_)
+      .set_range_partition_columns({ "key" })
       .split_rows({ split1, split2 })
       .num_replicas(3)
       .Create();
@@ -2741,6 +2744,7 @@ TEST_F(ClientTest, TestCreateTableWithTooManyReplicas) {
   gscoped_ptr<KuduTableCreator> table_creator(client_->NewTableCreator());
   Status s = table_creator->table_name("foobar")
       .schema(&schema_)
+      .set_range_partition_columns({ "key" })
       .split_rows({ split1, split2 })
       .num_replicas(3)
       .Create();
@@ -2881,5 +2885,13 @@ TEST_F(ClientTest, TestLastErrorEmbeddedInScanTimeoutStatus) {
   }
 }
 
+TEST_F(ClientTest, TestNoDefaultPartitioning) {
+    gscoped_ptr<KuduTableCreator> table_creator(client_->NewTableCreator());
+    Status s = table_creator->table_name("TestNoDefaultPartitioning").schema(&schema_).Create();
+
+    ASSERT_TRUE(s.IsInvalidArgument());
+    ASSERT_STR_CONTAINS(s.ToString(), "Table partitioning must be specified");
+}
+
 } // namespace client
 } // namespace kudu

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/src/kudu/client/client.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/client.cc b/src/kudu/client/client.cc
index 7a16004..91af4e2 100644
--- a/src/kudu/client/client.cc
+++ b/src/kudu/client/client.cc
@@ -490,6 +490,12 @@ Status KuduTableCreator::Create() {
   if (!data_->schema_) {
     return Status::InvalidArgument("Missing schema");
   }
+  if (!data_->partition_schema_.has_range_schema() &&
+      data_->partition_schema_.hash_bucket_schemas().empty()) {
+    return Status::InvalidArgument(
+        "Table partitioning must be specified using "
+        "add_hash_partitions or set_range_partition_columns");
+  }
 
   // Build request.
   CreateTableRequestPB req;

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/src/kudu/client/client.h
----------------------------------------------------------------------
diff --git a/src/kudu/client/client.h b/src/kudu/client/client.h
index 371d3cb..29e25ab 100644
--- a/src/kudu/client/client.h
+++ b/src/kudu/client/client.h
@@ -323,6 +323,9 @@ class KUDU_EXPORT KuduTableCreator {
   // table is created with 3 split rows, and two hash partitions with 4 and 5
   // buckets respectively, the total number of table partitions will be 80
   // (4 range partitions * 4 hash buckets * 5 hash buckets).
+  //
+  // Tables must be created with either range, hash, or range and hash
+  // partitioning.
   KuduTableCreator& add_hash_partitions(const std::vector<std::string>& columns,
                                         int32_t num_buckets);
 
@@ -337,12 +340,14 @@ class KUDU_EXPORT KuduTableCreator {
 
   // Sets the columns on which the table will be range-partitioned.
   //
-  // Every column must be a part of the table's primary key. If not set, the
-  // table will be created with the primary-key columns as the range-partition
-  // columns. If called with an empty vector, the table will be created without
-  // range partitioning.
+  // Every column must be a part of the table's primary key. If not set, or if
+  // called with an empty vector, the table will be created without range
+  // partitioning.
   //
-  // Optional.
+  // Tables must be created with either range, hash, or range and hash
+  // partitioning. To force the use of a single tablet (not recommended), call
+  // this method with an empty vector and set no split rows an no hash
+  // partitions.
   KuduTableCreator& set_range_partition_columns(const std::vector<std::string>& columns);
 
   // Sets the rows on which to pre-split the table.

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/src/kudu/client/predicate-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/predicate-test.cc b/src/kudu/client/predicate-test.cc
index 7bc4069..0d175d9 100644
--- a/src/kudu/client/predicate-test.cc
+++ b/src/kudu/client/predicate-test.cc
@@ -74,6 +74,7 @@ class PredicateTest : public KuduTest {
     unique_ptr<client::KuduTableCreator> table_creator(client_->NewTableCreator());
     CHECK_OK(table_creator->table_name("table")
         .schema(&schema)
+        .set_range_partition_columns({ "key" })
         .num_replicas(1)
         .Create());
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/src/kudu/client/samples/sample.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/samples/sample.cc b/src/kudu/client/samples/sample.cc
index 73ef2b3..4367822 100644
--- a/src/kudu/client/samples/sample.cc
+++ b/src/kudu/client/samples/sample.cc
@@ -98,10 +98,14 @@ static Status CreateTable(const shared_ptr<KuduClient>& client,
     splits.push_back(row);
   }
 
+  vector<string> column_names;
+  column_names.push_back("key");
+
   // Create the table.
   KuduTableCreator* table_creator = client->NewTableCreator();
   Status s = table_creator->table_name(table_name)
       .schema(&schema)
+      .set_range_partition_columns(column_names)
       .split_rows(splits)
       .Create();
   delete table_creator;

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/src/kudu/integration-tests/all_types-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/all_types-itest.cc b/src/kudu/integration-tests/all_types-itest.cc
index a304c47..ab353c3 100644
--- a/src/kudu/integration-tests/all_types-itest.cc
+++ b/src/kudu/integration-tests/all_types-itest.cc
@@ -242,6 +242,7 @@ class AllTypesItest : public KuduTest {
 
     RETURN_NOT_OK(table_creator->table_name("all-types-table")
                   .schema(&schema_)
+                  .set_range_partition_columns({ "key" })
                   .split_rows(split_rows)
                   .num_replicas(kNumTabletServers)
                   .Create());

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/src/kudu/integration-tests/alter_table-randomized-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/alter_table-randomized-test.cc b/src/kudu/integration-tests/alter_table-randomized-test.cc
index cbf1bfd..b5d629a 100644
--- a/src/kudu/integration-tests/alter_table-randomized-test.cc
+++ b/src/kudu/integration-tests/alter_table-randomized-test.cc
@@ -234,6 +234,7 @@ struct MirrorTable {
     gscoped_ptr<KuduTableCreator> table_creator(client_->NewTableCreator());
     RETURN_NOT_OK(table_creator->table_name(kTableName)
              .schema(&schema)
+             .set_range_partition_columns({ "key" })
              .num_replicas(3)
              .Create());
     return Status::OK();

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/src/kudu/integration-tests/alter_table-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/alter_table-test.cc b/src/kudu/integration-tests/alter_table-test.cc
index 60aa86d..485f784 100644
--- a/src/kudu/integration-tests/alter_table-test.cc
+++ b/src/kudu/integration-tests/alter_table-test.cc
@@ -119,6 +119,7 @@ class AlterTableTest : public KuduTest {
     gscoped_ptr<KuduTableCreator> table_creator(client_->NewTableCreator());
     CHECK_OK(table_creator->table_name(kTableName)
              .schema(&schema_)
+             .set_range_partition_columns({ "c0" })
              .num_replicas(num_replicas())
              .Create());
 
@@ -226,6 +227,7 @@ class AlterTableTest : public KuduTest {
     gscoped_ptr<KuduTableCreator> table_creator(client_->NewTableCreator());
     return table_creator->table_name(table_name)
         .schema(&schema_)
+        .set_range_partition_columns({ "c0" })
         .num_replicas(num_replicas())
         .split_rows(split_rows)
         .Create();

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/src/kudu/integration-tests/create-table-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/create-table-itest.cc b/src/kudu/integration-tests/create-table-itest.cc
index 32e6090..73a67cd 100644
--- a/src/kudu/integration-tests/create-table-itest.cc
+++ b/src/kudu/integration-tests/create-table-itest.cc
@@ -66,6 +66,7 @@ TEST_F(CreateTableITest, TestCreateWhenMajorityOfReplicasFailCreation) {
   client::KuduSchema client_schema(client::KuduSchemaFromSchema(GetSimpleTestSchema()));
   ASSERT_OK(table_creator->table_name(kTableName)
             .schema(&client_schema)
+            .set_range_partition_columns({ "key" })
             .num_replicas(3)
             .wait(false)
             .Create());
@@ -132,6 +133,7 @@ TEST_F(CreateTableITest, TestSpreadReplicasEvenly) {
   client::KuduSchema client_schema(client::KuduSchemaFromSchema(GetSimpleTestSchema()));
   ASSERT_OK(table_creator->table_name(kTableName)
             .schema(&client_schema)
+            .set_range_partition_columns({ "key" })
             .num_replicas(3)
             .add_hash_partitions({ "key" }, kNumTablets)
             .Create());
@@ -266,6 +268,7 @@ TEST_F(CreateTableITest, TestCreateTableWithDeadTServers) {
   // because all of the tservers are dead.
   CHECK_OK(table_creator->table_name(kTableName)
            .schema(&client_schema)
+           .set_range_partition_columns({ "key" })
            .wait(false)
            .Create());
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/src/kudu/integration-tests/create-table-stress-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/create-table-stress-test.cc b/src/kudu/integration-tests/create-table-stress-test.cc
index 622aa0c..5db9fa8 100644
--- a/src/kudu/integration-tests/create-table-stress-test.cc
+++ b/src/kudu/integration-tests/create-table-stress-test.cc
@@ -132,6 +132,7 @@ void CreateTableStressTest::CreateBigTable(const string& table_name, int num_tab
   gscoped_ptr<KuduTableCreator> table_creator(client_->NewTableCreator());
   ASSERT_OK(table_creator->table_name(table_name)
             .schema(&schema_)
+            .set_range_partition_columns({ "key" })
             .split_rows(split_rows)
             .num_replicas(3)
             .wait(false)

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/src/kudu/integration-tests/delete_table-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/delete_table-test.cc b/src/kudu/integration-tests/delete_table-test.cc
index 413ac5a..a4dace5 100644
--- a/src/kudu/integration-tests/delete_table-test.cc
+++ b/src/kudu/integration-tests/delete_table-test.cc
@@ -952,6 +952,7 @@ TEST_P(DeleteTableTombstonedParamTest, TestTabletTombstone) {
   ASSERT_OK(table_creator->table_name(TestWorkload::kDefaultTableName)
                           .split_rows(split_rows)
                           .schema(&client_schema)
+                          .set_range_partition_columns({ "key" })
                           .num_replicas(3)
                           .Create());
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/src/kudu/integration-tests/full_stack-insert-scan-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/full_stack-insert-scan-test.cc b/src/kudu/integration-tests/full_stack-insert-scan-test.cc
index 09fc2e8..78f2f9d 100644
--- a/src/kudu/integration-tests/full_stack-insert-scan-test.cc
+++ b/src/kudu/integration-tests/full_stack-insert-scan-test.cc
@@ -134,6 +134,7 @@ class FullStackInsertScanTest : public KuduTest {
     gscoped_ptr<KuduTableCreator> table_creator(client_->NewTableCreator());
     ASSERT_OK(table_creator->table_name(kTableName)
              .schema(&schema_)
+             .set_range_partition_columns({ "key" })
              .num_replicas(1)
              .Create());
     ASSERT_OK(client_->OpenTable(kTableName, &reader_table_));

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/src/kudu/integration-tests/fuzz-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/fuzz-itest.cc b/src/kudu/integration-tests/fuzz-itest.cc
index faaad02..5629e14 100644
--- a/src/kudu/integration-tests/fuzz-itest.cc
+++ b/src/kudu/integration-tests/fuzz-itest.cc
@@ -149,6 +149,7 @@ class FuzzTest : public KuduTest {
     gscoped_ptr<KuduTableCreator> table_creator(client_->NewTableCreator());
     CHECK_OK(table_creator->table_name(kTableName)
              .schema(&schema_)
+             .set_range_partition_columns({ "key" })
              .num_replicas(1)
              .Create());
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/src/kudu/integration-tests/linked_list-test-util.h
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/linked_list-test-util.h b/src/kudu/integration-tests/linked_list-test-util.h
index 372a0bf..72349f2 100644
--- a/src/kudu/integration-tests/linked_list-test-util.h
+++ b/src/kudu/integration-tests/linked_list-test-util.h
@@ -419,6 +419,7 @@ Status LinkedListTester::CreateLinkedListTable() {
   gscoped_ptr<client::KuduTableCreator> table_creator(client_->NewTableCreator());
   RETURN_NOT_OK_PREPEND(table_creator->table_name(table_name_)
                         .schema(&schema_)
+                        .set_range_partition_columns({ kKeyColumnName })
                         .split_rows(GenerateSplitRows(schema_))
                         .num_replicas(num_replicas_)
                         .Create(),

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/src/kudu/integration-tests/master_failover-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/master_failover-itest.cc b/src/kudu/integration-tests/master_failover-itest.cc
index 6ed2f42..4d6a7c1 100644
--- a/src/kudu/integration-tests/master_failover-itest.cc
+++ b/src/kudu/integration-tests/master_failover-itest.cc
@@ -108,6 +108,7 @@ class MasterFailoverTest : public KuduTest {
     gscoped_ptr<KuduTableCreator> table_creator(client_->NewTableCreator());
     return table_creator->table_name(table_name)
         .schema(&schema)
+        .set_range_partition_columns({ "key" })
         .wait(mode == kWaitForCreate)
         .Create();
   }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/src/kudu/integration-tests/master_replication-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/master_replication-itest.cc b/src/kudu/integration-tests/master_replication-itest.cc
index 19b4d8c..6c5c429 100644
--- a/src/kudu/integration-tests/master_replication-itest.cc
+++ b/src/kudu/integration-tests/master_replication-itest.cc
@@ -119,6 +119,7 @@ class MasterReplicationTest : public KuduTest {
     CHECK_OK(b.Build(&schema));
     gscoped_ptr<KuduTableCreator> table_creator(client->NewTableCreator());
     return table_creator->table_name(table_name)
+        .set_range_partition_columns({ "key" })
         .schema(&schema)
         .Create();
   }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/src/kudu/integration-tests/remote_bootstrap-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/remote_bootstrap-itest.cc b/src/kudu/integration-tests/remote_bootstrap-itest.cc
index e0c2b06..e9bf883 100644
--- a/src/kudu/integration-tests/remote_bootstrap-itest.cc
+++ b/src/kudu/integration-tests/remote_bootstrap-itest.cc
@@ -423,6 +423,7 @@ TEST_F(RemoteBootstrapITest, TestConcurrentRemoteBootstraps) {
   ASSERT_OK(table_creator->table_name(TestWorkload::kDefaultTableName)
                           .split_rows(splits)
                           .schema(&client_schema)
+                          .set_range_partition_columns({ "key" })
                           .num_replicas(3)
                           .Create());
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/src/kudu/integration-tests/test_workload.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/test_workload.cc b/src/kudu/integration-tests/test_workload.cc
index aa0588c..44c2039 100644
--- a/src/kudu/integration-tests/test_workload.cc
+++ b/src/kudu/integration-tests/test_workload.cc
@@ -192,6 +192,7 @@ void TestWorkload::Setup() {
     CHECK_OK(table_creator->table_name(table_name_)
              .schema(&client_schema)
              .num_replicas(num_replicas_)
+             .set_range_partition_columns({ "key" })
              .split_rows(splits)
              // NOTE: this is quite high as a timeout, but the default (5 sec) does not
              // seem to be high enough in some cases (see KUDU-550). We should remove

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/src/kudu/integration-tests/ts_itest-base.h
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/ts_itest-base.h b/src/kudu/integration-tests/ts_itest-base.h
index ff99c57..453857a 100644
--- a/src/kudu/integration-tests/ts_itest-base.h
+++ b/src/kudu/integration-tests/ts_itest-base.h
@@ -414,6 +414,7 @@ class TabletServerIntegrationTestBase : public TabletServerTestBase {
     gscoped_ptr<client::KuduTableCreator> table_creator(client_->NewTableCreator());
     ASSERT_OK(table_creator->table_name(kTableId)
              .schema(&client_schema)
+             .set_range_partition_columns({ "key" })
              .num_replicas(FLAGS_num_replicas)
              // NOTE: this is quite high as a timeout, but the default (5 sec) does not
              // seem to be high enough in some cases (see KUDU-550). We should remove

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/src/kudu/integration-tests/ts_tablet_manager-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/ts_tablet_manager-itest.cc b/src/kudu/integration-tests/ts_tablet_manager-itest.cc
index d8499ed..2a2547e 100644
--- a/src/kudu/integration-tests/ts_tablet_manager-itest.cc
+++ b/src/kudu/integration-tests/ts_tablet_manager-itest.cc
@@ -120,6 +120,7 @@ TEST_F(TsTabletManagerITest, TestReportNewLeaderOnLeaderChange) {
   gscoped_ptr<KuduTableCreator> table_creator(client_->NewTableCreator());
   ASSERT_OK(table_creator->table_name(kTableName)
             .schema(&schema_)
+            .set_range_partition_columns({ "key" })
             .num_replicas(kNumReplicas)
             .Create());
   ASSERT_OK(client_->OpenTable(kTableName, &table));

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/src/kudu/integration-tests/update_scan_delta_compact-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/update_scan_delta_compact-test.cc b/src/kudu/integration-tests/update_scan_delta_compact-test.cc
index a9aa81a..95bdfc9 100644
--- a/src/kudu/integration-tests/update_scan_delta_compact-test.cc
+++ b/src/kudu/integration-tests/update_scan_delta_compact-test.cc
@@ -85,6 +85,7 @@ class UpdateScanDeltaCompactionTest : public KuduTest {
     gscoped_ptr<KuduTableCreator> table_creator(client_->NewTableCreator());
     ASSERT_OK(table_creator->table_name(kTableName)
              .schema(&schema_)
+             .set_range_partition_columns({ "key" })
              .num_replicas(1)
              .Create());
     ASSERT_OK(client_->OpenTable(kTableName, &table_));

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/src/kudu/integration-tests/write_throttling-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/write_throttling-itest.cc b/src/kudu/integration-tests/write_throttling-itest.cc
index e84ab5f..cd8ee78 100644
--- a/src/kudu/integration-tests/write_throttling-itest.cc
+++ b/src/kudu/integration-tests/write_throttling-itest.cc
@@ -56,6 +56,7 @@ class WriteThrottlingTest : public ExternalMiniClusterITestBase {
     gscoped_ptr<KuduTableCreator> table_creator(client_->NewTableCreator());
     ASSERT_OK(table_creator->table_name(kTableName)
              .schema(&schema_)
+             .set_range_partition_columns({ "key" })
              .num_replicas(1)
              .Create());
     ASSERT_OK(client_->OpenTable(kTableName, &table_));

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e7c257f/src/kudu/tools/ksck_remote-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/ksck_remote-test.cc b/src/kudu/tools/ksck_remote-test.cc
index 579f571..7305005 100644
--- a/src/kudu/tools/ksck_remote-test.cc
+++ b/src/kudu/tools/ksck_remote-test.cc
@@ -79,6 +79,7 @@ class RemoteKsckTest : public KuduTest {
     ASSERT_OK(table_creator->table_name(kTableName)
                      .schema(&schema_)
                      .num_replicas(3)
+                     .set_range_partition_columns({ "key" })
                      .split_rows(GenerateSplitRows())
                      .Create());
     // Make sure we can open the table.


Mime
View raw message