title: DESCRIBE with LIMIT in spark sql
body: <p>I am using the <code>DESCRIBE</code> keyword to get column information about a temp view. It's a useful method however I have a table for which I'd only like to describe a subset of the columns. I'm trying to use <code>LIMIT</code> in conjunction with <code>DESCRIBE</code> to achieve this but can not figure it out.</p>
  
  <p>Here is a toy dataset (created with pyspark):</p>
  
  <pre><code># make some test data
  columns = ['id', 'dogs', 'cats', 'horses', 'people']
  vals = [
       (1, 2, 0, 4, 3),
       (2, 0, 1, 2, 4)
  ]
  
  # create DataFrame
  df = spark.createDataFrame(vals, columns)
  df.createOrReplaceTempView('df')
  </code></pre>
  
  <p>And now describe with sql:</p>
  
  <pre><code>%%sql
  
  DESCRIBE df
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>col_name    data_type
  id          bigint
  dogs        bigint
  cats        bigint
  horses      bigint
  people      bigint
  </code></pre>
  
  <p>In reality I have many more columns than this and what I'd like to do is <code>LIMIT</code> the output of this query. Here are a couple of things I've tried:</p>
  
  <p>Attempt #1:</p>
  
  <pre><code>DESCRIBE df
  LIMIT 3
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>An error was encountered:
  "\nextraneous input '3' expecting {&lt;EOF&gt;, '.'}(line 3, pos 6)\n\n== SQL ==\n\nDESCRIBE df\nLIMIT 3 \n------^^^\n"
  Traceback (most recent call last):
    File "/usr/lib/spark/python/lib/pyspark.zip/pyspark/sql/session.py", line 603, in sql
      return DataFrame(self._jsparkSession.sql(sqlQuery), self._wrapped)
    File "/usr/lib/spark/python/lib/py4j-0.10.4-src.zip/py4j/java_gateway.py", line 1133, in __call__
      answer, self.gateway_client, self.target_id, self.name)
    File "/usr/lib/spark/python/lib/pyspark.zip/pyspark/sql/utils.py", line 73, in deco
      raise ParseException(s.split(': ', 1)[1], stackTrace)
  pyspark.sql.utils.ParseException: "\nextraneous input '3' expecting {&lt;EOF&gt;, '.'}(line 3, pos 6)\n\n== SQL ==\n\nDESCRIBE df\nLIMIT 3 \n------^^^\n"
  </code></pre>
  
  <p>Attempt #2:</p>
  
  <pre><code>SELECT a.*
  FROM (
      DESCRIBE df
  ) AS a
  LIMIT 3
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>An error was encountered:
  'Table or view not found: DESCRIBE; line 4 pos 4'
  Traceback (most recent call last):
    File "/usr/lib/spark/python/lib/pyspark.zip/pyspark/sql/session.py", line 603, in sql
      return DataFrame(self._jsparkSession.sql(sqlQuery), self._wrapped)
    File "/usr/lib/spark/python/lib/py4j-0.10.4-src.zip/py4j/java_gateway.py", line 1133, in __call__
      answer, self.gateway_client, self.target_id, self.name)
    File "/usr/lib/spark/python/lib/pyspark.zip/pyspark/sql/utils.py", line 69, in deco
      raise AnalysisException(s.split(': ', 1)[1], stackTrace)
  pyspark.sql.utils.AnalysisException: 'Table or view not found: DESCRIBE; line 4 pos 4'
  </code></pre>
  
  <p>Does anyone know if it's possible to limit the output of describe?</p>