title: How to create index in Spark Table?
body: <p>I know Spark Sql is almost same as Hive.</p>
  
  <p>Now I have created a table and when I am doing Spark sql query to create the table index, it always gives me this error:</p>
  
  <blockquote>
    <p>Error in SQL statement: AnalysisException: mismatched input '' expecting AS near ')' in create index statement</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/OITq5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OITq5.png" alt="test table"></a></p>
  
  <p>The Spark sql query I am using is:</p>
  
  <pre><code>CREATE INDEX word_idx ON TABLE t (id)
  </code></pre>
  
  <p>The data type of id is bigint.
  Before this, I have also tried to create table index on "word" column of this table, it gave me the same error.</p>
  
  <p>So, is there anyway to create index through Spark sql query?</p>