use of org.apache.hadoop.hive.ql.hooks.LineageLogger in project hive by apache.
the class TestJdbcWithMiniHS2 method getVerticesFromHooks.
/**
* Use the logic in LineageLogger to get vertices from Hook Contexts
*/
private List<Set<LineageLogger.Vertex>> getVerticesFromHooks() {
List<Set<LineageLogger.Vertex>> verticesLists = new ArrayList<>();
List<HookContext> hookList = ReadableHook.getHookList();
for (HookContext hookContext : hookList) {
QueryPlan plan = hookContext.getQueryPlan();
LineageCtx.Index index = hookContext.getIndex();
assertNotNull(index);
List<LineageLogger.Edge> edges = LineageLogger.getEdges(plan, index);
Set<LineageLogger.Vertex> vertices = LineageLogger.getVertices(edges);
verticesLists.add(vertices);
}
return verticesLists;
}
Aggregations