Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18411#discussion_r124447131
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/jdbc/OracleDialect.scala ---
    @@ -68,5 +69,13 @@ private case object OracleDialect extends JdbcDialect {
         case _ => None
       }
     
    +  override def beforeFetch(connection: Connection, properties: Map[String, 
String]): Unit = {
    +    // Set general date and timestamp format before query.
    +    val stmt = connection.createStatement()
    +    stmt.execute("alter session set NLS_DATE_FORMAT = 'YYYY-MM-DD'")
    +    stmt.execute("alter session set NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD 
HH24:MI:SS.FF'")
    --- End diff --
    
    To avoid this issue, we should change the way we generate the where clause. 
That is why I proposed to make `compileValue` Dialect specific. It sounds like 
there are two approaches to convert the timestamp string to Oracle-recognized 
timestamp string in the where clause 
    
    - `INSERT INTO datetime VALUES (1, {d '1991-11-09'}, {ts '1996-01-01 
01:23:45'}`
    - call `to_timestamp_tz`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to