title: How to have a SELECT query prepared in CQL using Python3?
body: <p>Like I can prepare <code>INSERT</code> query, how can I prepare <code>SELECT</code> query in CQL-Python?
  INSERT statement:</p>
  
  <pre><code>insert_sql = self.session.prepare(
              (
                  "INSERT INTO  {} ({}, {}, {}) VALUES (?,?,?)"
              ).format(
                  self.table_name, "id", "version", "row"
              )
          )
  </code></pre>
  
  <p>And execute it with:</p>
  
  <pre><code>params = (key, "version_1", row, )
                  futures.append(
                      (
                          insert_sql,
                          params
                      )
                  )
              # Checking whether the formed keys already exists
              results = execute_concurrent(
                  self.session, futures, concurrency=1000, raise_on_first_error=False
              )
  </code></pre>
  
  <p>When I do the same with <code>SELECT</code>:</p>
  
  <pre><code>select_sql = self.session.prepare(
              (
                  "SELECT * FROM {} WHERE {}=%s AND {}=%s AND {}!=%s"
              ).format(
                  self.table_name, "id", "version", "row"
              )
          )
  </code></pre>
  
  <p>And execute it with:</p>
  
  <pre><code>params = (key, "version_1", row, )
                  futures.append(
                      (
                          select_sql,
                          params
                      )
                  )
              # Checking whether the formed keys already exists
              results = execute_concurrent(
                  self.session, futures, concurrency=1000, raise_on_first_error=False
              )
  </code></pre>
  
  <p>I face an error:</p>
  
  <pre><code>cassandra.InvalidRequest: Error from server: code=2200 [Invalid query] message="Unsupported "!=" relation: row != ?"
  Traceback (most recent call last):
    File "getting_started.py", line 145, in &lt;module&gt;
      example1.insert_data()
    File "getting_started.py", line 97, in insert_data
      self.table_name, "id", "version", "row"
    File "cassandra/cluster.py", line 2405, in cassandra.cluster.Session.prepare
    File "cassandra/cluster.py", line 2402, in cassandra.cluster.Session.prepare
    File "cassandra/cluster.py", line 4062, in cassandra.cluster.ResponseFuture.result
  cassandra.InvalidRequest: Error from server: code=2200 [Invalid query] message="Unsupported "!=" relation: row != ?"
  </code></pre>
  
  <p>And after changing <code>!=</code> to <code>NOT</code> as in the code:</p>
  
  <pre><code>select_query = (
                  "SELECT * FROM {} WHERE {}=%s AND {}=%s AND NOT {}=%s"
              ).format(
                  self.table_name, "id", "version", "row"
              )
          print(select_query)
          select_sql = self.session.prepare(
              select_query
          )
          for df in chunks:
              futures = []
              df = df.to_dict(orient='records')
              chunk_counter += 1
              for row in df:
                  key = str(row["0"])
                  row = json.dumps(row, default=str)
                  params = (key, "version_1", row, )
                  futures.append(
                      (
                          select_sql,
                          params
                      )
                  )
              # Checking whether the formed keys already exists
              results = execute_concurrent(
                  self.session, futures, concurrency=1000, raise_on_first_error=False
              )
              for (success, result) in results:
                  if not success:
                      self.handle_error(result)
                  print(result)
                  sys.exit()
              results = execute_concurrent(
                  self.session, futures, concurrency=1000, raise_on_first_error=False)
              for (success, result) in results:
                  if not success:
                      self.handle_error(result)  # result will be an Exception
              if (chunk_counter % 1000 == 0):
                  self.log.info(
                      "{} 's Batch Insert Completed".format(chunk_counter))
              # print(
              #     str(chunk_counter*chunksize) + " : " +
              #     str(datetime.utcnow() - start_time)
              # )
          print("Complete task's duration is: {}".format(
              datetime.utcnow() - start_time))
  </code></pre>
  
  <p>I get this:</p>
  
  <pre><code>etting_started.py:8: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
    from cassandra.cluster import BatchStatement, Cluster
  2019-01-19 19:49:16,582 [INFO] root: setting keyspace...
  SELECT * FROM TenMillion WHERE id=%s AND version=%s AND NOT row=%s
  2019-01-19 19:49:16,590 [ERROR] cassandra.cluster: Error preparing query:
  Traceback (most recent call last):
    File "cassandra/cluster.py", line 2402, in cassandra.cluster.Session.prepare
    File "cassandra/cluster.py", line 4062, in cassandra.cluster.ResponseFuture.result
  cassandra.protocol.SyntaxException: &lt;Error from server: code=2000 [Syntax error in CQL query] message="line 1:34 no viable alternative at character '%'"&gt;
  Traceback (most recent call last):
    File "getting_started.py", line 147, in &lt;module&gt;
      example1.insert_data()
    File "getting_started.py", line 100, in insert_data
      select_query
    File "cassandra/cluster.py", line 2405, in cassandra.cluster.Session.prepare
    File "cassandra/cluster.py", line 2402, in cassandra.cluster.Session.prepare
    File "cassandra/cluster.py", line 4062, in cassandra.cluster.ResponseFuture.result
  cassandra.protocol.SyntaxException: &lt;Error from server: code=2000 [Syntax error in CQL query] message="line 1:34 no viable alternative at character '%'"&gt;
  </code></pre>