Py4JJavaError: An error occurred while calling o18.sql. : java.lang.RuntimeException:
来源:互联网 发布:linux图形化界面命令 编辑:程序博客网 时间:2024/04/30 20:52
from pyspark import SparkContextfrom pyspark import HiveContext,SQLContextif __name__ == "__main__": sc = SparkContext(appName = "test") sqlContext = HiveContext(sc) print "**************" table_df = sqlContext.sql("select * from test") print "&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&" table_df.cache() print table_df.count() sc.stop() print "*******end***************************************"
spark单独运行正常运行,用到HiveSpark报如下错误:
Traceback (most recent call last):
File "/home/sky/spark/bin/workspace/demo.py", line 9, in <module>
table_df = sqlContext.sql("select * from test")
File "/home/sky/spark/python/pyspark/sql/context.py", line 488, in sql
return DataFrame(self._ssql_ctx.sql(sqlQuery), self)
File "/home/sky/spark/python/lib/py4j-0.8.2.1-src.zip/py4j/java_gateway.py", line 538, in __call__
File "/home/sky/spark/python/lib/py4j-0.8.2.1-src.zip/py4j/protocol.py", line 300, in get_return_value
py4j.protocol.Py4JJavaError: An error occurred while calling o18.sql.
: java.lang.RuntimeException: java.io.IOException: Permission denied
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:330)
at org.apache.spark.sql.hive.HiveContext.sessionState$lzycompute(HiveContext.scala:239)
at org.apache.spark.sql.hive.HiveContext.sessionState(HiveContext.scala:235)
at org.apache.spark.sql.hive.HiveContext.hiveconf$lzycompute(HiveContext.scala:251)
at org.apache.spark.sql.hive.HiveContext.hiveconf(HiveContext.scala:250)
at org.apache.spark.sql.hive.HiveContext.sql(HiveContext.scala:95)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:231)
at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:379)
at py4j.Gateway.invoke(Gateway.java:259)
at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:133)
at py4j.commands.CallCommand.execute(CallCommand.java:79)
at py4j.GatewayConnection.run(GatewayConnection.java:207)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Permission denied
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.createTempFile(File.java:2024)
at org.apache.hadoop.hive.ql.session.SessionState.createTempFile(SessionState.java:432)
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:328)
... 16 more
File "/home/sky/spark/bin/workspace/demo.py", line 9, in <module>
table_df = sqlContext.sql("select * from test")
File "/home/sky/spark/python/pyspark/sql/context.py", line 488, in sql
return DataFrame(self._ssql_ctx.sql(sqlQuery), self)
File "/home/sky/spark/python/lib/py4j-0.8.2.1-src.zip/py4j/java_gateway.py", line 538, in __call__
File "/home/sky/spark/python/lib/py4j-0.8.2.1-src.zip/py4j/protocol.py", line 300, in get_return_value
py4j.protocol.Py4JJavaError: An error occurred while calling o18.sql.
: java.lang.RuntimeException: java.io.IOException: Permission denied
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:330)
at org.apache.spark.sql.hive.HiveContext.sessionState$lzycompute(HiveContext.scala:239)
at org.apache.spark.sql.hive.HiveContext.sessionState(HiveContext.scala:235)
at org.apache.spark.sql.hive.HiveContext.hiveconf$lzycompute(HiveContext.scala:251)
at org.apache.spark.sql.hive.HiveContext.hiveconf(HiveContext.scala:250)
at org.apache.spark.sql.hive.HiveContext.sql(HiveContext.scala:95)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:231)
at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:379)
at py4j.Gateway.invoke(Gateway.java:259)
at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:133)
at py4j.commands.CallCommand.execute(CallCommand.java:79)
at py4j.GatewayConnection.run(GatewayConnection.java:207)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Permission denied
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.createTempFile(File.java:2024)
at org.apache.hadoop.hive.ql.session.SessionState.createTempFile(SessionState.java:432)
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:328)
... 16 more
1 0
- Py4JJavaError: An error occurred while calling o18.sql. : java.lang.RuntimeException:
- 错误:java.lang.RuntimeException: An error occured while executing doInBackground();
- An error occurred while completing process -java.lang.reflect.InvocationTargetException
- an error occurred while completing process -java.lang.reflect.InvocationTargetException
- java.lang.RuntimeException: An error occured while executing doInBackground()错误分析
- Axis2 错误:An error occurred while completing process -java.lang.reflect.InvocationTargetException
- Axis2 错误:An error occurred while completing process -java.lang.reflect.InvocationTargetException
- Axis2 错误:An error occurred while completing process -java.lang.reflect.InvocationTargetException
- 使用Axis2报"An error occurred while completing process -java.lang.reflect.InvocationTargetException"处理
- 解决An error occurred while completing process -java.lang.reflect.InvocationTarget
- 使用Axis2报"An error occurred while completing process -java.lang.reflect.InvocationTargetException"处理
- An error has occurred while drawing:java.lang.IllegalStateException: The display list is not valid.
- Eclipse使用axis2生成客户端调用时最后一步出现an error occurred while completing process -java.lang.reflect.InvocationTargetException
- MyEclipse 安装(或解压)后运行报“An error has occurred. See the log file”;在日志文件报错:java.lang.RuntimeException
- An internal error occurred during: "Launching *** "java.lang.NullPointerException
- An internal error occurred during: "Launching atphone". java.lang.NullPointerException
- An internal error occurred during: "Launching hello". java.lang.NullPointerException
- An internal error has occurred. java.lang.NullPointerException
- android学习路线:如何成长为高级工程师
- 【codevs1282】约瑟夫问题,卡数据ing?
- org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document fro
- LoadRunner自带实例安装问题could not open ftp port21-port is already used by another server
- 浅谈MDK环境下使用#include <stdio.h>的问题
- Py4JJavaError: An error occurred while calling o18.sql. : java.lang.RuntimeException:
- 《算法导论》读书笔记之最大子数组问题
- 面试中关于栈和队列的一些面试题,精选
- bat批处理luajit编译lua源代码
- HDU 1561 树形dp+背包
- 九度OJ 1112:拦截导弹 (DP、最长下降子序列)
- jquery-dataTables的使用
- java视频笔记目录
- 二维数组的介绍、遍历以及长度的计算