title: Reading from DB2 tables with columns with names having special characters into Spark
body: <p>I need to read data from a DB2 table into a spark dataframe.
  However, the DB2 table named 'TAB#15' has 2 columns with special characters with names such as MYCRED# and MYCRED$.</p>
  <p>My pyspark code looks like this:</p>
  <pre><code>query = '''select count(1) as cnt from {table} as T'''.format(table=table)
  my_val = spark.read.jdbc(url, table=query, properties).collect()
  </code></pre>
  <p>My spark-submit however, throws an error that looks like this:
  &quot;ERROR: u&quot;\nextraneous input '#' expecting... &quot;</p>
  <p>My questions/ ask is:</p>
  <ol>
  <li>Is it possible to read data into a Spark dataframe, from a DB2 table whose table name and column names have special characters like '#' and '$'?</li>
  <li>If there are any code samples/ similar questions to this one, that can illustrate the above requirement of reading DB2 table data from columns that have special characters in their column names, please point me out to them..</li>
  </ol>