Examples of AstLiteral


Examples of com.asakusafw.dmdl.model.AstLiteral

    private void analyzeElements(
            DmdlSemantics environment,
            AstAttribute attribute,
            Map<String, AstAttributeElement> elements,
            HiveFieldTrait trait) {
        AstLiteral length = AttributeUtil.takeLiteral(
                environment, attribute, elements, ELEMENT_NAME, LiteralKind.INTEGER, true);
        if (length != null) {
            BigInteger value = length.toIntegerValue();
            if (AttributeUtil.checkRange(
                    environment, length, label(ELEMENT_NAME),
                    value, 1L, (long) HiveVarchar.MAX_VARCHAR_LENGTH)) {
                trait.setVarcharTypeInfo(value.intValue());
            }
View Full Code Here

Examples of com.asakusafw.dmdl.model.AstLiteral

    private void analyzeElements(
            DmdlSemantics environment,
            AstAttribute attribute,
            Map<String, AstAttributeElement> elements,
            HiveFieldTrait trait) {
        AstLiteral length = AttributeUtil.takeLiteral(
                environment, attribute, elements, ELEMENT_NAME, LiteralKind.INTEGER, true);
        if (length != null) {
            BigInteger value = length.toIntegerValue();
            if (AttributeUtil.checkRange(
                    environment, length, label(ELEMENT_NAME),
                    value, 1L, (long) HiveChar.MAX_CHAR_LENGTH)) {
                trait.setCharTypeInfo(value.intValue());
            }
View Full Code Here

Examples of com.asakusafw.dmdl.model.AstLiteral

                    "@{0}.{1} must be a string literal",
                    TARGET_NAME,
                    ELEMENT_NAME));
            return null;
        } else {
            AstLiteral literal = (AstLiteral) target.value;
            if (literal.kind != LiteralKind.STRING) {
                environment.report(new Diagnostic(
                        Level.ERROR,
                        target,
                        "@{0}.{1} must be a string literal",
                        TARGET_NAME,
                        ELEMENT_NAME));
                return null;
            }
            return literal.toStringValue();
        }
    }
View Full Code Here

Examples of com.asakusafw.dmdl.model.AstLiteral

    private void analyzeElements(
            DmdlSemantics environment,
            AstAttribute attribute,
            Map<String, AstAttributeElement> elements,
            HiveFieldTrait trait) {
        AstLiteral precision = AttributeUtil.takeLiteral(
                environment, attribute, elements, ELEMENT_PRECISION_NAME, LiteralKind.INTEGER, true);
        int precisionValue = -1;
        if (precision != null) {
            if (AttributeUtil.checkRange(
                    environment, precision, label(ELEMENT_PRECISION_NAME),
                    precision.toIntegerValue(), 1L, (long) HiveDecimal.MAX_PRECISION)) {
                precisionValue = precision.toIntegerValue().intValue();
            }
        }
        AstLiteral scale = AttributeUtil.takeLiteral(
                environment, attribute, elements, ELEMENT_SCALE_NAME, LiteralKind.INTEGER, true);
        int scaleValue = -1;
        if (scale != null) {
            if (AttributeUtil.checkRange(
                    environment, scale, label(ELEMENT_SCALE_NAME),
                    scale.toIntegerValue(), 0L, (long) HiveDecimal.MAX_SCALE)) {
                scaleValue = scale.toIntegerValue().intValue();
            }
        }
        if (precisionValue >= 0 && scaleValue >= 0) {
            if (precisionValue < scaleValue) {
                environment.report(new Diagnostic(
View Full Code Here

Examples of com.asakusafw.dmdl.model.AstLiteral

    private void analyzeElements(
            DmdlSemantics environment,
            AstAttribute attribute,
            Map<String, AstAttributeElement> elements,
            HiveFieldTrait trait) {
        AstLiteral name =
                AttributeUtil.takeLiteral(environment, attribute, elements, ELEMENT_NAME, LiteralKind.STRING, true);
        if (name != null) {
            String value = name.toStringValue();
            if (AttributeUtil.checkPresent(environment, name, label(ELEMENT_NAME), value)) {
                trait.setColumnName(value);
            }
        }
        environment.reportAll(AttributeUtil.reportInvalidElements(attribute, elements.values()));
View Full Code Here

Examples of com.asakusafw.dmdl.model.AstLiteral

        Configuration config = config();
        config.setSidColumn("SID");
        config.setTimestampColumn("TIMESTAMP");
        config.setDeleteFlagColumn("DELETE");
        config.setDeleteFlagValue(new AstLiteral(null, "TRUE", LiteralKind.BOOLEAN));
        ThunderGateModelEmitter emitter = new ThunderGateModelEmitter(config);
        emitter.emit(table);

        ModelLoader loader = generateJava();
        loader.setNamespace(Constants.SOURCE_TABLE);
View Full Code Here

Examples of com.asakusafw.dmdl.model.AstLiteral

        Configuration config = config();
        config.setSidColumn("SID");
        config.setTimestampColumn("TIMESTAMP");
        config.setDeleteFlagColumn("DELETE");
        config.setDeleteFlagValue(new AstLiteral(null, "TRUE", LiteralKind.BOOLEAN));
        ThunderGateModelEmitter emitter = new ThunderGateModelEmitter(config);
        emitter.emit(table);

        ModelLoader loader = generateJava();
        loader.setNamespace(Constants.SOURCE_TABLE);
View Full Code Here

Examples of com.asakusafw.dmdl.model.AstLiteral

        Configuration config = config();
        config.setSidColumn("SID");
        config.setTimestampColumn("TIMESTAMP");
        config.setDeleteFlagColumn("DELETE");
        config.setDeleteFlagValue(new AstLiteral(null, "TRUE", LiteralKind.BOOLEAN));
        ThunderGateModelEmitter emitter = new ThunderGateModelEmitter(config);
        emitter.emit(table);

        ModelLoader loader = generateJava();
        loader.setNamespace(Constants.SOURCE_TABLE);
View Full Code Here

Examples of com.asakusafw.dmdl.model.AstLiteral

        Configuration config = config();
        config.setSidColumn("SID");
        config.setTimestampColumn("TIMESTAMP");
        config.setDeleteFlagColumn("DELETE");
        config.setDeleteFlagValue(new AstLiteral(null, "TRUE", LiteralKind.BOOLEAN));
        ThunderGateModelEmitter emitter = new ThunderGateModelEmitter(config);
        emitter.emit(table);

        ModelLoader loader = generateJava();
        loader.setNamespace(Constants.SOURCE_TABLE);
View Full Code Here

Examples of com.asakusafw.dmdl.model.AstLiteral

        Configuration config = config();
        config.setSidColumn("SID");
        config.setTimestampColumn("TIMESTAMP");
        config.setDeleteFlagColumn("DELETE");
        config.setDeleteFlagValue(new AstLiteral(null, "TRUE", LiteralKind.BOOLEAN));
        ThunderGateModelEmitter emitter = new ThunderGateModelEmitter(config);
        emitter.emit(table);

        ModelLoader loader = generateJava();
        loader.setNamespace(Constants.SOURCE_TABLE);
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.