0
CREATE TABLE IF NOT EXISTS user.name_visits(
    date1 TIMESTAMP,
    MV String,
    visits_by_MV int
)
COMMENT ‘visits_at_MV’
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ‘\t’
LINES TERMINATED BY ‘\n’
;

It is saying error near BY

1
  • Your have curly single quotes in your question. These would not be handled as single quotes by Hive. Commented Nov 9, 2015 at 12:19

2 Answers 2

1

Below query worked for me..


CREATE TABLE IF NOT EXISTS user.name_visits(
date1 TIMESTAMP,
MV STRING,
visits_by_MV INT
)
COMMENT 'visits_at_MV'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
LINES TERMINATED BY '\n'
;


Error you are seeing could be because of the editor you are using.
If you look at your Quotation marks.. they're LEFT SINGLE QUOTATION MARK and RIGHT SINGLE QUOTATION MARK.
Only change I made was using an APOSTROPHE.

Try this way it should work

Sign up to request clarification or add additional context in comments.

Comments

0

Change single quotes with double as below:

CREATE TABLE IF NOT EXISTS user.name_visits( date1 TIMESTAMP, MV String, visits_by_MV int ) COMMENT "visits_at_MV" ROW FORMAT DELIMITED FIELDS TERMINATED BY "\t" LINES TERMINATED BY "\n" ;

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.