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

Avro should read decimal values with the file schema

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 2.4.7, 3.0.1, 3.1.1, 3.2.0
    • 2.4.8, 3.0.2, 3.1.1
    • SQL

    Description

      scala> sql("SELECT 3.14 a").write.format("avro").save("/tmp/avro")
      scala> spark.read.schema("a DECIMAL(4, 3)").format("avro").load("/tmp/avro").show
      +-----+
      |    a|
      +-----+
      |0.314|
      +-----+ 

      Attachments

        Activity

          People

            dongjoon Dongjoon Hyun
            dongjoon Dongjoon Hyun
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: