mpg
mpg

Reputation: 3919

Parse error in HIVE varchar

I am creating a new table in HIVE (working on the big airline data set). This is my first table with varchar. I am working on a system with HIVE 0.8 installed. I seem to get a parse error when it hits the first varchar. Can anyone see a reason? I have checked the tutorials and seems I am doing it correct.

hive> CREATE TABLE ontime ( 
    > Year int,
    >   Month int,
    >   DayofMonth int,
    >   DayOfWeek int,
    >   DepTime  int,
    >   CRSDepTime int,
    >   ArrTime int,
    >   CRSArrTime int,
    >   UniqueCarrier VARCHAR(10),
    >   FlightNum int,
    >   TailNum VARCHAR(8),
    >   ActualElapsedTime int,
    >   CRSElapsedTime int,
    >   AirTime int,
    >   ArrDelay int,
    >   DepDelay int,
    >   Origin VARCHAR(3),
    >   Dest VARCHAR(3),
    >   Distance int,
    >   TaxiIn int,
    >   TaxiOut int,
    >   Cancelled int,
    >   CancellationCode VARCHAR(1),
    >   Diverted VARCHAR(1),
    >   CarrierDelay int,
    >   WeatherDelay int,
    >   NASDelay int,
    >   SecurityDelay int,
    >   LateAircraftDelay int)
    > ROW FORMAT DELIMITED FIELDS 
    > TERMINATED BY ',' STORED AS TEXTFILE;

FAILED: Parse Error: line 10:16 cannot recognize input near 'VARCHAR' '(' '10' in column type

Upvotes: 1

Views: 755

Answers (1)

Ben Watson
Ben Watson

Reputation: 5541

From https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types:

VARCHAR (Note: Only available starting with Hive 0.12.0)

Looks like you can't use it with your version of Hive.

Upvotes: 0

Related Questions