Skip to content

Commit

Permalink
Fix static assignment causing NoClassDefFoundError when initializing …
Browse files Browse the repository at this point in the history
…from serialized
  • Loading branch information
Abacn committed Sep 29, 2022
1 parent 3e60371 commit e849f1f
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,18 @@ public class FixedPrecisionNumeric extends PassThroughLogicalType<BigDecimal> {
* FieldType#DECIMAL}. It is the underlying representation type of FixedPrecisionNumeric logical
* type in order to be compatible with existing Java field types.
*/
public static final String BASE_IDENTIFIER =
SchemaApi.LogicalTypes.Enum.DECIMAL
.getValueDescriptor()
.getOptions()
.getExtension(RunnerApi.beamUrn);
public static final String BASE_IDENTIFIER;

private static final Schema SCHEMA =
Schema.builder().addInt32Field("precision").addInt32Field("scale").build();
private static final Schema SCHEMA;

static {
BASE_IDENTIFIER =
SchemaApi.LogicalTypes.Enum.DECIMAL
.getValueDescriptor()
.getOptions()
.getExtension(RunnerApi.beamUrn);
SCHEMA = Schema.builder().addInt32Field("precision").addInt32Field("scale").build();
}

private final int precision;
private final int scale;
Expand Down

0 comments on commit e849f1f

Please sign in to comment.