CODAIT / spark-netezza

Netezza Connector for Apache Spark
Apache License 2.0
13 stars 7 forks source link

ERROR CREATE EXTERNAL TABLE:permission denied. #16

Open sirgarfieldc opened 6 years ago

sirgarfieldc commented 6 years ago

Hello, I am able to connecting to Netezza following the setup example df.printSchema() returns the expected schema. However, when I try to query data using df.head() or df.show()

I am getting Caused by: java.lang.RuntimeException: Error creating external table pipe:org.ne tezza.error.NzSQLException: ERROR: CREATE EXTERNAL TABLE: permission denied.

I have tried using pyspark and spark-shell. The error persist in both case

Any suggestion would be appreciated

Detailed error msg

        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: Error creating external table pipe:org.ne
tezza.error.NzSQLException: ERROR:  CREATE EXTERNAL TABLE: permission denied.

        at com.ibm.spark.netezza.NetezzaDataReader.getNextLine(NetezzaDataReader
.scala:149)
        at com.ibm.spark.netezza.NetezzaDataReader.hasNext(NetezzaDataReader.sca
la:124)
        at com.ibm.spark.netezza.NetezzaRDD$$anon$1.getNext(NetezzaRDD.scala:76)
        at com.ibm.spark.netezza.NetezzaRDD$$anon$1.hasNext(NetezzaRDD.scala:106
)
        at scala.collection.Iterator$$anon$11.hasNext(Iterator.scala:408)
        at org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIte
rator.processNext(Unknown Source)
        at org.apache.spark.sql.execution.BufferedRowIterator.hasNext(BufferedRo
wIterator.java:43)
        at org.apache.spark.sql.execution.WholeStageCodegenExec$$anonfun$8$$anon
$1.hasNext(WholeStageCodegenExec.scala:395)
zbstof commented 5 years ago

We've got this error when user used to connect to netezza was lacking permissions to create netezza's external tables (https://www.ibm.com/support/knowledgecenter/en/SSULQD_7.2.1/com.ibm.nz.load.doc/c_load_external_tables.html) I think you will need to grant this permission to your netezza user or look into using some other netezza-spark connector.