Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/9363 )
Change subject: KUDU-721: Support range partitions on decimal columns ...................................................................... Patch Set 3: (2 comments) http://gerrit.cloudera.org:8080/#/c/9363/3/python/kudu/client.pyx File python/kudu/client.pyx: http://gerrit.cloudera.org:8080/#/c/9363/3/python/kudu/client.pyx@1437 PS3, Line 1437: `` Is this intended or just a part from some other patch? http://gerrit.cloudera.org:8080/#/c/9363/2/src/kudu/client/client-test.cc File src/kudu/client/client-test.cc: http://gerrit.cloudera.org:8080/#/c/9363/2/src/kudu/client/client-test.cc@1662 PS2, Line 1662: TEST_F(ClientTest, TestSwappedRangeBounds) { : KuduSchemaBuilder builder; : KuduSchema schema; : builder.AddColumn("key")->Type(KuduColumnSchema::INT32)->NotNull()->PrimaryKey(); : builder.AddColumn("value")->Type(KuduColumnSchema::INT32)->NotNull(); : ASSERT_OK(builder.Build(&schema)); : : unique_ptr<KuduPartialRow> lower_bound(schema.NewRow()); : ASSERT_OK(lower_bound->SetInt32("key", 90)); : unique_ptr<KuduPartialRow> upper_bound(schema.NewRow()); : ASSERT_OK(upper_bound->SetInt32("key", -1)); : : unique_ptr<KuduTableCreator> table_creator(client_->NewTableCreator()); : table_creator->add_range_partition(lower_bound.release(), upper_bound.release(), : KuduTableCreator::EXCLUSIVE_BOUND, : KuduTableCreator::INCLUSIVE_BOUND); : : Status s = table_creator->table_name("TestSwappedRangeBounds") : .schema(&schema) : .num_replicas(1) : .set_range_partition_columns({ "key" }) : .Create(); : : ASSERT_TRUE(s.IsInvalidArgument()); : ASSERT_STR_CONTAINS(s.ToString(), : "Error creating table TestSwappedRangeBounds on the master: " : "range partition lower bound must be less than the upper bound"); : } : : : TEST_F(ClientTest, TestEqualRangeBounds) { : KuduSchemaBuilder builder; : KuduSchema schema; : builder.AddColumn("key")->Type(KuduColumnSchema::INT32)->NotNull()->PrimaryKey(); : builder.AddColumn("value")->Type(KuduColumnSchema::INT32)->NotNull(); : ASSERT_OK(builder.Build(&schema)); : : unique_ptr<KuduPartialRow> lower_bound(schema.NewRow()); : ASSERT_OK(lower_bound->SetInt32("key", 10)); : unique_ptr<KuduPartialRow> upper_bound(schema.NewRow()); : ASSERT_OK(upper_bound->SetInt32("key", 10)); : : unique_ptr<KuduTableCreator> table_creator(client_->NewTableCreator()); : table_creator->add_range_partition(lower_bound.release(), upper_bound.release(), : KuduTableCreator::EXCLUSIVE_BOUND, : KuduTableCreator::INCLUSIVE_BOUND); : : Status s = table_creator->table_name("TestEqualRangeBounds") : .schema(&schema) : .num_replicas(1) : .set_range_partition_columns({ "key" }) : .Create(); : : ASSERT_TRUE(s.IsInvalidArgument()); : ASSERT_STR_CONTAINS(s.ToString(), : "Error creating table TestEqualRangeBounds on the master: " : "range partition lower bound must be less than the upper bound"); : } : : TEST_F(ClientTest, TestMinMaxRangeBounds) { : KuduSchemaBuilder builder; : KuduSchema schema; : builder.AddColumn("key")->Type(KuduColumnSchema::INT32)->NotNull()->PrimaryKey(); : builder.AddColumn("value")->Type(KuduColumnSchema::INT32)->NotNull(); : ASSERT_OK(builder.Build(&schema)); : : unique_ptr<KuduPartialRow> lower_bound(schema.NewRow()); : ASSERT_OK(lower_bound->SetInt32("key", INT32_MIN)); : unique_ptr<KuduPartialRow> upper_bound(schema.NewRow()); : ASSERT_OK(upper_bound->SetInt32("key", INT32_MAX)); : : unique_ptr<KuduTableCreator> table_creator(client_->NewTableCreator()); : table_creator->add_range_partition(lower_bound.release(), upper_bound.release(), : KuduTableCreator::EXCLUSIVE_BOUND, : KuduTableCreator::INCLUSIVE_BOUND); : : ASSERT_OK(table_creator->table_name("TestMinMaxRangeBounds") : .schema(&schema) : .num_replicas(1) : .set_range_partition_columns({ "key" }) : .Create()); : } > Yeah, this is essentially generic logic. I think a future improvement could SGTM -- To view, visit http://gerrit.cloudera.org:8080/9363 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I419d442dd233c73166c6e391907c8443ebecc917 Gerrit-Change-Number: 9363 Gerrit-PatchSet: 3 Gerrit-Owner: Grant Henke <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Dan Burkert <[email protected]> Gerrit-Reviewer: Grant Henke <[email protected]> Gerrit-Reviewer: Kudu Jenkins Gerrit-Comment-Date: Wed, 21 Feb 2018 18:58:28 +0000 Gerrit-HasComments: Yes
