From 2fb45bdb8eba37d6366c0cbdefbe314cc6eaf81f Mon Sep 17 00:00:00 2001 From: liyafan82 Date: Mon, 26 Oct 2020 17:10:48 +0800 Subject: [PATCH 1/2] ARROW-10388: [Java] Fix Spark integration build failure --- .../src/main/codegen/templates/ArrowType.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/java/vector/src/main/codegen/templates/ArrowType.java b/java/vector/src/main/codegen/templates/ArrowType.java index f8f0e20c940..215aa785e86 100644 --- a/java/vector/src/main/codegen/templates/ArrowType.java +++ b/java/vector/src/main/codegen/templates/ArrowType.java @@ -176,6 +176,21 @@ public static Decimal createDecimal( return new Decimal(precision, scale, bitWidth == null ? 128 : bitWidth); } + + /** + * This is kept mainly for the sake of backward compatibility. + * Please use {@link org.apache.arrow.vector.types.pojo.ArrowType.Decimal#Decimal(int, int, int)} instead. + * + * @deprecated This API will be removed in a future release. + */ + @Deprecated + public Decimal( + @JsonProperty("precision") int precision, + @JsonProperty("scale") int scale + ) { + this(precision, scale, 128); + } + <#else> @JsonCreator From 217c2a4a8a1e1f24524902a6d19410e5d91b6c8f Mon Sep 17 00:00:00 2001 From: emkornfield Date: Tue, 27 Oct 2020 20:13:12 -0700 Subject: [PATCH 2/2] Update ArrowType.java remove jsonproperty and clarify javadoc. --- java/vector/src/main/codegen/templates/ArrowType.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/java/vector/src/main/codegen/templates/ArrowType.java b/java/vector/src/main/codegen/templates/ArrowType.java index 215aa785e86..b08d4ad0afa 100644 --- a/java/vector/src/main/codegen/templates/ArrowType.java +++ b/java/vector/src/main/codegen/templates/ArrowType.java @@ -178,16 +178,15 @@ public static Decimal createDecimal( } /** + * Construct Decimal with 128 bits. + * * This is kept mainly for the sake of backward compatibility. * Please use {@link org.apache.arrow.vector.types.pojo.ArrowType.Decimal#Decimal(int, int, int)} instead. * * @deprecated This API will be removed in a future release. */ @Deprecated - public Decimal( - @JsonProperty("precision") int precision, - @JsonProperty("scale") int scale - ) { + public Decimal(int precision, int scale) { this(precision, scale, 128); }