<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: impala table creation with select command in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/57854#M14321</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/16544"&gt;@csguna&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sir, i have tried as you suggested me then also its giving below errors,&lt;/P&gt;&lt;PRE&gt;[localhost.localdomain:21000] &amp;gt; CREATE TABLE maxminonly2013 STORED AS RCFILE LOCATION '/user/hive/warehouse/d2013.db/' AS SELECT _c1,_c2  FROM maxmin2013;
Query: create TABLE maxminonly2013 STORED AS RCFILE LOCATION '/user/hive/warehouse/d2013.db/' AS SELECT _c1,_c2  FROM maxmin2013
ERROR: AnalysisException: Syntax error at:
create TABLE maxminonly2013 STORED AS RCFILE LOCATION '/user/hive/warehouse/d2013.db/' AS SELECT _c1,_c2  FROM maxmin2013
                            ^
Encountered: STORED
Expected: LIKE

CAUSED BY: Exception: Syntax error
[localhost.localdomain:21000] &amp;gt; CREATE TABLE maxminonly2013 LIKE  AS RCFILE LOCATION '/user/hive/warehouse/d2013.db/' AS SELECT _c1,_c2  FROM maxmin2013;
Query: create TABLE maxminonly2013 LIKE  AS RCFILE LOCATION '/user/hive/warehouse/d2013.db/' AS SELECT _c1,_c2  FROM maxmin2013
ERROR: AnalysisException: Syntax error at:
create TABLE maxminonly2013 LIKE  AS RCFILE LOCATION '/user/hive/warehouse/d2013.db/' AS SELECT _c1,_c2  FROM maxmin2013
                                  ^
Encountered: AS
Expected: IDENTIFIER

CAUSED BY: Exception: Syntax error
[localhost.localdomain:21000] &amp;gt; CREATE TABLE maxminonly2013 LIKE STORED AS RCFILE LOCATION '/user/hive/warehouse/d2013.db/' AS SELECT _c1,_c2  FROM maxmin2013;
Query: create TABLE maxminonly2013 LIKE STORED AS RCFILE LOCATION '/user/hive/warehouse/d2013.db/' AS SELECT _c1,_c2  FROM maxmin2013
ERROR: AnalysisException: Syntax error at:
create TABLE maxminonly2013 LIKE STORED AS RCFILE LOCATION '/user/hive/warehouse/d2013.db/' AS SELECT _c1,_c2  FROM maxmin2013
                                 ^
Encountered: STORED
Expected: IDENTIFIER

CAUSED BY: Exception: Syntax error
[localhost.localdomain:21000] &amp;gt; CREATE TABLE maxminonly2013  STORED AS TEXTFILE LOCATION '/user/hive/warehouse/d2013.db/' AS SELECT _c1,_c2  FROM maxmin2013;
Query: create TABLE maxminonly2013  STORED AS TEXTFILE LOCATION '/user/hive/warehouse/d2013.db/' AS SELECT _c1,_c2  FROM maxmin2013
ERROR: AnalysisException: Syntax error at:
create TABLE maxminonly2013  STORED AS TEXTFILE LOCATION '/user/hive/warehouse/d2013.db/' AS SELECT _c1,_c2  FROM maxmin2013
                             ^
Encountered: STORED
Expected: LIKE

CAUSED BY: Exception: Syntax error&lt;/PRE&gt;</description>
    <pubDate>Sat, 22 Jul 2017 10:14:15 GMT</pubDate>
    <dc:creator>saisvk</dc:creator>
    <dc:date>2017-07-22T10:14:15Z</dc:date>
    <item>
      <title>impala table creation with select command</title>
      <link>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/57680#M14313</link>
      <description>&lt;P&gt;When I tried to create a table in Impala&amp;nbsp;it is showing the below error, I'm&amp;nbsp;new to Hadoop&amp;nbsp;so kindly help me out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;CAUSED BY: Exception: Syntax error
[localhost.localdomain:21000] &amp;gt; create table ordercrime2012
                              &amp;gt; LIKE
                              &amp;gt; LOCATION '/user/cloudera/svk'
                              &amp;gt; STORED AS ctas_file_format
                              &amp;gt; SELECT loc,crimetyp,count(crimetyp) from crime2012 GROUP BY loc,crimetyp  ORDER BY count(crimetyp) DESC LIMIT 6763;
Query: create table ordercrime2012 LIKE LOCATION '/user/cloudera/svk' STORED AS ctas_file_format SELECT loc,crimetyp,count(crimetyp) from crime2012 GROUP BY loc,crimetyp  ORDER BY count(crimetyp) DESC LIMIT 6763
ERROR: AnalysisException: Syntax error at:
create table ordercrime2012 LIKE LOCATION '/user/cloudera/svk' STORED AS ctas_file_format SELECT loc,crimetyp,count(crimetyp) from crime2012 GROUP BY loc,crimetyp  ORDER BY count(crimetyp) DESC LIMIT 6763
                                 ^
Encountered: LOCATION
Expected: IDENTIFIER

CAUSED BY: Exception: Syntax error&lt;/PRE&gt;&lt;P&gt;if anyone knows how to create the table for select command in Impala&amp;nbsp;kindly let me know, please.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 11:57:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/57680#M14313</guid>
      <dc:creator>saisvk</dc:creator>
      <dc:date>2022-09-16T11:57:26Z</dc:date>
    </item>
    <item>
      <title>Re: impala table creation with select command</title>
      <link>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/57691#M14314</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/22141"&gt;@saisvk&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Usually when you CREATE TABLE LIKE syntax you dont specify coloumn name , it will be dervied from the source table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It just the precidence well try this you should be able to overcome this error&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note - &amp;nbsp;Make sure you have the write / read access to the path you mention in the LOCATION .&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Syntax&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;CREATE [EXTERNAL] TABLE [IF NOT EXISTS] [db_name.]table_name
  LIKE { [db_name.]table_name | PARQUET 'hdfs_path_of_parquet_file' }
  [COMMENT 'table_comment']
  [STORED AS file_format]
  [LOCATION 'hdfs_path']&lt;/PRE&gt;&lt;PRE&gt;create table t2 like t1 stored as textfile  LOCATION '/user/hduser';&lt;/PRE&gt;&lt;P&gt;Le me know if that works&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2017 05:41:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/57691#M14314</guid>
      <dc:creator>csguna</dc:creator>
      <dc:date>2017-07-20T05:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: impala table creation with select command</title>
      <link>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/57784#M14315</link>
      <description>&lt;P&gt;Thanks for your acknowledgement, it is working when I&amp;nbsp;create new table, but problem is, in hive, we will create a table from select command like this, but I'm&amp;nbsp;getting errors while I am creating a table based on select command in Impala, could you please tell me how to create a table in Impala using select command.&lt;/P&gt;&lt;PRE&gt; HIve:

create table emp as 
select ename,esal from empdept;


Impala: 

???&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2017 10:14:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/57784#M14315</guid>
      <dc:creator>saisvk</dc:creator>
      <dc:date>2017-07-21T10:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: impala table creation with select command</title>
      <link>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/57787#M14316</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/22141"&gt;@saisvk&lt;/a&gt;&amp;nbsp;The syntax that I shared should work with impala and hive . which ever you like AS or LIKE you can use . if you got any error by using them in impala let me know &amp;nbsp;.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2017 10:24:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/57787#M14316</guid>
      <dc:creator>csguna</dc:creator>
      <dc:date>2017-07-21T10:24:24Z</dc:date>
    </item>
    <item>
      <title>Re: impala table creation with select command</title>
      <link>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/57788#M14317</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;&lt;BR /&gt;See the &lt;STRONG&gt;CREATE TABLE AS SELECT &lt;/STRONG&gt;&lt;SPAN class="short_text"&gt;&lt;SPAN&gt;paragraph&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;here in documentation:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.cloudera.com/documentation/enterprise/latest/topics/impala_create_table.html" target="_self"&gt;https://www.cloudera.com/documentation/enterprise/latest/topics/impala_create_table.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Good luck.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2017 10:26:22 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/57788#M14317</guid>
      <dc:creator>AcharkiMed</dc:creator>
      <dc:date>2017-07-21T10:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: impala table creation with select command</title>
      <link>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/57789#M14318</link>
      <description>&lt;P&gt;I dint get any error, but while fetching records it &amp;nbsp;is giving result as 0 rows&lt;/P&gt;&lt;PRE&gt;Returned 0 row(s) in 1.00s
[localhost.localdomain:21000] &amp;gt; create table percentage112012 like percentagecrime2012 Stored as RCFILE Location '/user/hive/warehouse/dissertation.db/percentagecrime2012 ';
Query: create table percentage112012 like percentagecrime2012 Stored as RCFILE Location '/user/hive/warehouse/dissertation.db/percentagecrime2012 '
[localhost.localdomain:21000] &amp;gt; select * from percentage112012;
Query: select * from percentage112012
Query finished, fetching results ...

Returned 0 row(s) in 4.37s
[localhost.localdomain:21000] &amp;gt; &lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Jul 2017 10:37:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/57789#M14318</guid>
      <dc:creator>saisvk</dc:creator>
      <dc:date>2017-07-21T10:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: impala table creation with select command</title>
      <link>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/57790#M14319</link>
      <description>&lt;P&gt;Im&amp;nbsp;not understanding how to create table for select command. Below i am leaving code kindly let me know according to that.&lt;/P&gt;&lt;PRE&gt;CAUSED BY: Exception: Syntax error
[localhost.localdomain:21000] &amp;gt; Create table A LIKE percentagecrime2012
                              &amp;gt; STORED AS RCFILE
                              &amp;gt; LOCATION '/user/hive/warehouse/dissertation.db/percentagecrime2012'
                              &amp;gt; AS select _c1 from percentagecrime2012;
Query: create table A LIKE percentagecrime2012 STORED AS RCFILE LOCATION '/user/hive/warehouse/dissertation.db/percentagecrime2012' AS select _c1 from percentagecrime2012
ERROR: AnalysisException: Syntax error at:
create table A LIKE percentagecrime2012 STORED AS RCFILE LOCATION '/user/hive/warehouse/dissertation.db/percentagecrime2012' AS select _c1 from percentagecrime2012
                                                                                                                             ^
Encountered: AS
Expected

CAUSED BY: Exception: Syntax error
[localhost.localdomain:21000] &amp;gt; create table A LIKE percentagecrime2012 STORED AS RCFILE LOCATION '/user/hive/warehouse/dissertation.db/percentagecrime2012' AS select _c1 from percentagecrime2012
                              &amp;gt; ;
Query: create table A LIKE percentagecrime2012 STORED AS RCFILE LOCATION '/user/hive/warehouse/dissertation.db/percentagecrime2012' AS select _c1 from percentagecrime2012
ERROR: AnalysisException: Syntax error at:
create table A LIKE percentagecrime2012 STORED AS RCFILE LOCATION '/user/hive/warehouse/dissertation.db/percentagecrime2012' AS select _c1 from percentagecrime2012
                                                                                                                             ^
Encountered: AS
Expected

CAUSED BY: Exception: Syntax error
[localhost.localdomain:21000] &amp;gt; create table A LIKE percentagecrime2012 STORED AS RCFILE LOCATION '/user/hive/warehouse/dissertation.db/percentagecrime2012' LIKE select _c1 from percentagecrime2012;
Query: create table A LIKE percentagecrime2012 STORED AS RCFILE LOCATION '/user/hive/warehouse/dissertation.db/percentagecrime2012' LIKE select _c1 from percentagecrime2012
ERROR: AnalysisException: Syntax error at:
create table A LIKE percentagecrime2012 STORED AS RCFILE LOCATION '/user/hive/warehouse/dissertation.db/percentagecrime2012' LIKE select _c1 from percentagecrime2012
                                                                                                                             ^
Encountered: LIKE
Expected

CAUSED BY: Exception: Syntax error
[localhost.localdomain:21000] &amp;gt; &lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Jul 2017 10:51:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/57790#M14319</guid>
      <dc:creator>saisvk</dc:creator>
      <dc:date>2017-07-21T10:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: impala table creation with select command</title>
      <link>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/57808#M14320</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/22141"&gt;@saisvk&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;just type the below in the impala terminal mate&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Create table A  LIKE percentagecrime2012  STORED AS RCFILE LOCATION '/user/hive/warehouse/dissertation.db/'&lt;/PRE&gt;&lt;PRE&gt;&lt;STRONG&gt;Note &amp;nbsp;- When you use LIKE&lt;BR /&gt;&lt;BR /&gt;" you do not specify the columns at all; &lt;BR /&gt;the column names and types are derived from the source table"&lt;BR /&gt;&lt;BR /&gt;" Also it will only create empty table with same structure &lt;BR /&gt;as your orginal table with NO DATA " &lt;BR /&gt;hence when you perform select * from table_name it did not return rows.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;U&gt;LOCATION - is the path of the location that you want your new created table to be .&lt;/U&gt; &lt;BR /&gt;&lt;/STRONG&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if you want to clone the structure along with the data and your custom location then use below query&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;CREATE TABLE A STORED AS TEXTFILE LOCATION '/user/hive/warehouse/dissertation.db/' AS SELECT * FROM percentagecrime2012;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if you need more information let me know .&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2017 16:47:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/57808#M14320</guid>
      <dc:creator>csguna</dc:creator>
      <dc:date>2017-07-21T16:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: impala table creation with select command</title>
      <link>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/57854#M14321</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/16544"&gt;@csguna&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sir, i have tried as you suggested me then also its giving below errors,&lt;/P&gt;&lt;PRE&gt;[localhost.localdomain:21000] &amp;gt; CREATE TABLE maxminonly2013 STORED AS RCFILE LOCATION '/user/hive/warehouse/d2013.db/' AS SELECT _c1,_c2  FROM maxmin2013;
Query: create TABLE maxminonly2013 STORED AS RCFILE LOCATION '/user/hive/warehouse/d2013.db/' AS SELECT _c1,_c2  FROM maxmin2013
ERROR: AnalysisException: Syntax error at:
create TABLE maxminonly2013 STORED AS RCFILE LOCATION '/user/hive/warehouse/d2013.db/' AS SELECT _c1,_c2  FROM maxmin2013
                            ^
Encountered: STORED
Expected: LIKE

CAUSED BY: Exception: Syntax error
[localhost.localdomain:21000] &amp;gt; CREATE TABLE maxminonly2013 LIKE  AS RCFILE LOCATION '/user/hive/warehouse/d2013.db/' AS SELECT _c1,_c2  FROM maxmin2013;
Query: create TABLE maxminonly2013 LIKE  AS RCFILE LOCATION '/user/hive/warehouse/d2013.db/' AS SELECT _c1,_c2  FROM maxmin2013
ERROR: AnalysisException: Syntax error at:
create TABLE maxminonly2013 LIKE  AS RCFILE LOCATION '/user/hive/warehouse/d2013.db/' AS SELECT _c1,_c2  FROM maxmin2013
                                  ^
Encountered: AS
Expected: IDENTIFIER

CAUSED BY: Exception: Syntax error
[localhost.localdomain:21000] &amp;gt; CREATE TABLE maxminonly2013 LIKE STORED AS RCFILE LOCATION '/user/hive/warehouse/d2013.db/' AS SELECT _c1,_c2  FROM maxmin2013;
Query: create TABLE maxminonly2013 LIKE STORED AS RCFILE LOCATION '/user/hive/warehouse/d2013.db/' AS SELECT _c1,_c2  FROM maxmin2013
ERROR: AnalysisException: Syntax error at:
create TABLE maxminonly2013 LIKE STORED AS RCFILE LOCATION '/user/hive/warehouse/d2013.db/' AS SELECT _c1,_c2  FROM maxmin2013
                                 ^
Encountered: STORED
Expected: IDENTIFIER

CAUSED BY: Exception: Syntax error
[localhost.localdomain:21000] &amp;gt; CREATE TABLE maxminonly2013  STORED AS TEXTFILE LOCATION '/user/hive/warehouse/d2013.db/' AS SELECT _c1,_c2  FROM maxmin2013;
Query: create TABLE maxminonly2013  STORED AS TEXTFILE LOCATION '/user/hive/warehouse/d2013.db/' AS SELECT _c1,_c2  FROM maxmin2013
ERROR: AnalysisException: Syntax error at:
create TABLE maxminonly2013  STORED AS TEXTFILE LOCATION '/user/hive/warehouse/d2013.db/' AS SELECT _c1,_c2  FROM maxmin2013
                             ^
Encountered: STORED
Expected: LIKE

CAUSED BY: Exception: Syntax error&lt;/PRE&gt;</description>
      <pubDate>Sat, 22 Jul 2017 10:14:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/57854#M14321</guid>
      <dc:creator>saisvk</dc:creator>
      <dc:date>2017-07-22T10:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: impala table creation with select command</title>
      <link>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/57855#M14322</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/22141"&gt;@saisvk&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please read my previous response one more time . I told you that you dont have to mention column when you use LIKE and also it will create table with NO DATA hence you have to insert .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now your query should be like this . copy paste it in your terminal .&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The below will only CREATE &amp;nbsp;- Does not LOAD DATA . ( LIKE )&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;CREATE TABLE maxminonly2013 LIKE maxmin2013 STORED AS RCFILE LOCATION '/user/hive/warehouse/d2013.db/' &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The below will create and LOAD the data &amp;nbsp;(AS)&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;CREATE TABLE maxminonly2013 STORED AS TEXTFILE LOCATION '/user/hive/warehouse/dissertation.db/' AS SELECT * FROM maxmin2013 ;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please let me know if that helps .&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jul 2017 11:19:05 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/57855#M14322</guid>
      <dc:creator>csguna</dc:creator>
      <dc:date>2017-07-22T11:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: impala table creation with select command</title>
      <link>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/57857#M14323</link>
      <description>&lt;P&gt;Thanks for your &amp;nbsp;answer, your code is working when creating a new table using&amp;nbsp;select * from tableA command, but when i use select column1,column2 from tableA&amp;nbsp;is again giving error, below im attaching it,&lt;/P&gt;&lt;PRE&gt;[localhost.localdomain:21000] &amp;gt; refresh;
show tSuccessfully refreshed catalog
[localhost.localdomain:21000] &amp;gt; show tables;
Query: show tables
Query finished, fetching results ...
+------+
| name |
+------+
| emp  |
+------+
Returned 1 row(s) in 0.16s
[localhost.localdomain:21000] &amp;gt; select * from emp;;
Query: select * from emp
Query finished, fetching results ...
+--------+------------+-----------+------+-----------+----------+
| name   | dept       | job       | sal  | dob       | loc      |
+--------+------------+-----------+------+-----------+----------+
|        |            |           | NULL |           |          |
| ADAMS  | RESEARCH   | CLERK     | 7876 | 23-MAY-87 | DALLAS   |
| ALLEN  | SALES      | SALESMAN  | 7499 | 20-FEB-81 | CHICAGO  |
| BLAKE  | SALES      | MANAGER   | 7698 | 01-MAY-81 | CHICAGO  |
| CLARK  | ACCOUNTING | MANAGER   | 7782 | 09-JUN-81 | NEW YORK |
| FORD   | RESEARCH   | ANALYST   | 7902 | 03-DEC-81 | DALLAS   |
| JAMES  | SALES      | CLERK     | 7900 | 03-DEC-81 | CHICAGO  |
| JONES  | RESEARCH   | MANAGER   | 7566 | 02-APR-81 | DALLAS   |
| KING   | ACCOUNTING | PRESIDENT | 7839 | 17-NOV-81 | NEW YORK |
| MARTIN | SALES      | SALESMAN  | 7654 | 28-SEP-81 | CHICAGO  |
| MILLEA | ACCOUNTING | CLERK     | 7934 | 23-JAN-82 | NEW YORK |
| SCOTT  | RESEARCH   | ANALYST   | 7788 | 19-APR-87 | DALLAS   |
| SMITH  | RESEARCH   | CLERK     | 7369 | 17-DEC-80 | DALLAS   |
| TURNER | SALES      | SALESMAN  | 7844 | 08-SEP-81 | CHICAGO  |
| WARD   | SALES      | SALESMAN  | 7521 | 22-FEB-81 | CHICAGO  |
+--------+------------+-----------+------+-----------+----------+
Returned 15 row(s) in 2.00s
[localhost.localdomain:21000] &amp;gt; select name,job,loc from emp;
Query: select name,job,loc from emp
Query finished, fetching results ...
+--------+-----------+----------+
| name   | job       | loc      |
+--------+-----------+----------+
|        |           |          |
| ADAMS  | CLERK     | DALLAS   |
| ALLEN  | SALESMAN  | CHICAGO  |
| BLAKE  | MANAGER   | CHICAGO  |
| CLARK  | MANAGER   | NEW YORK |
| FORD   | ANALYST   | DALLAS   |
| JAMES  | CLERK     | CHICAGO  |
| JONES  | MANAGER   | DALLAS   |
| KING   | PRESIDENT | NEW YORK |
| MARTIN | SALESMAN  | CHICAGO  |
| MILLEA | CLERK     | NEW YORK |
| SCOTT  | ANALYST   | DALLAS   |
| SMITH  | CLERK     | DALLAS   |
| TURNER | SALESMAN  | CHICAGO  |
| WARD   | SALESMAN  | CHICAGO  |
+--------+-----------+----------+
Returned 15 row(s) in 1.17s
[localhost.localdomain:21000] &amp;gt; CREATE TABLE emp1 LIKE emp STORED AS TEXTFILE LOCATION '/user/hive/warehouse/svk.db/';
Query: create TABLE emp1 LIKE emp STORED AS TEXTFILE LOCATION '/user/hive/warehouse/svk.db/'
[localhost.localdomain:21000] &amp;gt; CREATE TABLE maxminonly2013 STORED AS TEXTFILE LOCATION '/user/hive/warehouse/dissertation.db/' AS SELECT * FROM maxmin2013 ;
Query: create TABLE maxminonly2013 STORED AS TEXTFILE LOCATION '/user/hive/warehouse/dissertation.db/' AS SELECT * FROM maxmin2013
ERROR: AnalysisException: Syntax error at:
create TABLE maxminonly2013 STORED AS TEXTFILE LOCATION '/user/hive/warehouse/dissertation.db/' AS SELECT * FROM maxmin2013
                            ^
Encountered: STORED
Expected: LIKE

CAUSED BY: Exception: Syntax error
[localhost.localdomain:21000] &amp;gt; CREATE TABLE emp1 STORED AS TEXTFILE LOCATION '/user/hive/warehouse/svk.db/' AS SELECT name,job,loc FROM emp;
Query: create TABLE emp1 STORED AS TEXTFILE LOCATION '/user/hive/warehouse/svk.db/' AS SELECT name,job,loc FROM emp
ERROR: AnalysisException: Syntax error at:
create TABLE emp1 STORED AS TEXTFILE LOCATION '/user/hive/warehouse/svk.db/' AS SELECT name,job,loc FROM emp
                  ^
Encountered: STORED
Expected: LIKE

CAUSED BY: Exception: Syntax error
[localhost.localdomain:21000] &amp;gt; &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;LIKE &amp;nbsp;ABOVE TABLE, I HAVE ONE CRIME2013 TABLE, FROM THE PARENT TABLE I HAVE SELECTED&lt;/P&gt;&lt;P&gt;SELECT crime,loc&amp;nbsp;FROM CRIME2013; IT IS GIVING THE RESULT, NOW I WANT TO CREATE A TABLE BASE ON SELECT crime,loc&amp;nbsp;FROM CRIME2013;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CREATE TABLE crimeloc&amp;nbsp;LIKE CRIME2013 STORED AS RCFILE LOCATION '/user/hive/warehouse/svk.db';&lt;/P&gt;&lt;P&gt;now above it is creating a new table called crimeloc with 0 rows,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOW I want to create a table and insert the SELECT crime,loc&amp;nbsp;FROM CRIME2013; result into above created new table crimeloc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now if I try:&lt;/P&gt;&lt;P&gt;CREATE TABLE crimeloc&amp;nbsp;STORED AS RCFILE LOCATION '/user/hive/warehouse/svk.db' AS SELECT crime,loc from CRIME2013;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then it is giving below errors,&lt;/P&gt;&lt;PRE&gt;create TABLE emp1 STORED AS TEXTFILE LOCATION '/user/hive/warehouse/svk.db/' AS SELECT name,job,loc FROM emp
                  ^
Encountered: STORED
Expected: LIKE&lt;/PRE&gt;</description>
      <pubDate>Sat, 22 Jul 2017 14:37:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/57857#M14323</guid>
      <dc:creator>saisvk</dc:creator>
      <dc:date>2017-07-22T14:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: impala table creation with select command</title>
      <link>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/57872#M14324</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/22141"&gt;@saisvk&lt;/a&gt;&amp;nbsp;mate&amp;nbsp;&lt;/P&gt;&lt;P&gt;please look into my previous response i have highlighted what will happen when you use LIKE&lt;/P&gt;&lt;PRE&gt;CREATE TABLE crimeloc LIKE CRIME2013 STORED AS RCFILE LOCATION '/user/hive/warehouse/svk.db';
&lt;STRONG&gt;now above it is creating a new table called crimeloc with 0 rows,
 &lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jul 2017 01:52:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/57872#M14324</guid>
      <dc:creator>csguna</dc:creator>
      <dc:date>2017-07-23T01:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: impala table creation with select command</title>
      <link>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/57873#M14325</link>
      <description>&lt;P&gt;try this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;create TABLE emp1  AS SELECT name,job,loc FROM emp;&lt;/PRE&gt;&lt;P&gt;this should create you a table called emp under your /user/hive/warehouse/your_database_folder&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;perform a select in emp1 - you should get results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;let me know if that works&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jul 2017 02:33:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/57873#M14325</guid>
      <dc:creator>csguna</dc:creator>
      <dc:date>2017-07-23T02:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: impala table creation with select command</title>
      <link>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/58148#M14326</link>
      <description>&lt;P&gt;Hello, create table emp1 as select name, dept from emp; this syntax is working in the hive, but when I try the same syntax in Impala it's giving below error&lt;/P&gt;&lt;PRE&gt;[localhost.localdomain:21000] &amp;gt; use svk;
Query: use svk
[localhost.localdomain:21000] &amp;gt; show tables;
Query: show tables
Query finished, fetching results ...
+------+
| name |
+------+
| emp  |
| emp1 |
+------+
Returned 2 row(s) in 0.53s
[localhost.localdomain:21000] &amp;gt; select * from emp;
Query: select * from emp
Query finished, fetching results ...
+--------+------------+-----------+------+-----------+----------+
| name   | dept       | job       | sal  | dob       | loc      |
+--------+------------+-----------+------+-----------+----------+
|        |            |           | NULL |           |          |
| ADAMS  | RESEARCH   | CLERK     | 7876 | 23-MAY-87 | DALLAS   |
| ALLEN  | SALES      | SALESMAN  | 7499 | 20-FEB-81 | CHICAGO  |
| BLAKE  | SALES      | MANAGER   | 7698 | 01-MAY-81 | CHICAGO  |
| CLARK  | ACCOUNTING | MANAGER   | 7782 | 09-JUN-81 | NEW YORK |
| FORD   | RESEARCH   | ANALYST   | 7902 | 03-DEC-81 | DALLAS   |
| JAMES  | SALES      | CLERK     | 7900 | 03-DEC-81 | CHICAGO  |
| JONES  | RESEARCH   | MANAGER   | 7566 | 02-APR-81 | DALLAS   |
| KING   | ACCOUNTING | PRESIDENT | 7839 | 17-NOV-81 | NEW YORK |
| MARTIN | SALES      | SALESMAN  | 7654 | 28-SEP-81 | CHICAGO  |
| MILLEA | ACCOUNTING | CLERK     | 7934 | 23-JAN-82 | NEW YORK |
| SCOTT  | RESEARCH   | ANALYST   | 7788 | 19-APR-87 | DALLAS   |
| SMITH  | RESEARCH   | CLERK     | 7369 | 17-DEC-80 | DALLAS   |
| TURNER | SALES      | SALESMAN  | 7844 | 08-SEP-81 | CHICAGO  |
| WARD   | SALES      | SALESMAN  | 7521 | 22-FEB-81 | CHICAGO  |
+--------+------------+-----------+------+-----------+----------+
Returned 15 row(s) in 30.02s
[localhost.localdomain:21000] &amp;gt; select dept,sal,loc from emp;
Query: select dept,sal,loc from emp
Query finished, fetching results ...
+------------+------+----------+
| dept       | sal  | loc      |
+------------+------+----------+
|            | NULL |          |
| RESEARCH   | 7876 | DALLAS   |
| SALES      | 7499 | CHICAGO  |
| SALES      | 7698 | CHICAGO  |
| ACCOUNTING | 7782 | NEW YORK |
| RESEARCH   | 7902 | DALLAS   |
| SALES      | 7900 | CHICAGO  |
| RESEARCH   | 7566 | DALLAS   |
| ACCOUNTING | 7839 | NEW YORK |
| SALES      | 7654 | CHICAGO  |
| ACCOUNTING | 7934 | NEW YORK |
| RESEARCH   | 7788 | DALLAS   |
| RESEARCH   | 7369 | DALLAS   |
| SALES      | 7844 | CHICAGO  |
| SALES      | 7521 | CHICAGO  |
+------------+------+----------+
Returned 15 row(s) in 1.17s
[localhost.localdomain:21000] &amp;gt; create table emp2 as 
                              &amp;gt; select dept,sal,loc from emp;
Query: create table emp2 as select dept,sal,loc from emp
ERROR: AnalysisException: Syntax error at:
create table emp2 as select dept,sal,loc from emp
                  ^
Encountered: AS
Expected: LIKE

CAUSED BY: Exception: Syntax error
[localhost.localdomain:21000] &amp;gt; create table emp2 LIKE select dept,sal,loc from emp;
Query: create table emp2 LIKE select dept,sal,loc from emp
ERROR: AnalysisException: Syntax error at:
create table emp2 LIKE select dept,sal,loc from emp
                       ^
Encountered: SELECT
Expected: IDENTIFIER

CAUSED BY: Exception: Syntax error
[localhost.localdomain:21000] &amp;gt; create table emp2 as select dept,sal,loc from svk.emp;
Query: create table emp2 as select dept,sal,loc from svk.emp
ERROR: AnalysisException: Syntax error at:
create table emp2 as select dept,sal,loc from svk.emp
                  ^
Encountered: AS
Expected: LIKE

CAUSED BY: Exception: Syntax error
[localhost.localdomain:21000] &amp;gt; &lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 23:52:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/58148#M14326</guid>
      <dc:creator>saisvk</dc:creator>
      <dc:date>2017-07-27T23:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: impala table creation with select command</title>
      <link>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/58153#M14327</link>
      <description>&lt;P&gt;This is wrong&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;[localhost.localdomain:21000] &amp;gt; create table emp2 LIKE select dept,sal,loc from emp;
Query: create table emp2 LIKE select dept,sal,loc from emp
ERROR: AnalysisException: Syntax error at:
create table emp2 LIKE select dept,sal,loc from emp&lt;/PRE&gt;&lt;P&gt;This is correct syntax&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;create table emp2 LIKE emp;&lt;/PRE&gt;&lt;P&gt;Try this&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;create table emp2 AS  select dept,sal,loc from svk.emp;&lt;/PRE&gt;&lt;P&gt;The wired part is I am able to perform the same syntax with "as" &amp;nbsp;as small refer the screen &amp;nbsp;You have got some formatting issue check that your query does not have any unwanted space and mostly like just type it instead of copy and paste .&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="screen1.jpg" style="width: 600px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/3257i36A2606FDA372B17/image-size/large?v=v2&amp;amp;px=999" role="button" title="screen1.jpg" alt="screen1.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2017 02:59:04 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/58153#M14327</guid>
      <dc:creator>csguna</dc:creator>
      <dc:date>2017-07-28T02:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: impala table creation with select command</title>
      <link>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/58847#M14328</link>
      <description>&lt;PRE&gt;Returned 15 row(s) in 0.39s
[localhost.localdomain:21000] &amp;gt; create table emp2 AS 
                              &amp;gt; select name,dept,job from svk.emp;
Query: create table emp2 AS select name,dept,job from svk.emp
ERROR: AnalysisException: Syntax error at:
create table emp2 AS select name,dept,job from svk.emp
                  ^
Encountered: AS
Expected: LIKE

CAUSED BY: Exception: Syntax error
[localhost.localdomain:21000] &amp;gt; create table emp2 LIKE select name,dept,job from svk.emp;
Query: create table emp2 LIKE select name,dept,job from svk.emp
ERROR: AnalysisException: Syntax error at:
create table emp2 LIKE select name,dept,job from svk.emp
                       ^
Encountered: SELECT
Expected: IDENTIFIER

CAUSED BY: Exception: Syntax error
[localhost.localdomain:21000] &amp;gt; create table emp2 LIKE emp;
Query: create table emp2 LIKE emp
[localhost.localdomain:21000] &amp;gt; create table emp2 AS select name,dept,job from svk.emp;
Query: create table emp2 AS select name,dept,job from svk.emp
ERROR: AnalysisException: Syntax error at:
create table emp2 AS select name,dept,job from svk.emp
                  ^
Encountered: AS
Expected: LIKE

CAUSED BY: Exception: Syntax error
[localhost.localdomain:21000] &amp;gt; create table emp3 as select name,dept from emp;
Query: create table emp3 as select name,dept from emp
ERROR: AnalysisException: Syntax error at:
create table emp3 as select name,dept from emp
                  ^
Encountered: AS
Expected: LIKE&lt;/PRE&gt;&lt;P&gt;i have followed as you said, but it is giving below errors&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2017 01:46:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/impala-table-creation-with-select-command/m-p/58847#M14328</guid>
      <dc:creator>saisvk</dc:creator>
      <dc:date>2017-08-15T01:46:53Z</dc:date>
    </item>
  </channel>
</rss>

