Admittedly the problem has gone away.  I *think* I may have offered the schema 
to the bucketed table creation in the wrong order the first time...I think.  
All I know is the problem went away when I tried a second time.  Should 
inserting a table into another table match the columns by name or does it just 
write from left to right utterly ignoring any schema specification?  Does it 
write the column 'a' from foo into column 'a' in foo_bucketed, or does it write 
column 'a' from foo into the same column position in foo_bucketed without any 
regard for the names of the columns?

On Mar 7, 2014, at 13:52 , Stephen Sprague wrote:

> yeah. that's not right. 
> 
> 1. lets see the output of "show create table foo"
> 
> 2. what version of hive are you using.
> 
> 
> On Fri, Mar 7, 2014 at 11:46 AM, Keith Wiley <kwi...@keithwiley.com> wrote:
> I want to convert a table to a bucketed table, so I made a new table with the 
> same schema as the old table and specified a cluster column:
> 
> create table foo_bucketed
> (
> a string,
> b int,
> c float
> )
> clustered by (b) into 10 buckets;
> 
> Then I populate it from my original table:
> 
> set hive.enforce.bucketing = true;
> insert overwrite table foo_bucketed
> select * from foo;
> 
> All of the data goes into the first bucket, leaving the remaining 9 buckets 
> empty (in the file system, the remaining 9 files are 0 size).  Furthermore, 
> the cluster column is now NULL.  Its values have been completely erased by 
> the insertion (which might explain how they all ended up in a single bucket 
> of course).
> 
> ________________________________________________________________________________
> Keith Wiley     kwi...@keithwiley.com     keithwiley.com    
> music.keithwiley.com
> 
> "Yet mark his perfect self-contentment, and hence learn his lesson, that to be
> self-contented is to be vile and ignorant, and that to aspire is better than 
> to
> be blindly and impotently happy."
>                                            --  Edwin A. Abbott, Flatland
> ________________________________________________________________________________
> 
> 


________________________________________________________________________________
Keith Wiley     kwi...@keithwiley.com     keithwiley.com    music.keithwiley.com

"Luminous beings are we, not this crude matter."
                                           --  Yoda
________________________________________________________________________________

Reply via email to