0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 set -o pipefail
0025 set -e
0026
0027 FWDIR="$(cd "`dirname "${BASH_SOURCE[0]}"`"; pwd)"
0028 SPARK_HOME="$(cd "`dirname "${BASH_SOURCE[0]}"`"/..; pwd)"
0029
0030 if ! hash python 2>/dev/null; then
0031 echo "Missing python in your path, skipping SQL documentation generation."
0032 exit 0
0033 fi
0034
0035 if ! hash mkdocs 2>/dev/null; then
0036 echo "Missing mkdocs in your path, trying to install mkdocs for SQL documentation generation."
0037 pip install mkdocs
0038 fi
0039
0040 pushd "$FWDIR" > /dev/null
0041
0042 rm -fr docs
0043 mkdir docs
0044
0045 echo "Generating SQL API Markdown files."
0046 "$SPARK_HOME/bin/spark-submit" gen-sql-api-docs.py
0047
0048 echo "Generating SQL configuration table HTML file."
0049 "$SPARK_HOME/bin/spark-submit" gen-sql-config-docs.py
0050
0051 echo "Generating HTML files for SQL function table and examples."
0052 "$SPARK_HOME/bin/spark-submit" gen-sql-functions-docs.py
0053
0054 echo "Generating HTML files for SQL API documentation."
0055 mkdocs build --clean
0056 rm -fr docs
0057
0058 popd