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

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


    public void dropIndex() throws HBqlException {

        // START SNIPPET: drop-index

        HConnection conn = HConnectionManager.newConnection();
        conn.execute("DROP INDEX fooidx ON MAPPING fooMapping");
        // OR
        conn.execute("DROP INDEX fooidx ON TABLE foo");

        // Or using the API
        conn.dropIndexForMapping("fooidx", "fooMapping");
View Full Code Here


        // START SNIPPET: drop-index

        HConnection conn = HConnectionManager.newConnection();
        conn.execute("DROP INDEX fooidx ON MAPPING fooMapping");
        // OR
        conn.execute("DROP INDEX fooidx ON TABLE foo");

        // Or using the API
        conn.dropIndexForMapping("fooidx", "fooMapping");
        // or
        conn.dropIndexForTable("fooidx", "foo");
View Full Code Here

        // START SNIPPET: insert1

        HConnection conn = HConnectionManager.newConnection();

        conn.execute("CREATE TEMP MAPPING fooMapping FOR TABLE foo "
                     + "("
                     + "keyval KEY, "
                     + "family1 ("
                     + "  val1 INT ALIAS val1, "
                     + "  val2 STRING ALIAS val2"
View Full Code Here

                     + "family1 ("
                     + "  val1 INT ALIAS val1, "
                     + "  val2 STRING ALIAS val2"
                     + "))");

        conn.execute("INSERT INTO fooMapping (keyval, val1, val2) "
                     + "VALUES (ZEROPAD(2, 10), 123, 'test val')");

        // Or using the Record interface
        HRecord rec = conn.getMapping("fooMapping").newHRecord();
        rec.setCurrentValue("keyval", Util.getZeroPaddedNonNegativeNumber(2, 10));
View Full Code Here

        // START SNIPPET: delete1

        HConnection conn = HConnectionManager.newConnection();

        conn.execute("CREATE TEMP MAPPING fooMapping FOR TABLE foo "
                     + "("
                     + "keyval KEY, "
                     + "family1 ("
                     + "  val1 INT ALIAS val11, "
                     + "  val2 INT ALIAS val12, "
View Full Code Here

                     + "  val3 INT ALIAS val13, "
                     + "  val4 INT ALIAS val14, "
                     + "  val5 STRING ALIAS val15"
                     + "))");

        conn.execute("DELETE FROM fooMapping WITH CLIENT FILTER WHERE val1 > 4");

        conn.execute("DELETE family1:val1, val12 FROM fooMapping WITH CLIENT FILTER WHERE val1 > 5");

        conn.execute("DELETE family1:* FROM fooMapping WITH CLIENT FILTER WHERE val1 > 7");

View Full Code Here

                     + "  val5 STRING ALIAS val15"
                     + "))");

        conn.execute("DELETE FROM fooMapping WITH CLIENT FILTER WHERE val1 > 4");

        conn.execute("DELETE family1:val1, val12 FROM fooMapping WITH CLIENT FILTER WHERE val1 > 5");

        conn.execute("DELETE family1:* FROM fooMapping WITH CLIENT FILTER WHERE val1 > 7");

        // END SNIPPET: delete1

View Full Code Here

        conn.execute("DELETE FROM fooMapping WITH CLIENT FILTER WHERE val1 > 4");

        conn.execute("DELETE family1:val1, val12 FROM fooMapping WITH CLIENT FILTER WHERE val1 > 5");

        conn.execute("DELETE family1:* FROM fooMapping WITH CLIENT FILTER WHERE val1 > 7");

        // END SNIPPET: delete1

    }

View Full Code Here

        // START SNIPPET: insert2

        HConnection conn = HConnectionManager.newConnection();

        // A column with a default value.
        conn.execute("CREATE TEMP MAPPING fooMapping FOR TABLE foo "
                     + "("
                     + "keyval KEY, "
                     + "family1 ("
                     + "  val1 INT ALIAS val1, "
                     + "  val2 STRING ALIAS val2 DEFAULT 'this is a default value'"
View Full Code Here

    public void insert3() throws HBqlException {

        HConnection conn = HConnectionManager.newConnection();

        // START SNIPPET: insert3
        conn.execute("CREATE MAPPING fooMapping FOR TABLE foo_table "
                     + "("
                     + "keyval KEY, "
                     + "family1 ("
                     + "  val1 STRING ALIAS val1, "
                     + "  val2 STRING ALIAS val2, "
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.