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

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


                     + "family1 ("
                     + "  val1 INT ALIAS val1, "
                     + "  val2 STRING ALIAS val2 DEFAULT 'this is a default value'"
                     + "))");

        HPreparedStatement ps = conn.prepareStatement("INSERT INTO fooMapping (keyval, val1, val2) "
                                                      + "VALUES (:key, :val1, DEFAULT)");

        ps.setParameter("key", Util.getZeroPaddedNonNegativeNumber(2, 10));
        ps.setParameter("val1", 123);
View Full Code Here


                     + "  val3 INT ALIAS val7 "
                     + "))");

        conn.execute("CREATE INDEX val1idx ON tab1 (val1) INCLUDE (val5, val6) IF NOT indexExistsForTable('val1idx', 'tab1')");

        HPreparedStatement pstmt = conn.prepareStatement("SELECT keyval, f1:val1, val5 FROM tab1 "
                                                         + "WITH INDEX val1idx KEYS FIRST TO :endkey "
                                                         + "INDEX FILTER WHERE val5 < 8 "
                                                         + "CLIENT FILTER WHERE val6 > 4");

        pstmt.setParameter("endkey", Util.getZeroPaddedNonNegativeNumber(34, 10));
View Full Code Here

                     + "f3 INCLUDE UNMAPPED ("
                     + "  val2 INT ALIAS val6, "
                     + "  val3 INT ALIAS val7 "
                     + "))");

        HPreparedStatement pstmt = conn.prepareStatement("SELECT keyval, f1:val1, val5 FROM tab1 "
                                                         + "WITH KEYS FIRST TO :endkey "
                                                         + "VERSIONS 4 "
                                                         + "CLIENT FILTER WHERE val6 > 4");

        pstmt.setParameter("endkey", Util.getZeroPaddedNonNegativeNumber(34, 10));
View Full Code Here

            conn.execute("CREATE TABLE example1 (f1()) ");
        else
            conn.execute("DELETE FROM demo1");

        // Add some records using an INSERT stmt
        HPreparedStatement stmt = conn.prepareStatement("INSERT INTO demo1 " +
                                                        "(keyval, val1, val2, f1:val3) VALUES " +
                                                        "(ZEROPAD(:key, 10), :val1, :val2, DEFAULT)");

        for (int i = 0; i < 5; i++) {
            stmt.setParameter("key", i);
View Full Code Here

            conn.execute("CREATE TABLE example2 (f1())");
        else
            conn.execute("DELETE FROM demo2");

        // Add some records using an INSERT stmt
        HPreparedStatement stmt = conn.prepareStatement("INSERT INTO demo2 " +
                                                        "(keyval, val1, val2, val3) VALUES " +
                                                        "(ZEROPAD(:key, 10), :val1, :val2, DEFAULT)");

        for (int i = 0; i < 5; i++) {
            stmt.setParameter("key", i);
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.