cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

ORA-01830: date format picture ends before converting entire input string

Kaviprakash
New Contributor

Hi,

Recently we are migrating our hive metastore workloads to unity catalog. As part of which, se are running into an following error with 15.4 DBR (UC) version where as it's working with 10.4 DBR (Hive). The requirement is to read the data from a table in oracle on premise and write to the external delta table.

Please note that there is a DATE column in the oracle table which is populated with Datetime values. 

ORA-01830: date format picture ends before converting entire input string

spark query:

 df= spark.read.format("jdbc")\
                             .option("driver", jdbc_driver)\
                             .option("url", jdbc_url)\
                             .option("dbtable", sql)\
                             .option("user", oracle_user)\
                             .option("password", oracle_pwd)\
                             .option("lowerBound", minValue)\
                             .option("upperBound", maxValue)\
                             .option("numPartitions", number_of_partitions)\
                             .option("partitionColumn", read_partition_column)\
                             .option("fetchSize", fetch_size)\
                             .option("oracle.net.encryption_client", "REQUIRED")\
                             .option("oracle.net.crypto_checksum_client", "REQUIRED")\
                             .option("oracle.jdbc.timezoneAsRegion", False)\
                             .option("oracle.jdbc.mapDateToTimestamp", True)\
                             .option("sessionInitStatement", "ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS'")\
                             .load()
1 REPLY 1

VZLA
Databricks Employee
Databricks Employee

@Kaviprakash thanks for your question!

Is this also probably specific to a cluster type ? Shared vs Single user?

If Shared Mode, can you please try restarting your cluster with the following Spark Configuration:
spark.connect.perserveOptionCasing true

 

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group