}
}
@Override
protected void parseTableDefinition(Schema schema, CreateTable createTable, String tableName) {
CreateHBaseTable command = (CreateHBaseTable) createTable;
Options options;
ArrayList<String> splitKeys;
do {
DefineCommand c = parseAlterTableAddConstraintIf(tableName, schema);
if (c != null) {
command.addConstraintCommand(c);
} else {
//TABLE级别的选项参数,支持下面两种语法:
//OPTIONS(...)
//TABLE OPTIONS(...)
options = parseTableOptions();
if (options != null) {
command.setTableOptions(options);
continue;
}
splitKeys = parseSplitKeys();
if (splitKeys != null) {
command.setSplitKeys(splitKeys);
continue;
}
if (readIf("COLUMN")) {
read("FAMILY");
//COLUMN FAMILY OPTIONS(...)语法
options = parseOptions();
if (options != null) {
command.setDefaultColumnFamilyOptions(options);
} else {
//COLUMN FAMILY定义
String cfName = readUniqueIdentifier();
options = null;
if (readIf("(") && !readIf(")")) {
do {
options = parseOptions();
if (options == null)
parseColumn(schema, command, tableName, cfName);
} while (readIfMore());
}
CreateColumnFamily cf = new CreateColumnFamily(session, cfName, options);
command.addCreateColumnFamily(cf);
}
} else {
parseColumn(schema, command, tableName, null);
}
}