Используя JDB C, прочитайте данные SAS из pyspark, но получите данные, заполненные именем столбца - PullRequest
0 голосов
/ 17 января 2020

Я пытаюсь использовать pyspark jdb c для чтения данных с сервера SAS, но

  1. не может прочитать числовые данные или возвращает сообщение об ошибке:
org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 3.0 failed 4 times, most recent failure: Lost task 0.3 in stage 3.0 (TID 6, qcr-hadoop-d149.oss.ads, executor 4): java.sql.SQLException: Sharenet.S146.ex.txt: Number format exception. For input string: "num_col_demo"
При чтении символьных данных возвращается фрейм данных, заполненный именами столбцов, как показано ниже.
ja = spark.read.jdbc("jdbc:sharenet://serverxxxx:port?librefs=MyLib '/path/xxxx'"
                        ,'''(
                        select 
                            cust_id
                            , "test" as aa
                            , credit_risk_code
                        from 
                            MyLib.demo_table(obs=10)
                            ) t'''
                        , properties={"driver":"com.sas.net.sharenet.ShareNetDriver"}
                        )
ja.show(10, False)

Результаты:

+-------+---+----------------+
|cust_id|   |credit_risk_code|
+-------+---+----------------+
|cust_id|   |credit_risk_code|
|cust_id|   |credit_risk_code|
|cust_id|   |credit_risk_code|
|cust_id|   |credit_risk_code|
|cust_id|   |credit_risk_code|
|cust_id|   |credit_risk_code|
|cust_id|   |credit_risk_code|
|cust_id|   |credit_risk_code|
|cust_id|   |credit_risk_code|
|cust_id|   |credit_risk_code|
+-------+---+----------------+

Есть предложения? Это известный дефект искры или SAS? Или мне нужны дополнительные настройки в свойствах соединения?

Спасибо!

...