XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0, 3.1.0
    • Fix Version/s: 3.0.0
    • Component/s: SQL
    • Labels:
      None

      Description

      Spark 2.4.5:

      scala> val ds = Seq("{'d': '-141704'}").toDS
      ds: org.apache.spark.sql.Dataset[String] = [value: string]
      
      scala> val json = spark.read.schema("d date").json(ds)
      json: org.apache.spark.sql.DataFrame = [d: date]
      
      scala> json.show
      +----------+
      |         d|
      +----------+
      |1582-01-01|
      +----------+
      

      Spark 3.1.0-SNAPSHOT:

      scala> val ds = Seq("{'d': '-141704'}").toDS
      ds: org.apache.spark.sql.Dataset[String] = [value: string]
      
      scala> val json = spark.read.schema("d date").json(ds)
      json: org.apache.spark.sql.DataFrame = [d: date]
      
      scala> json.show
      +----------+
      |         d|
      +----------+
      |1582-01-11|
      +----------+
      

        Attachments

          Activity

            People

            • Assignee:
              maxgekk Maxim Gekk
              Reporter:
              maxgekk Maxim Gekk
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: