error when creating table in hive

gjin

My query is

with subs2 as(
  Select columns
  from t1
  right join t2
  on conditions
)
CREATE TABLE new_n row format delimited fields terminated by '|' STORED AS RCFile AS
Select columns
from subs2
left join charge2
on conditions
where conditions;

The error I get looks like this

cannot recognize input near 'CREATE' 'TABLE' 'new_n' in statement.

Why is this happening?

Gordon Linoff

I think the with goes with the select. So try this:

CREATE TABLE new_n row format delimited fields terminated by '|' STORED AS RCFile AS
    with subs2 as (
      Select columns
      from t1
      right join t2
      on conditions
    )
    Select columns
    from subs2 left join
          charge2
          on conditions
    where conditions;

Or, you can rewrite without the with:

CREATE TABLE new_n row format delimited fields terminated by '|' STORED AS RCFile AS
    Select columns
    from (Select columns
           from t2 left join  -- I much prefer `left join`
           t1
           on conditions
          ) subs2 left join
          charge2
          on conditions
    where conditions;

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Error while creating table in Hive

From Dev

hive creating table duplicate column name error

From Dev

Hive error when creating an external table (state=08S01,code=1)

From Dev

error when creating a partitioned table

From Dev

SQL Error when creating a table

From Dev

Getting Error while creating Hive External Table on top of Hbase Table

From Dev

HIVE Creating Table not null

From Dev

The Hive table is not creating in cosmos

From Dev

The Hive table is not creating in cosmos

From Dev

Hive is throwing permission error while creating table/database

From Dev

java.lang.NoSuchFieldError: type When creating a Hive table

From Dev

MySQL error #1064 when creating table

From Dev

Adding Index when Creating a Table Error 1064

From Dev

Error when creating MySQL Table with PDO

From Dev

#1089 Error when creating table in phpMyAdmin

From Dev

Error when creating table with mysqldb module

From Dev

MySQL error when creating table with phpmyadmin #1016

From Dev

JSP & MySQL | Error when creating table

From Dev

Error when creating a pivot table using VBA

From Dev

creating partition in external table in hive

From Dev

Issue while creating a table in Hive

From Dev

Hive Create Table error

From Dev

How can I ignore the semicolon ; in the & when I am creating a Hive table from a .csv file

From Dev

SQL: error when creating a foreign table that has an enum column

From Dev

Error when creating a table in SQLite database with composite primary key at AUTOINCREMENT

From Dev

MySQL Error Number 150 when creating Table with Foreign Key

From Dev

Foreign key error when creating table (errno 150)

From Dev

Error when creating lua table from inside the c api

From Dev

R colnames/rownames error when creating table by hand

Related Related

  1. 1

    Error while creating table in Hive

  2. 2

    hive creating table duplicate column name error

  3. 3

    Hive error when creating an external table (state=08S01,code=1)

  4. 4

    error when creating a partitioned table

  5. 5

    SQL Error when creating a table

  6. 6

    Getting Error while creating Hive External Table on top of Hbase Table

  7. 7

    HIVE Creating Table not null

  8. 8

    The Hive table is not creating in cosmos

  9. 9

    The Hive table is not creating in cosmos

  10. 10

    Hive is throwing permission error while creating table/database

  11. 11

    java.lang.NoSuchFieldError: type When creating a Hive table

  12. 12

    MySQL error #1064 when creating table

  13. 13

    Adding Index when Creating a Table Error 1064

  14. 14

    Error when creating MySQL Table with PDO

  15. 15

    #1089 Error when creating table in phpMyAdmin

  16. 16

    Error when creating table with mysqldb module

  17. 17

    MySQL error when creating table with phpmyadmin #1016

  18. 18

    JSP & MySQL | Error when creating table

  19. 19

    Error when creating a pivot table using VBA

  20. 20

    creating partition in external table in hive

  21. 21

    Issue while creating a table in Hive

  22. 22

    Hive Create Table error

  23. 23

    How can I ignore the semicolon ; in the & when I am creating a Hive table from a .csv file

  24. 24

    SQL: error when creating a foreign table that has an enum column

  25. 25

    Error when creating a table in SQLite database with composite primary key at AUTOINCREMENT

  26. 26

    MySQL Error Number 150 when creating Table with Foreign Key

  27. 27

    Foreign key error when creating table (errno 150)

  28. 28

    Error when creating lua table from inside the c api

  29. 29

    R colnames/rownames error when creating table by hand

HotTag

Archive