amplab/shark — pull request #213 by harveyfeng (2013-11-10 20:48:29+00:00)
Title: New semantics for caching tables

Enables Shark to maintain a "unified view" of cached tables, in that its in-memory, columnar-backed store is synchronized with the backing disk store (the table's data directory in the Hive warehouse). Both the cached and on-disk copies are modified for any table updates (e.g., specified by LOAD, INSERT, or CTAS), so the semantics are similar to a write-through cache.

In terms of usability,
(a) No longer required to create new tables in order to cache existing ones. The interface changes from:
Instead of ```CREATE TABLE src_cached AS SELECT * FROM src```, ``` CACHE src```

(b) Since unified views are backed by a disk copy, updates on cached tables persistent across Shark sessions. Previously, the `src_cached` table and any updates to it were only accessible from the Shark session that it was created in. Accessing it from a different session would cause a thrown runtime exception (something like a "QueryExecutionException: Table src not found in block manager").