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

Thriftserver with spark.sql.datetime.java8API.enabled=true

    XMLWordPrintableJSON

    Details

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

      Description

        test("spark.sql.datetime.java8API.enabled=true") {
          withJdbcStatement() { st =>
            st.execute("set spark.sql.datetime.java8API.enabled=true")
            val rs = st.executeQuery("select timestamp '2020-05-28 00:00:00'")
            rs.next()
            // scalastyle:off
            println(rs.getObject(1))
          }
        }
      

      fails with

      HiveThriftBinaryServerSuite:
      java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff]
              at java.sql.Timestamp.valueOf(Timestamp.java:204)
              at org.apache.hive.jdbc.HiveBaseResultSet.evaluate(HiveBaseResultSet.java:444)
              at org.apache.hive.jdbc.HiveBaseResultSet.getColumnValue(HiveBaseResultSet.java:424)
              at org.apache.hive.jdbc.HiveBaseResultSet.getObject(HiveBaseResultSet.java:464
      

      It seems it might be needed in HiveResult.toHiveString?
      cc Max Gekk

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                juliuszsompolski Juliusz Sompolski
                Reporter:
                juliuszsompolski Juliusz Sompolski
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: