Created
June 23, 2015 19:34
-
-
Save Leemoonsoo/d3b255c0d3f66cb934d5 to your computer and use it in GitHub Desktop.
Read spark default in Apache Zeppelin. place this scripts inside of your conf/zeppelin-env.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function readSparkConf() { | |
SPARK_CONF_PATH="${1}" | |
echo "Reading ${SPARK_CONF_PATH}" | |
while read line; do | |
echo "${line}" | grep -e "^spark[.]" > /dev/null | |
if [ $? -ne 0 ]; then | |
# skip the line not started with 'spark.' | |
continue; | |
fi | |
SPARK_CONF_KEY=`echo "${line}" | sed -e 's/\(^spark[^ ]*\)[ \t]*\(.*\)/\1/g'` | |
SPARK_CONF_VALUE=`echo "${line}" | sed -e 's/\(^spark[^ ]*\)[ \t]*\(.*\)/\2/g'` | |
export ZEPPELIN_JAVA_OPTS+=" -D${SPARK_CONF_KEY}=\"${SPARK_CONF_VALUE}\"" | |
done < ${SPARK_CONF_PATH} | |
} | |
readSparkConf /your/apth/to/spark |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment