Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-41007

BigInteger Serialization doesn't work with JavaBean Encoder

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.3.1
    • 3.4.0
    • Java API
    • None

    Description

      When creating a dataset using the Java Bean Encoder with a bean that contains a field which is a java.math.BigInteger the dataset will fail to serialize correctly. When trying to serialize the dataset, Spark throws the following error:

       

      Exception in thread "main" org.apache.spark.sql.AnalysisException: Cannot up cast `bigInteger` from struct<> to decimal(38,18).
       

       

      Reproduction steps:

      Using the Java Dataset API:

      1. Create a Bean with a  java.math.BigInteger field
      2. Pass said Bean into the Java SparkSession createDataset function

       

      Attachments

        Activity

          People

            dfit99 Daniel Fiterma
            dfit99 Daniel Fiterma
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: