If so, 
```
if [ ! -z $DRIVER_MEMORY ] && [ ! -z $DEPLOY_MODE ] && [ $DEPLOY_MODE = "client" ]; then
  export SPARK_MEM=$DRIVER_MEMORY
fi
```  is not correct