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

Avro should read decimal values with the file schema

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment