Examples of SummarizedModelBuilder


Examples of com.asakusafw.dmdl.thundergate.util.SummarizedModelBuilder

            .add(null, "SID", PropertyTypeKind.LONG, Attribute.PRIMARY_KEY)
            .add(null, "VALUE_A", PropertyTypeKind.INT)
            .add(null, "VALUE_B", PropertyTypeKind.LONG)
            .add(null, "VALUE_C", PropertyTypeKind.DATE)
            .toDescription();
        SummarizedModelDescription summarize = new SummarizedModelBuilder("SIMPLE", target, "t")
            .groupBy("VALUE_A")
            .add("KEY", com.asakusafw.dmdl.thundergate.model.Aggregator.IDENT, "t.VALUE_A")
            .add("SUM", com.asakusafw.dmdl.thundergate.model.Aggregator.SUM, "t.VALUE_B")
            .add("COUNT", com.asakusafw.dmdl.thundergate.model.Aggregator.COUNT, "t.SID")
            .add("MAX", com.asakusafw.dmdl.thundergate.model.Aggregator.MAX, "t.VALUE_C")
View Full Code Here

Examples of com.asakusafw.dmdl.thundergate.util.SummarizedModelBuilder

            .add(null, "SID", PropertyTypeKind.LONG, Attribute.PRIMARY_KEY)
            .add(null, "VALUE_A", PropertyTypeKind.INT)
            .add(null, "VALUE_B", PropertyTypeKind.LONG)
            .add(null, "VALUE_C", PropertyTypeKind.DATE)
            .toDescription();
        SummarizedModelDescription summarize = new SummarizedModelBuilder("SIMPLE", target, "t")
            .groupBy("VALUE_A")
            .add("KEY", com.asakusafw.dmdl.thundergate.model.Aggregator.IDENT, "t.VALUE_A")
            .add("SUM", com.asakusafw.dmdl.thundergate.model.Aggregator.SUM, "t.VALUE_B")
            .add("COUNT", com.asakusafw.dmdl.thundergate.model.Aggregator.COUNT, "t.SID")
            .add("MAX", com.asakusafw.dmdl.thundergate.model.Aggregator.MAX, "t.VALUE_C")
View Full Code Here

Examples of com.asakusafw.dmdl.thundergate.util.SummarizedModelBuilder

    public void conflict_key() {
        TableModelDescription target = new TableModelBuilder("TARGET")
            .add(null, "SID", PropertyTypeKind.LONG, Attribute.PRIMARY_KEY)
            .add(null, "GROUPING", PropertyTypeKind.INT)
            .toDescription();
        SummarizedModelDescription summarize = new SummarizedModelBuilder("SIMPLE", target, "t")
            .groupBy("GROUPING")
            .add("KEY", com.asakusafw.dmdl.thundergate.model.Aggregator.IDENT, "t.GROUPING")
            .add("COUNT", com.asakusafw.dmdl.thundergate.model.Aggregator.COUNT, "t.GROUPING")
            .toDescription();
View Full Code Here

Examples of com.asakusafw.dmdl.thundergate.util.SummarizedModelBuilder

        assert target != null;
        assert target.getKind() == CreateView.Kind.SUMMARIZED;

        assert context.get(target.from.table) != null;

        SummarizedModelBuilder builder = new SummarizedModelBuilder(
                target.name.token,
                context.get(target.from.table),
                target.from.alias);

        // グループ化
        for (Name name : target.groupBy) {
            builder.groupBy(name.token);
        }

        // カラムの追加
        for (Select select : target.selectList) {
            builder.add(
                    select.alias.token,
                    select.aggregator,
                    select.name.token);
        }

        return builder.toDescription();
    }
View Full Code Here

Examples of com.asakusafw.modelgen.util.SummarizedModelBuilder

        assert target.ast.getKind() == CreateView.Kind.SUMMARIZED;

        CreateView ast = target.ast;
        assert context.get(ast.from.table) != null;

        SummarizedModelBuilder builder = new SummarizedModelBuilder(
                ast.name.token,
                context.get(ast.from.table),
                ast.from.alias);
        builder.namespace(target.namespace);

        // グループ化
        for (Name name : ast.groupBy) {
            builder.groupBy(name.token);
        }

        // カラムの追加
        for (Select select : ast.selectList) {
            builder.add(
                    select.alias.token,
                    select.aggregator,
                    select.name.token);
        }

        return builder.toDescription();
    }
View Full Code Here

Examples of com.asakusafw.modelgen.util.SummarizedModelBuilder

        TableModelDescription a = new TableModelBuilder("A")
            .add(null, "id", PropertyTypeKind.LONG, Attribute.PRIMARY_KEY)
            .add(null, "word", new StringType(255))
            .toDescription();

        SummarizedModelDescription model = new SummarizedModelBuilder("S", a, "a")
            .add("word", Aggregator.IDENT, "a.word")
            .add("count", Aggregator.COUNT, "a.word")
            .groupBy("a.word")
            .toDescription();
View Full Code Here

Examples of com.asakusafw.modelgen.util.SummarizedModelBuilder

        TableModelDescription a = new TableModelBuilder("A")
            .add(null, "id", PropertyTypeKind.LONG, Attribute.PRIMARY_KEY)
            .add(null, "value", PropertyTypeKind.INT)
            .toDescription();

        SummarizedModelDescription model = new SummarizedModelBuilder("S", a, "a")
            .add("sumId", Aggregator.IDENT, "a.id")
            .add("sumSum", Aggregator.SUM, "a.value")
            .add("sumCount", Aggregator.COUNT, "a.value")
            .add("sumMax", Aggregator.MAX, "a.value")
            .add("sumMin", Aggregator.MIN, "a.value")
View Full Code Here

Examples of com.asakusafw.modelgen.util.SummarizedModelBuilder

        TableModelDescription a = new TableModelBuilder("A__a")
            .add(null, "id__a", PropertyTypeKind.LONG, Attribute.PRIMARY_KEY)
            .add(null, "word__a", new StringType(255))
            .toDescription();

        SummarizedModelDescription model = new SummarizedModelBuilder("_S__a", a, "a")
            .add("_word__a", Aggregator.IDENT, "a.word__a")
            .add("_count__a", Aggregator.COUNT, "a.word__a")
            .groupBy("a.word__a")
            .toDescription();
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.