Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Hadoop Wiki" for change 
notification.

The "Hive/ViewDev" page has been changed by JohnSichi.
http://wiki.apache.org/hadoop/Hive/ViewDev?action=diff&rev1=13&rev2=14

--------------------------------------------------

  
  After the tables are altered, the new columns will contain NULL values for 
existing rows describing previously created tables.  This is correct for 
VIEW_ORIGINAL_TEXT and VIEW_EXPANDED_TEXT (since views did not previously 
exist), but is incorrect for the TBL_TYPE column introduced by 
[[https://issues.apache.org/jira/browse/HIVE-1068|HIVE-1068]].  The new Hive 
code is capable of handling this (automatically filling in the correct value 
for the new field when a descriptor is retrieved), but it does not "fix" the 
stored rows.  This could be an issue if in the future other tools are used to 
retrieve information directly from the metastore database rather than accessing 
the metastore API.
  
- The script below can be used to fix existing rows after the tables have been 
altered.  It should be run in the specified order, and AFTER all Hive instances 
directly accessing the metastore database have been upgraded.  For safety, it 
is view-aware just in case a CREATE VIEW statement has already been executed, 
meaning it can be rerun any time after the upgrade.
+ The script below can be used to fix existing rows after the tables have been 
altered.  It should be run AFTER all Hive instances directly accessing the 
metastore database have been upgraded (otherwise new null values could slip in 
and remain forever).  For safety, it is view-aware just in case a CREATE VIEW 
statement has already been executed, meaning it can be rerun any time after the 
upgrade.
  
  {{{
  UPDATE TBLS SET TBL_TYPE='MANAGED_TABLE'

Reply via email to