public static void main(String[] args) throws Exception {

    String query = args[0];

    LineageInfo lep = new LineageInfo();

    Context ctx=new Context(new HiveConf());
    lep.getLineageInfo(query, ctx);

    for (String tab : lep.getInputTableList()) {
      System.out.println("InputTable=" + tab);
    }

    for (String tab : lep.getOutputTableList()) {
      System.out.println("OutputTable=" + tab);
    }
  }
parses given query and gets the lineage info.

@param query
ql/src/java/org/apache/hadoop/hive/ql/tools/LineageInfo.java