> Error 40003]: Only External tables can have an explicit location
…
> using hive 1.2. I got this error. This was definitely not a requirement 
> before 

Are you using Apache hive or some vendor fork?

Some BI engines demand there be no aliasing for tables, so each table needs a 
unique location to avoid schema issues.

I tested this on master & HDP builds, the vanilla Apache doesn't have this 
restriction (if there is, an explicit version would be helpful).

$ hive --version
Hive 1.2.1000.2.5.3.0-37

hive> use testing;
OK
Time taken: 1.245 seconds
hive> create table foo (x int) location '/tmp/foo';
OK
Time taken: 0.59 seconds
hive> desc formatted foo;
OK
# col_name              data_type               comment             
                 
x                       int                                         
                 
# Detailed Table Information             
Database:               testing                  
Owner:                  gopal                    
CreateTime:             Wed Jan 25 15:38:27 EST 2017     
LastAccessTime:         UNKNOWN                  
Protect Mode:           None                     
Retention:              0                        
Location:               hdfs://nnha/tmp/foo      
Table Type:             MANAGED_TABLE            
Table Parameters:                
        numFiles                2                   
        totalSize               66                  
        transient_lastDdlTime   1485376707          
                 
# Storage Information            
SerDe Library:          org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe      
 
InputFormat:            org.apache.hadoop.mapred.TextInputFormat         
OutputFormat:           
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat       
Compressed:             No                       
Num Buckets:            -1                       
Bucket Columns:         []                       
Sort Columns:           []                       
Storage Desc Params:             
        serialization.format    1                   
Time taken: 0.455 seconds, Fetched: 28 row(s)
hive> 

Cheers,
Gopal



Reply via email to