Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-26651 Use Proleptic Gregorian calendar
  3. SPARK-26384

CSV schema inferring does not respect spark.sql.legacy.timeParser.enabled

    XMLWordPrintableJSON

    Details

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

      Description

      Starting from the commit https://github.com/apache/spark/commit/f982ca07e80074bdc1e3b742c5e21cf368e4ede2 , add logging like in the comment https://github.com/apache/spark/pull/23150#discussion_r242021998 and run:

      Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      $ ./bin/spark-shell --conf spark.sql.legacy.timeParser.enabled=true
      

      and in the shell:

      scala> spark.conf.get("spark.sql.legacy.timeParser.enabled")
      res0: String = true
      
      scala> Seq("2010|10|10").toDF.repartition(1).write.mode("overwrite").text("/tmp/foo")
      
      scala> spark.read.option("inferSchema", "true").option("header", "false").option("timestampFormat", "yyyy|MM|dd").csv("/tmp/foo").printSchema()
      18/12/17 12:11:47 ERROR TimestampFormatter: Iso8601TimestampFormatter is being used
      root
       |-- _c0: timestamp (nullable = true)
      

        Attachments

          Issue Links

            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: