Vihang Karajgaonkar created HIVE-24732:
------------------------------------------

             Summary: CachedStore does not return the fields which are 
auto-generated by the database
                 Key: HIVE-24732
                 URL: https://issues.apache.org/jira/browse/HIVE-24732
             Project: Hive
          Issue Type: Bug
            Reporter: Vihang Karajgaonkar


It looks like CachedStore directly caches the thrift objects as they are sent 
by the client. The general pattern seems to be similar to below:

{noformat}
  @Override public void createTable(Table tbl) throws InvalidObjectException, 
MetaException {
    rawStore.createTable(tbl);
    // in case of event based cache update, cache will be updated during commit.
    if (canUseEvents) {
      return;
    }
    String catName = normalizeIdentifier(tbl.getCatName());
    String dbName = normalizeIdentifier(tbl.getDbName());
    String tblName = normalizeIdentifier(tbl.getTableName());
    if (!shouldCacheTable(catName, dbName, tblName)) {
      return;
    }
    validateTableType(tbl);
    // TODO in case of CachedStore we cache directly the object send by the 
client.
    // this is problematic since certain fields of the object are populated
    // after it is persisted. The cache will not be able to serve those fields 
correctly.
    sharedCache.addTableToCache(catName, dbName, tblName, tbl);
  }
{noformat}

The problem here is that the table id is generated when the table is persisted 
in the database. The cachedStore will cache the Table object whose id will be 0.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to