Details
-
New Feature
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
0.9.0
-
None
Description
Add a new command "EXPLAIN DEPENDENCY".
Any query can be passed to EXPLAIN DEPENDENCY as with EXPLAIN (FORMATTED/EXTENDED). The output of this command will be JSON that provides the list of tables and partitions that the query depends on.
One possible use case is to determine the set of tables/views that are used by a view, and the set of partitions that are used by a given query on that view. This will allow a view to be replicated from one Hive instance to another, since we can determine the set of objects that need to be replicated for replication of the view to be successful.
Example output:
{"input_tables":[
,
{"tablename": "default@test_sambavi_v1", "tabletype": "TABLE"}], "input partitions":["default@srcpart@ds=2008-04-08/hr=11","default@srcpart@ds=2008-04-08/hr=12"]}