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

Examples of org.apache.hadoop.hbase.hbql.client.HStatement.executeQuery()


                              + "VERSIONS 3 "
                              //+ "SERVER FILTER WHERE author LIKE '.*val.*' OR LENGTH(author) > 4 "
                              + "CLIENT FILTER WHERE author LIKE '.*val.*' OR LENGTH(author) > 4";

        HStatement stmt = conn.createStatement();
        HResultSet<TestObject> results2 = stmt.executeQuery(query2, TestObject.class);

        for (TestObject val2 : results2) {
            System.out.println("Current Values: " + val2.keyval + " - " + val2.author + " - " + val2.title);

            System.out.println("Historicals");
View Full Code Here


    public void selectExpressions() throws HBqlException {

        final String query1 = "SELECT val1, val5, (val5 - val5 + val5) as val6, (val5+val5) as val7 FROM tab8";

        HStatement stmt = connection.createStatement();
        HResultSet<HRecord> results1 = stmt.executeQuery(query1);

        List<String> testKeyVals = Lists.newArrayList();
        List<String> testVal1Vals = Lists.newArrayList();
        List<Integer> testVal5Vals = Lists.newArrayList();
        List<Integer> testVal6Vals = Lists.newArrayList();
View Full Code Here

    private static void showValues() throws HBqlException {

        final String query1 = "SELECT keyval, val1, val2, val3 FROM tab3";

        HStatement stmt = connection.createStatement();
        HResultSet<HRecord> results = stmt.executeQuery(query1);

        int rec_cnt = 0;
        for (HRecord rec : results) {

            String keyval = (String)rec.getCurrentValue("keyval");
View Full Code Here

        List<AnnotatedAllTypes> vals = insertSomeData(cnt, true);

        assertTrue(vals.size() == cnt);

        HStatement stmt = conn.createStatement();
        HResultSet<AnnotatedAllTypes> recs = stmt.executeQuery("select * from alltypes2", AnnotatedAllTypes.class);

        int reccnt = 0;
        for (final AnnotatedAllTypes rec : recs)
            assertTrue(rec.equals(vals.get(reccnt++)));

View Full Code Here

        List<AnnotatedAllTypes> vals = insertSomeData(cnt, false);

        assertTrue(vals.size() == cnt);

        HStatement stmt = conn.createStatement();
        HResultSet<AnnotatedAllTypes> recs = stmt.executeQuery("select * from alltypes2", AnnotatedAllTypes.class);

        int reccnt = 0;
        for (final AnnotatedAllTypes rec : recs)
            assertTrue(rec.equals(vals.get(reccnt++)));

View Full Code Here

        List<RecordAllTypes> vals = insertSomeData(cnt, true);

        assertTrue(vals.size() == cnt);

        HStatement stmt = conn.createStatement();
        HResultSet<HRecord> recs = stmt.executeQuery("select * from alltypes");

        int reccnt = 0;
        for (final HRecord rec : recs)
            assertTrue((new RecordAllTypes(rec)).equals(vals.get(reccnt++)));

View Full Code Here

        List<RecordAllTypes> vals = insertSomeData(cnt, false);

        assertTrue(vals.size() == cnt);

        HStatement stmt = conn.createStatement();
        HResultSet<HRecord> recs = stmt.executeQuery("select * from alltypes");

        int reccnt = 0;
        for (final HRecord rec : recs)
            assertTrue((new RecordAllTypes(rec)).equals(vals.get(reccnt++)));

View Full Code Here

                     + "f3 ("
                     + "    val1 int alias val5, "
                     + "    val2 int alias val6 "
                     + "))");

        HResultSet<HRecord> rs = stmt.executeQuery("select * from sch9");

        for (HRecord rec : rs) {
            int val5 = (Integer)rec.getCurrentValue("val5");
            int val6 = (Integer)rec.getCurrentValue("val6");
            String val1 = (String)rec.getCurrentValue("val1");
View Full Code Here

    private int showValues(final String sql, final boolean expectException) {

        Exception ex = null;
        try {
            HStatement stmt = connection.createStatement();
            HResultSet<HRecord> results = stmt.executeQuery(sql);

            int rec_cnt = 0;
            System.out.println("Results:");

            for (HRecord rec : results) {
View Full Code Here

    }

    private static void showValues(final String sql, final int cnt, final boolean printValues) throws HBqlException {

        HStatement stmt = connection.createStatement();
        HResultSet<HRecord> results = stmt.executeQuery(sql);

        int rec_cnt = 0;
        for (HRecord rec : results) {

            String keyval = (String)rec.getCurrentValue("keyval");
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.