title: pyspark 2.2 'DataFrame' object has no attribute 'map' , backward compatibility is missing how to solve it
body: <p>When I am working with Spark 1.6  below code is working fine:</p>
  
  
  
  <pre class="lang-python prettyprint-override"><code>ddl = sqlContext.sql("""show create table {mytable }""".format(mytable="""mytest.my_dummytable"""))
  map(''.join, ddl\
  .map(lambda my_row: [str(data).replace("`", "'") for data in my_row])\
  .collect())
  </code></pre>
  
  <p>However, when I moved to spark 2.2 I got the following exception:</p>
  
  <pre class="lang-python prettyprint-override"><code>---------------------------------------------------------------------------
  
  AttributeError                            Traceback (most recent call last)
  &lt;ipython-&gt; in &lt;module&gt;()
        1 ddl = sqlContext.sql("""show create table {mytable }""".format(mytable ="""mytest.my_dummytable"""))
  ----&gt; 2 map(''.join, ddl..map(lambda my_row: [str(data).replace("`", "'") for data in my_row]).collect())
  
  spark2/python/pyspark/sql/dataframe.py in __getattr__(self, name)
              if name not in self.columns:
                  raise AttributeError(
  -&gt;                  "'%s' object has no attribute '%s'" % (self.__class__.__name__, name))
              jc = self._jdf.apply(name)
              return Column(jc)
  
  AttributeError: 'DataFrame' object has no attribute 'map'
  </code></pre>