Examples of findPropertyDeclaration()


Examples of com.asakusafw.dmdl.semantics.ModelDeclaration.findPropertyDeclaration()

                "model = {",
                "  @directio.hive.decimal(precision = 10, scale = 2)",
                "  simple : DECIMAL;",
                "};"
        }).findModelDeclaration("model");
        PropertyDeclaration property = model.findPropertyDeclaration("simple");
        HiveFieldTrait trait = property.getTrait(HiveFieldTrait.class);
        assertThat(trait, is(notNullValue()));
        assertThat(trait.getTypeKind(), is(HiveFieldTrait.TypeKind.DECIMAL));
        assertThat(trait.getDecimalPrecision(), is(10));
        assertThat(trait.getDecimalScale(), is(2));
View Full Code Here

Examples of com.asakusafw.dmdl.semantics.ModelDeclaration.findPropertyDeclaration()

                "model = {",
                "  @directio.hive.decimal(precision = 1, scale = 0)",
                "  simple : DECIMAL;",
                "};"
        }).findModelDeclaration("model");
        PropertyDeclaration property = model.findPropertyDeclaration("simple");
        HiveFieldTrait trait = property.getTrait(HiveFieldTrait.class);
        assertThat(trait, is(notNullValue()));
        assertThat(trait.getDecimalPrecision(), is(1));
        assertThat(trait.getDecimalScale(), is(0));
    }
View Full Code Here

Examples of com.asakusafw.dmdl.semantics.ModelDeclaration.findPropertyDeclaration()

                        HiveDecimal.MAX_PRECISION,
                        HiveDecimal.MAX_SCALE),
                "  simple : DECIMAL;",
                "};"
        }).findModelDeclaration("model");
        PropertyDeclaration property = model.findPropertyDeclaration("simple");
        HiveFieldTrait trait = property.getTrait(HiveFieldTrait.class);
        assertThat(trait, is(notNullValue()));
        assertThat(trait.getDecimalPrecision(), is(HiveDecimal.MAX_PRECISION));
        assertThat(trait.getDecimalScale(), is(HiveDecimal.MAX_SCALE));
    }
View Full Code Here

Examples of com.asakusafw.dmdl.semantics.ModelDeclaration.findPropertyDeclaration()

                "model = {",
                "  @directio.hive.field(name = 'test_column')",
                "  simple : INT;",
                "};"
        }).findModelDeclaration("model");
        PropertyDeclaration property = model.findPropertyDeclaration("simple");
        HiveFieldTrait trait = property.getTrait(HiveFieldTrait.class);
        assertThat(trait, is(notNullValue()));
        assertThat(trait.getColumnName(), is("test_column"));
        assertThat(trait.getTypeKind(), is(HiveFieldTrait.TypeKind.NATURAL));
        assertThat(trait.isColumnPresent(), is(true));
View Full Code Here

Examples of com.asakusafw.dmdl.semantics.ModelDeclaration.findPropertyDeclaration()

                "model = {",
                "  @directio.hive.timestamp",
                "  simple : DATE;",
                "};"
        }).findModelDeclaration("model");
        PropertyDeclaration property = model.findPropertyDeclaration("simple");
        HiveFieldTrait trait = property.getTrait(HiveFieldTrait.class);
        assertThat(trait, is(notNullValue()));
        assertThat(trait.getTypeKind(), is(HiveFieldTrait.TypeKind.TIMESTAMP));
    }
View Full Code Here

Examples of com.asakusafw.dmdl.semantics.ModelDeclaration.findPropertyDeclaration()

                "model = {",
                "  @directio.hive.string",
                "  simple : DATE;",
                "};"
        }).findModelDeclaration("model");
        PropertyDeclaration property = model.findPropertyDeclaration("simple");
        HiveFieldTrait trait = property.getTrait(HiveFieldTrait.class);
        assertThat(trait, is(notNullValue()));
        assertThat(trait.getTypeKind(), is(HiveFieldTrait.TypeKind.STRING));
    }
View Full Code Here

Examples of com.asakusafw.dmdl.semantics.ModelDeclaration.findPropertyDeclaration()

                "model = {",
                "  @directio.hive.string",
                "  simple : DATETIME;",
                "};"
        }).findModelDeclaration("model");
        PropertyDeclaration property = model.findPropertyDeclaration("simple");
        HiveFieldTrait trait = property.getTrait(HiveFieldTrait.class);
        assertThat(trait, is(notNullValue()));
        assertThat(trait.getTypeKind(), is(HiveFieldTrait.TypeKind.STRING));
    }
View Full Code Here

Examples of com.asakusafw.dmdl.semantics.ModelDeclaration.findPropertyDeclaration()

                "model = {",
                "  @directio.hive.string",
                "  simple : DECIMAL;",
                "};"
        }).findModelDeclaration("model");
        PropertyDeclaration property = model.findPropertyDeclaration("simple");
        HiveFieldTrait trait = property.getTrait(HiveFieldTrait.class);
        assertThat(trait, is(notNullValue()));
        assertThat(trait.getTypeKind(), is(HiveFieldTrait.TypeKind.STRING));
    }
View Full Code Here

Examples of com.asakusafw.dmdl.semantics.ModelDeclaration.findPropertyDeclaration()

                "model = {",
                "  @directio.hive.char(length = 3)",
                "  simple : TEXT;",
                "};"
        }).findModelDeclaration("model");
        PropertyDeclaration property = model.findPropertyDeclaration("simple");
        HiveFieldTrait trait = property.getTrait(HiveFieldTrait.class);
        assertThat(trait, is(notNullValue()));
        assertThat(trait.getTypeKind(), is(HiveFieldTrait.TypeKind.CHAR));
        assertThat(trait.getStringLength(), is(3));
    }
View Full Code Here

Examples of com.asakusafw.dmdl.semantics.ModelDeclaration.findPropertyDeclaration()

                "model = {",
                "  @directio.hive.ignore",
                "  simple : INT;",
                "};"
        }).findModelDeclaration("model");
        PropertyDeclaration property = model.findPropertyDeclaration("simple");
        HiveFieldTrait trait = property.getTrait(HiveFieldTrait.class);
        assertThat(trait, is(notNullValue()));
        assertThat(trait.isColumnPresent(), is(false));
    }
}
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.