[英]azure synapse spark sql pool unable to create database
I have created my spark pool in azure synapse, but when i try creating my database using the below code its giving me error- any help in what am doing wrong:我已经在 azure synapse 中创建了我的火花池,但是当我尝试使用下面的代码创建我的数据库时,它给了我错误 - 任何关于做错的帮助:
spark.sql("CREATE DATABASE nyctaxi_ksa7")
df.write.mode("overwrite").saveAsTable("nyctaxi.trip")
AnalysisException Traceback (most recent call last)
/tmp/ipykernel_6859/2561526676.py in <module>
----> 1 spark.sql("CREATE DATABASE nyctaxi_ksa7")
2 df.write.mode("overwrite").saveAsTable("nyctaxi.trip")
/opt/spark/python/lib/pyspark.zip/pyspark/sql/session.py in sql(self, sqlQuery)
721 [Row(f1=1, f2='row1'), Row(f1=2, f2='row2'), Row(f1=3, f2='row3')]
722 """
--> 723 return DataFrame(self._jsparkSession.sql(sqlQuery), self._wrapped)
724
725 def table(self, tableName):
~/cluster-env/env/lib/python3.8/site-packages/py4j/java_gateway.py in __call__(self, *args)
1302
1303 answer = self.gateway_client.send_command(command)
-> 1304 return_value = get_return_value(
1305 answer, self.gateway_client, self.target_id, self.name)
1306
/opt/spark/python/lib/pyspark.zip/pyspark/sql/utils.py in deco(*a, **kw)
115 # Hide where the exception came from that shows a non-Pythonic
116 # JVM exception message.
--> 117 raise converted from None
118 else:
119 raise
AnalysisException: org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.NullPointerException
This error is sometimes seen if there is an issue with the workspace.如果工作区存在问题,有时会出现此错误。 You can try creating a new workspace.
您可以尝试创建一个新的工作区。 If the error persists, you can raise a support ticket for the support engineers to investigate more on the issue.
如果错误仍然存在,您可以向支持工程师提出支持票,以对问题进行更多调查。
I have repro'd and created the database in the synapse spark pool without errors.我已经在突触火花池中复制并创建了数据库,没有错误。
spark.sql("CREATE DATABASE sampledb1")
df.write.mode("overwrite").saveAsTable("sampledb1.tb1")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.