Class FixedPrecisionNumeric
- java.lang.Object
-
- org.apache.beam.sdk.schemas.logicaltypes.PassThroughLogicalType<java.math.BigDecimal>
-
- org.apache.beam.sdk.schemas.logicaltypes.FixedPrecisionNumeric
-
- All Implemented Interfaces:
java.io.Serializable
,Schema.LogicalType<java.math.BigDecimal,java.math.BigDecimal>
public class FixedPrecisionNumeric extends PassThroughLogicalType<java.math.BigDecimal>
Fixed precision numeric types used to represent jdbc NUMERIC and DECIMAL types.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
BASE_IDENTIFIER
Identifier of the unspecified precision numeric type.static java.lang.String
IDENTIFIER
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FixedPrecisionNumeric
of(int scale)
Create a FixedPrecisionNumeric instance with specified scale and unspecified precision.static FixedPrecisionNumeric
of(int precision, int scale)
Create a FixedPrecisionNumeric instance with specified precision and scale.static FixedPrecisionNumeric
of(Row row)
Create a FixedPrecisionNumeric instance with specified argument row.java.math.BigDecimal
toInputType(java.math.BigDecimal base)
Convert the Java type used by the baseSchema.FieldType
to the input type.-
Methods inherited from class org.apache.beam.sdk.schemas.logicaltypes.PassThroughLogicalType
getArgument, getArgumentType, getBaseType, getIdentifier, toBaseType
-
-
-
-
Field Detail
-
IDENTIFIER
public static final java.lang.String IDENTIFIER
- See Also:
- Constant Field Values
-
BASE_IDENTIFIER
public static final java.lang.String BASE_IDENTIFIER
Identifier of the unspecified precision numeric type. It corresponds to Java SDK'sSchema.FieldType.DECIMAL
. It is the underlying representation type of FixedPrecisionNumeric logical type in order to be compatible with existing Java field types.
-
-
Method Detail
-
of
public static FixedPrecisionNumeric of(int precision, int scale)
Create a FixedPrecisionNumeric instance with specified precision and scale. ``precision=-1`` indicates unspecified precision.
-
of
public static FixedPrecisionNumeric of(int scale)
Create a FixedPrecisionNumeric instance with specified scale and unspecified precision.
-
of
public static FixedPrecisionNumeric of(Row row)
Create a FixedPrecisionNumeric instance with specified argument row.
-
toInputType
public java.math.BigDecimal toInputType(java.math.BigDecimal base)
Description copied from interface:Schema.LogicalType
Convert the Java type used by the baseSchema.FieldType
to the input type.- Specified by:
toInputType
in interfaceSchema.LogicalType<java.math.BigDecimal,java.math.BigDecimal>
- Overrides:
toInputType
in classPassThroughLogicalType<java.math.BigDecimal>
-
-