Package com.inadco.hbl.client

Examples of com.inadco.hbl.client.AggregateQuery


             * this should be equivalent to select aggr_func(impCnt),
             * aggr_func(click) from ... where dim1<=ids[0] and dim1>=ids[0]
             * group by dim1
             */

            AggregateQuery query = queryClient.createQuery();
            query.setCube(cubeName).addMeasure("impCnt").addMeasure("click");
            query.addClosedSlice("dim1", ids[0], ids[0]).addGroupBy("dim1");
            AggregateResultSet rs = query.execute();
            closeables.addFirst(rs);
            while (rs.hasNext()) {
                rs.next();
                AggregateResult ar = rs.current();
                System.out.printf("%032X sum/cnt: impCnt %.4f/%d, click %.4f/%d\n",
View Full Code Here


             * result in composite key filtering with a restart (most
             * fundamental composite key filtering capability but only one part
             * of the key). This now passes too.
             *
             */
            AggregateQuery query = queryClient.createQuery();

            query.setCube(cubeName).addMeasure("impCnt").addMeasure("click");
            query.addClosedSlice("dim1", ids[0], ids[1]).addGroupBy("dim1");
            AggregateResultSet rs = query.execute();
            closeables.addFirst(rs);
            while (rs.hasNext()) {
                rs.next();
                AggregateResult ar = rs.current();
                System.out.printf("%032X sum/cnt: impCnt %.4f/%d, click %.4f/%d\n",
View Full Code Here

            /**
             * same as client2 but print the summaries separately (no grouping).
             * This is obviously not terribly useful, the queries have got to
             * have group specification -- -- unless we group up all of it.
             */
            AggregateQuery query = queryClient.createQuery();

            query.setCube(cubeName).addMeasure("impCnt").addMeasure("click");
            query.addClosedSlice("dim1", ids[0], ids[1])/* .addGroupBy("dim1") */;
            AggregateResultSet rs = query.execute();
            closeables.addFirst(rs);
            while (rs.hasNext()) {
                rs.next();
                AggregateResult ar = rs.current();
                System.out.printf("%s sum/cnt: impCnt %.4f/%d, click %.4f/%d\n",
View Full Code Here

    private void testClient4(String cubeName) throws IOException, HblException {
        Deque<Closeable> closeables = new ArrayDeque<Closeable>();
        try {

            AggregateQuery query = queryClient.createQuery();
            query.setCube(cubeName);
            for (int i = 0; i < 5; i++) {

                byte ids[][] = new byte[2][];
                ids[0] = new byte[16];
                ids[1] = new byte[16];
                HblUtil.incrementKey(ids[1], 0, 16);

                /*
                 * will try to also constrain for half-open [1:00am,3:00am)
                 */

                GregorianCalendar startTime = IOUtil.tryClone(START_BASE);
                GregorianCalendar endTime = IOUtil.tryClone(START_BASE);

                /*
                 * this will be in local time, whereas example was generated in
                 * UTC. So for PST we get actually normally hours from 9,10 am.
                 * which would result in impression count of 17 for key 00000,
                 * and 21 ifor key 000001.
                 */
                startTime.add(Calendar.HOUR_OF_DAY, 1);
                endTime.add(Calendar.HOUR_OF_DAY, 3);
                // recalculate the calendars
                startTime.getTimeInMillis();
                endTime.getTimeInMillis();

                /*
                 * same as client2 but print the summaries separately (no
                 * grouping).
                 */

                query.addMeasure("impCnt").addMeasure("click");
                query.addClosedSlice("dim1", ids[0], ids[1]).addGroupBy("dim1");
                query.addHalfOpenSlice("impressionTime", startTime, endTime);

                long ms = System.currentTimeMillis();
                AggregateResultSet rs = query.execute();
                closeables.addFirst(rs);
                while (rs.hasNext()) {
                    rs.next();
                    AggregateResult ar = rs.current();
                    System.out.printf("%032X sum/cnt: impCnt %.4f/%d, click %.4f/%d\n",
View Full Code Here

TOP

Related Classes of com.inadco.hbl.client.AggregateQuery

Copyright © 2018 www.massapicom. 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.