Package org.lealone.hbase.command.ddl

Examples of org.lealone.hbase.command.ddl.CreateHBaseTable


        }
    }

    @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);
                }
            }
View Full Code Here


            return super.createCommand(p, sql);
    }

    @Override
    public CreateHBaseTable createTable(Session session, Schema schema) {
        return new CreateHBaseTable(session, schema);
    }
View Full Code Here

TOP

Related Classes of org.lealone.hbase.command.ddl.CreateHBaseTable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.