hadoop - Hive, Bucketing for the partitioned table -


this script:

--table without partition  drop table if exists ufodata; create table ufodata ( sighted string, reported string, city string, shape string, duration string, description string ) row format delimited fields terminated '\t' location '/mapreduce/hive/ufo';  --load data in ufodata  load data local inpath '/home/training/downloads/ufo_awesome.tsv' table ufodata;  --create partition table drop table if exists partufo; create table partufo ( sighted string, reported string, city string, shape string, duration string, description string ) partitioned ( year string ) clustered (year) 6 buckets row format delimited fields terminated '/t';  --by default dynamic partition not set set hive.exec.dynamic.partition=true; set hive.exec.dynamic.partition.mode=nonstrict; --by default bucketing false set hive.enforcebucketing=true;  --loading mydata insert overwrite table partufo partition (year) select sighted, reported, city, shape, min, description, substr(trim(sighted), 1,4) ufodata; 

error message:

failed: error in semantic analysis: invalid column reference

i tried bucketing partitioned table. if remove "clustered (year) 6 buckets" script works fine. how bucket partitioned table

you can use below syntax create bucketing table partition.

create table bckt_movies (mov_id bigint , mov_name string ,prod_studio string, col_world double , col_us_canada double , col_uk double , col_aus double) partitioned (rel_year string) clustered by(mov_id) 6 buckets;  

Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -