Using spark with hive at Windows
- Download the 64-bit winutils.exe (106KB)
- Copy the downloaded file winutils.exe into a folder like C:\hadoop\bin (or C:\spark\hadoop\bin)
- Set the environment variable HADOOP_HOME to point to the above directory but without \bin. For example:
- if you copied the winutils.exe to C:\hadoop\bin, set HADOOP_HOME=C:\hadoop
- if you copied the winutils.exe to C:\spark\hadoop\bin, set HADOOP_HOME=C:\spark\hadoop
- Double-check that the environment variable HADOOP_HOME is set properly by opening the Command Prompt and running echo %HADOOP_HOME%
- Change the write permission of '\tmp\hive'
- %HADOOP_HOME%\bin\winutils.exe chmod 777 \tmp\hive
- NOTE: use 'cd' command to change the driver where you run the spark app
- For spark 2, if you see an error like "Relative path in absolute URI: file:E:/eclipse-neon/workspace/Test/spark-warehouse", then set the config like below
- SparkSession.buider().config("spark.sql.warehouse.dir", "E:/eclipse-neon/workspace/Test/spark-warehouse")
- Reference
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.