Package org.apache.hadoop.hbase.hbql.client

Examples of org.apache.hadoop.hbase.hbql.client.HConnection.tableExists()


    @Test
    public void simpleTable() throws HBqlException {

        HConnection connection = HConnectionManager.newConnection();

        assertFalse(connection.tableExists("zzz"));

        String tableName = "tabletest1";
        if (connection.tableExists(tableName)) {
            connection.disableTable(tableName);
            connection.dropTable(tableName);
View Full Code Here


        HConnection connection = HConnectionManager.newConnection();

        assertFalse(connection.tableExists("zzz"));

        String tableName = "tabletest1";
        if (connection.tableExists(tableName)) {
            connection.disableTable(tableName);
            connection.dropTable(tableName);
        }
        assertFalse(connection.tableExists(tableName));
        connection.execute("CREATE TABLE " + tableName + " (family1(), family2(), family3())");
View Full Code Here

        String tableName = "tabletest1";
        if (connection.tableExists(tableName)) {
            connection.disableTable(tableName);
            connection.dropTable(tableName);
        }
        assertFalse(connection.tableExists(tableName));
        connection.execute("CREATE TABLE " + tableName + " (family1(), family2(), family3())");
        assertTrue(connection.tableExists(tableName));
        HTableDescriptor table = connection.getHTableDescriptor(tableName);
        HColumnDescriptor[] hcd = table.getColumnFamilies();
        assertTrue((hcd.length == 3));
View Full Code Here

            connection.disableTable(tableName);
            connection.dropTable(tableName);
        }
        assertFalse(connection.tableExists(tableName));
        connection.execute("CREATE TABLE " + tableName + " (family1(), family2(), family3())");
        assertTrue(connection.tableExists(tableName));
        HTableDescriptor table = connection.getHTableDescriptor(tableName);
        HColumnDescriptor[] hcd = table.getColumnFamilies();
        assertTrue((hcd.length == 3));
        assertTrue(table.hasFamily("family1".getBytes()));
        assertTrue(table.hasFamily("family2".getBytes()));
View Full Code Here

    public void fullTable() throws HBqlException {

        HConnection connection = HConnectionManager.newConnection();

        String tableName = "tabletest1";
        if (connection.tableExists(tableName)) {
            connection.disableTable(tableName);
            connection.dropTable(tableName);
        }
        assertFalse(connection.tableExists(tableName));
        connection.execute("CREATE TABLE " + tableName
View Full Code Here

        String tableName = "tabletest1";
        if (connection.tableExists(tableName)) {
            connection.disableTable(tableName);
            connection.dropTable(tableName);
        }
        assertFalse(connection.tableExists(tableName));
        connection.execute("CREATE TABLE " + tableName
                           + " (family1 ("
                           + "MAX_VERSIONS:  12, "
                           + "BLOOMFILTER_TYPE:  ROW, "
                           + "BLOCK_SIZE: 123, "
View Full Code Here

                           + "BLOCK_CACHE_ENABLED: TRUE, "
                           + "COMPRESSION_TYPE: GZ, "
                           + "IN_MEMORY: TRUE, "
                           + "TTL: 440"
                           + "))");
        assertTrue(connection.tableExists(tableName));
        HTableDescriptor table = connection.getHTableDescriptor(tableName);
        HColumnDescriptor[] hcd = table.getColumnFamilies();
        assertTrue((hcd.length == 1));
        assertTrue(table.hasFamily("family1".getBytes()));
        assertTrue(table.getNameAsString().equals(tableName));
View Full Code Here

                     + "  val2 INT ALIAS val2, "
                     + "  val3 STRING DEFAULT 'This is a default value' "
                     + "))");

        // Clean up table
        if (!conn.tableExists("example1"))
            conn.execute("CREATE TABLE example1 (f1()) ");
        else
            conn.execute("DELETE FROM demo1");

        // Add some records using an INSERT stmt
View Full Code Here

                     + "  val2 INT ALIAS val2, "
                     + "  val3 STRING ALIAS val3 DEFAULT 'This is a default value' "
                     + "))");

        // Clean up table
        if (!conn.tableExists("example2"))
            conn.execute("CREATE TABLE example2 (f1())");
        else
            conn.execute("DELETE FROM demo2");

        // Add some records using an INSERT stmt
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.