<commit_before>package org.apache.hadoop.hbase.hbql.test;

import org.apache.hadoop.hbase.hbql.client.HConnection;
import org.apache.hadoop.hbase.hbql.client.HPersistException;
import org.apache.hadoop.hbase.hbql.client.HQuery;
import org.apache.hadoop.hbase.hbql.client.HResults;
import org.apache.hadoop.hbase.hbql.client.HTransaction;

import java.io.IOException;
import java.util.Date;

/**
 * Created by IntelliJ IDEA.
 * User: pambrose
 * Date: Sep 17, 2009
 * Time: 8:53:41 PM
 */
public class AnnotationExample {

    public static void main(String[] args) throws IOException, HPersistException {

        HConnection conn = HConnection.newHConnection();

        /*
        if (conn.tableExists("TestObject")) {
            System.out.println(conn.exec("disable table TestObject"));
            System.out.println(conn.exec("drop table TestObject"));
        }

        if (!conn.tableExists("TestObject"))
            System.out.println(conn.exec("create table using TestObject"));
        */

        final HTransaction tx = new HTransaction();
        for (int i = 0; i < 0; i++)
            tx.insert(new TestObject(i));

        conn.apply(tx);

        final String query2 = "SELECT title, titles, author, authorVersions "
                              + "FROM TestObject "
                              + "WITH "
                              // + "KEYS ALL "
                              + "KEYS '0000000007' TO '0000000008' "
                              + "TIME RANGE NOW()-DAY(15) TO NOW()+DAY(1) "
                              + "VERSIONS 3 "
                              //+ "SERVER FILTER WHERE TRUE "
                              + "SERVER FILTER WHERE author LIKE '.*val.*'"
                              + "CLIENT FILTER WHERE TRUE "
                //+ "CLIENT FILTER WHERE author LIKE '.*val.*'"
                ;

        HQuery<TestObject> q2 = conn.newHQuery(query2);
        HResults<TestObject> results2 = q2.execute();

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

            System.out.println("Historicals");

            if (val2.authorVersions != null)
                for (final Long key : val2.authorVersions.keySet())<commit_msg>Misc cleanup<commit_after>package org.apache.hadoop.hbase.hbql.test;

import org.apache.hadoop.hbase.hbql.client.HConnection;
import org.apache.hadoop.hbase.hbql.client.HPersistException;
import org.apache.hadoop.hbase.hbql.client.HQuery;
import org.apache.hadoop.hbase.hbql.client.HResults;
import org.apache.hadoop.hbase.hbql.client.HTransaction;

import java.io.IOException;
import java.util.Date;

/**
 * Created by IntelliJ IDEA.
 * User: pambrose
 * Date: Sep 17, 2009
 * Time: 8:53:41 PM
 */
public class AnnotationExample {

    public static void main(String[] args) throws IOException, HPersistException {

        HConnection conn = HConnection.newHConnection();

        /*
        if (conn.tableExists("TestObject")) {
            System.out.println(conn.exec("disable table TestObject"));
            System.out.println(conn.exec("drop table TestObject"));
        }
        */

        if (!conn.tableExists("TestObject")) {
            System.out.println(conn.exec("create table using TestObject"));

            final HTransaction tx = new HTransaction();
            for (int i = 0; i < 10; i++)
                tx.insert(new TestObject(i));

            conn.apply(tx);
        }

        final String query2 = "SELECT title, titles, author, authorVersions "
                              + "FROM TestObject "
                              + "WITH "
                              + "KEYS '0000000002' TO '0000000003', '0000000007' TO '0000000008' "
                              + "TIME RANGE NOW()-DAY(15) TO NOW()+DAY(1) "
                              + "VERSIONS 3 "
                              + "SERVER FILTER WHERE author LIKE '.*val.*' AND title "
                              + "CLIENT FILTER WHERE author LIKE '.*val.*'";

        HQuery<TestObject> q2 = conn.newHQuery(query2);
        HResults<TestObject> results2 = q2.execute();

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

            System.out.println("Historicals");

            if (val2.authorVersions != null)
                for (final Long key : val2.authorVersions.keySet())
{'fraction_non_alphanumeric': 0.12323549182164463, 'fraction_numerical': 0.0266636791395922, 'mean_word_length': 1.9138381201044385, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 6, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5013484', 'n_tokens_mistral': 1380, 'n_tokens_neox': 1246, 'n_words': 275}