title: spark-submit : pass runtime variable to spark script
body: <p>I am submiting Pyspark/SparkSQL script using spark-submit option and I need to pass runtime variables (database name) to script</p>
  
  <p><strong>spark-submit command:</strong></p>
  
  <pre><code>spark-submit --conf database_parameter=my_database my_pyspark_script.py
  </code></pre>
  
  <p><strong>pyspark script</strong></p>
  
  <pre><code>database_parameter = SparkContext.getConf().get("database_parameter")           
  
  DF = sqlContext.sql("SELECT count(*) FROM database_parameter.table_name")
  </code></pre>
  
  <p>spark version is: 1.5.2<br>
  Python version is: 2.7.5      </p>
  
  <p>The solution I am trying is not working.  Error is : AttributeError: type object 'SparkConf' has no attribute 'getConf'.</p>
  
  <p>I am looking for a way to pass runtime variable while calling the script through spark-submit and use those variables in script.</p>