Skip to content

Commit

Permalink
Fix set-type directive for decimal by adding a default value for scal…
Browse files Browse the repository at this point in the history
…e in case it is null/not provided.
  • Loading branch information
minurajeeve committed Oct 5, 2023
1 parent 6562f87 commit ad3f91b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,8 @@ public static Schema getSchemaForType(String type, Integer scale) throws Directi
type = type.toUpperCase();
if (type.equals(ColumnTypeNames.DECIMAL)) {
// TODO make set-type support setting decimal precision
typeSchema = Schema.nullableOf(Schema.decimalOf(38, scale));
scale = scale != null ? scale : 38;
typeSchema = Schema.nullableOf(Schema.decimalOf(76, scale));
} else {
if (!SCHEMA_TYPE_MAP.containsKey(type)) {
throw new DirectiveParseException(String.format("'%s' is an unsupported type. " +
Expand Down

0 comments on commit ad3f91b

Please sign in to comment.