Mike Feng created KUDU-2428:
-------------------------------
Summary: Segmentation fault when calling add_range_partition
multiple times
Key: KUDU-2428
URL: https://issues.apache.org/jira/browse/KUDU-2428
Project: Kudu
Issue Type: Bug
Components: client
Affects Versions: 1.7.0
Reporter: Mike Feng
Fix For: Backlog
Hi,
I'm trying to modify and run the following sample.cc program to create a table
with multiple range partitions via multiple calls to add_range_partition() and
the program got a Segmentation fault.
On the other hand, if I call add_range_partition() once and the program runs
fine.
So I'm wondering if calling add_range_partition() multiple times for a single
table is supported or not? This makes it useful when trying to partition the
range on multiple primary key columns, e.g. on (key, int_val).
Thanks.
Modified only the following function in
$HOME/kudu/src/kudu/client/samples/sample.cc
static Status CreateTable(const shared_ptr<KuduClient>& client,
const string& table_name,
const KuduSchema& schema,
int num_tablets) {
KuduPartialRow* row = schema.NewRow();
KUDU_CHECK_OK(row->SetInt32("key", 100));
KuduPartialRow* row2 = schema.NewRow();
KUDU_CHECK_OK(row2->SetInt32("key", 100));
KuduPartialRow* row3 = schema.NewRow();
KUDU_CHECK_OK(row3->SetInt32("key", 200));
KuduPartialRow* row4 = schema.NewRow();
KUDU_CHECK_OK(row4->SetInt32("key", 200));
vector<string> column_names;
column_names.push_back("key");
// Create the table.
KuduTableCreator* table_creator = client->NewTableCreator();
table_creator->add_range_partition(row, row2);
table_creator->add_range_partition(row2, row3);
table_creator->add_range_partition(row3, row4);
Status s = table_creator->table_name(table_name)
.schema(&schema)
.set_range_partition_columns(column_names)
.set_engine_name(DEFAULT_ENGINE_NAME)
.num_replicas(1)
.Create();
delete table_creator;
return s;
}
Running it fails as follows:
$ ./sample 127.0.0.1
Segmentation fault (core dumped)
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)