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(