Skip to content

Commit

Permalink
[SPARK-48604][SQL] Replace deprecated `new ArrowType.Decimal(precisio…
Browse files Browse the repository at this point in the history
…n, scale)` method call

### What changes were proposed in this pull request?

This pr replaces deprecated classes and methods of `arrow-vector` called in Spark:

- `Decimal(int precision, int scale)` -> `Decimal(
      JsonProperty("precision") int precision,
      JsonProperty("scale") int scale,
      JsonProperty("bitWidth") int bitWidth
    )`

All `arrow-vector` related Spark classes, I made a double check, only in `ArrowUtils` there is a deprecated  method call.
### Why are the changes needed?

Clean up deprecated API usage.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Passed GA.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #46961 from wayneguow/deprecated_arrow.

Authored-by: Wei Guo <guow93@gmail.com>
Signed-off-by: yangjie01 <yangjie01@baidu.com>
  • Loading branch information
wayneguow authored and LuciferYang committed Jun 13, 2024
1 parent bdcb79f commit 08e741b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private[sql] object ArrowUtils {
case BinaryType if !largeVarTypes => ArrowType.Binary.INSTANCE
case _: StringType if largeVarTypes => ArrowType.LargeUtf8.INSTANCE
case BinaryType if largeVarTypes => ArrowType.LargeBinary.INSTANCE
case DecimalType.Fixed(precision, scale) => new ArrowType.Decimal(precision, scale)
case DecimalType.Fixed(precision, scale) => new ArrowType.Decimal(precision, scale, 8 * 16)
case DateType => new ArrowType.Date(DateUnit.DAY)
case TimestampType if timeZoneId == null =>
throw SparkException.internalError("Missing timezoneId where it is mandatory.")
Expand Down

0 comments on commit 08e741b

Please sign in to comment.