Wang Xixu has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/21634


Change subject: [Tool] CLI table copy creats a table with no range partition
......................................................................

[Tool] CLI table copy creats a table with no range partition

Currently, using CLI 'table copy' to create a destination table
when the source table without any range partition, it creates
a table with an unbouned range partition. That make the source
table schema is different with the destination table's. That
also causes the tablet schema different in the same partition.
The following is an example:
The source table schema:
TABLE test1 (
    key INT32 NOT NULL,
    int_val INT32 NOT NULL,
    string_val STRING NULLABLE,
    PRIMARY KEY (key)
)
OWNER root
REPLICAS 1
COMMENT

CLI command:
'kudu table copy $ma test1 $ma --create_table=true'

The destination table schema:
TABLE test1 (
    key INT32 NOT NULL,
    int_val INT32 NOT NULL,
    string_val STRING NULLABLE,
    PRIMARY KEY (key)
)
RANGE (key) (
    PARTITION UNBOUNDED
)
OWNER root
REPLICAS 1
COMMENT

In semantics, it is right. But is better to keep the source table
schema the same with the destination schema. In our company, there
is a tool that copy a table to another cluster in file copying
method, which is more quick than CLI 'kudu table copy' in row
copying method. It needs to keep the table schema the same.

Change-Id: I94f99f845393ff2460761cc7bd82ecb3f3ead79b
---
M src/kudu/tools/kudu-tool-test.cc
M src/kudu/tools/table_scanner.cc
2 files changed, 105 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/34/21634/1
--
To view, visit http://gerrit.cloudera.org:8080/21634
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I94f99f845393ff2460761cc7bd82ecb3f3ead79b
Gerrit-Change-Number: 21634
Gerrit-PatchSet: 1
Gerrit-Owner: Wang Xixu <[email protected]>

Reply via email to