title: How to execute select query on oracle database using pi spark?
body: <p>I have written a program using pyspark to connect to oracle database and fetch data. Below command works fine and returns the contents of the table:</p>
  
  <pre><code>sqlContext.read.format("jdbc")
      .option("url","jdbc:oracle:thin:user/password@dbserver:port/dbname")
      .option("dbtable","SCHEMA.TABLE")
      .option("driver","oracle.jdbc.driver.OracleDriver")
      .load().show()
  </code></pre>
  
  <p>Now I do not want to load the entire table data. I want to load selected records. Can I specify select query as part of this command? If yes how?</p>
  
  <p>Note: I can use dataframe and execute select query on the top of it but I do not want to do it. Please help!!</p>