2016-09-15 56 views
0

我在Bluemix中的Spark服務中使用pySpark來轉換我的數據中的某些內容,然後將它寫入DashDB中,也是在Bluemix中。但是當我嘗試加載數據時,我收到以下錯誤:bluemix pyspark在調用jdbc時發生錯誤

Py4JJavaError:調用o111.jdbc時發生錯誤。 :org.apache.spark.SparkException:由於階段失敗導致作業中止:階段4.0中的任務0失敗10次,最近失敗:階段4.0中丟失的任務0.9(TID 23,yp-spark-dal09-env5-0045) :com.ibm.db2.jcc.am.BatchUpdateException:[jcc] [t4] [102] [10040] [4.19.26]批量失敗。該批次已提交,但該批次的單個成員中至少發生一次異常。 使用getNextException()檢索特定批處理元素的異常。 ERRORCODE = -4229,SQLSTATE = null

我已經嘗試創建一個新的DashDB,但收到相同的錯誤。然後,我試圖創建另一個筆記本,但它也不起作用。我試圖停止所有內核,並且每次只運行一個內核,都不起作用。

我試圖從數據框中寫入數據的所有筆記本都收到相同的錯誤,但在相同的情況下,數據已加載,而其他數據不是。

這是我用來寫代碼:

for num in range(0,22): 
(shared_df_first 
    .select(
     Func.col('Customer').alias("CUSTOMER"), 
     Func.col('Customer Environment').alias("CUST_ENV"), 
     Func.col('Device').alias("DEVICE"), 
     Func.col('User ID').alias("USER_ID"), 
     Func.col('Date').alias("DATE"), 
     Func.col('Time').alias("TIME"), 
     Func.col('Requester').alias("REQUESTER"), 
     Func.col('Manager').alias("MANAGER"), 
     Func.col('Manager Mail').alias("MANAGER_MAIL"), 
     Func.col('Ticket').alias("TICKET"), 
     Func.col('Request').alias("REQUEST"), 
     Func.col('Teste').alias("TESTE"), 
     Func.col('Approver USERID').alias("APPROVER_USERID"), 
     Func.col('Approver Name').alias("APPROVER_NAME"), 
     Func.col('Period in hours').alias("PERIOD"), 
     Func.col('Business Need').alias("BUSINESS_NEED"), 
     Func.col('Password Periodic Changable').alias("PASSWORD_PERIODIC_CHANGABLE"), 
     Func.col('Is Pre Approved?').alias("IS_PRE_APPROVED"), 
     Func.col('Has Personal User ID?').alias("HAS_PERSONAL_USER_ID"), 
     Func.col('Check in way').alias("CHECK_IN_WAY"), 
     Func.col('SLA').alias("SLA"), 
     Func.col('Invalid Business Need').alias("BUSINESS_NEED_INVALID") 
    ) 
    .write 
    .jdbc("jdbc:db2://bluemix05.bluforcloud.com:50000/BLUDB", "DASH014638.WATSON_UAT_DEV", "append", propertiesDBDash 
) 
print num + 1 



df = ds_clean.toDF(["account_id","customer","device_name","device_os","user_id","user_id_type","creation_date","last_logon","password_is_never_expires","responsible", 
       "privileges","user_id_status"]) 
propertiesDBDash = { 
       "user":"dash014638", 
       "password":"pwd"} 
df.write.mode("append").jdbc("jdbc:db2://bluemix05.bluforcloud.com:50000/BLUDB", "DASH014638.DORMANT_PROD",properties=propertiesDBDash) 

df = ds_clean.toDF(["REQUEST_NUMBER","TYPE_TICKET","SOLUTIONER","CUSTOMER","DELIVERY","OPEN_DATE","OPEN_TIME","CLOSE_DATE","CLOSE_TIME","SERVICE","DEVICE","PLATFORM","REQUESTER","REQUESTER_MANAGER_MAIL","SLA","ELAPSED_TIME","SLA_STATUS","URGENCY","ACTION","REQUEST_STATUS"]) 

propertiesDBDash = { 
       "user":"dash014638", 
       "password":"pwd"} 
df.write.mode("append").jdbc("jdbc:db2://bluemix05.bluforcloud.com:50000/BLUDB", "DASH014638.WATSON_REQUEST_NEW",properties=propertiesDBDash) 

回答

0

它看起來像Bluemix不顯示被檢索dashDB所有錯誤。所以這裏真正的問題是因爲我試圖插入比在dashDB中指定的數據字段更大的數據。

相關問題