Examples of SummarizedModelDescription


Examples of com.asakusafw.dmdl.thundergate.model.SummarizedModelDescription

            .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.model.SummarizedModelDescription

            .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.model.SummarizedModelDescription

    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.model.SummarizedModelDescription

    public void simple() {
        TableModelDescription desc = new TableModelBuilder("A")
            .add(null, "word", new StringType(255))
            .toDescription();

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

        assertThat(model.getReference().getSimpleName(), is("S"));
        assertThat(model.getGroupBy(), is(sources(desc, "word")));

        List<ModelProperty> properties = model.getProperties();
        assertThat(properties.size(), is(2));

        ModelProperty word = properties.get(0);
        assertThat(word.getName(), is("word"));
        assertThat(word.getType().getKind(), is(PropertyTypeKind.STRING));
View Full Code Here

Examples of com.asakusafw.dmdl.thundergate.model.SummarizedModelDescription

    public void singleGroup() {
        TableModelDescription desc = new TableModelBuilder("A")
            .add(null, "word", new StringType(255))
            .toDescription();

        SummarizedModelDescription model = new SummarizedModelBuilder("S", desc, "a")
            .add("count", Aggregator.COUNT, "a.word")
            .toDescription();

        assertThat(model.getReference().getSimpleName(), is("S"));
        assertThat(model.getGroupBy(), is(sources(desc)));

        List<ModelProperty> properties = model.getProperties();
        assertThat(properties.size(), is(1));

        ModelProperty count = properties.get(0);
        assertThat(count.getName(), is("count"));
        assertThat(count.getType().getKind(), is(PropertyTypeKind.LONG));
View Full Code Here

Examples of com.asakusafw.dmdl.thundergate.model.SummarizedModelDescription

            .add(null, "sex", PropertyTypeKind.BYTE)
            .add(null, "age", PropertyTypeKind.SHORT)
            .add(null, "name", new StringType(255))
            .toDescription();

        SummarizedModelDescription model = new SummarizedModelBuilder("S", desc, "a")
            .add("sex", Aggregator.IDENT, "sex")
            .add("age", Aggregator.IDENT, "age")
            .add("count", Aggregator.COUNT, "name")
            .groupBy("sex", "age")
            .toDescription();

        assertThat(model.getReference().getSimpleName(), is("S"));
        assertThat(model.getGroupBy(), is(sources(desc, "sex", "age")));

        List<ModelProperty> properties = model.getProperties();
        assertThat(properties.size(), is(3));

        ModelProperty sex = properties.get(0);
        assertThat(sex.getName(), is("sex"));
        assertThat(sex.getType().getKind(), is(PropertyTypeKind.BYTE));
View Full Code Here

Examples of com.asakusafw.dmdl.thundergate.model.SummarizedModelDescription

            }
            ModelProperty property = toProperty(column);
            properties.add(property);
        }
        validate();
        return new SummarizedModelDescription(
                getReference(),
                properties,
                groupProperties);
    }
View Full Code Here

Examples of com.asakusafw.modelgen.model.SummarizedModelDescription

            }
            ModelProperty property = toProperty(column);
            properties.add(property);
        }
        validate();
        return new SummarizedModelDescription(
                getReference(),
                properties,
                groupProperties);
    }
View Full Code Here

Examples of com.asakusafw.modelgen.model.SummarizedModelDescription

        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.model.SummarizedModelDescription

        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
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.