Troubleshooting
Problem
You are querying a DB2 table using Spark (com.ibm.db2.jcc.DB2Driver ) and you get an error when date fields with small dates (e.g. 01-01-0001) are present.
For example below query returns an error:
query = f"(SELECT Record, VARCHAR_FORMAT(TIMESTAMP(Date), 'YYYYMMDDHHMI') FROM (VALUES ('A', DATE('0001-01-01'))) AS TEMP(Record, Date)) AS TMP"
Py4JJavaError: An error occurred while calling o928.collectToPython.
: org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 19.0 failed 4 times, most recent failure: Lost task 0.3 in stage 19.0 (TID 71, 9.242.48.115, executor 1): com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-206, SQLSTATE=42703, SQLERRMC=2, DRIVER=4.22.29
Resolving The Problem
Document Location
Worldwide
Was this topic helpful?
Document Information
More support for:
IBM Watson Studio Local
Component:
Modeling->Dataset
Software version:
All Version(s)
Document number:
6380736
Modified date:
10 December 2020
UID
ibm16380736