BeamSqlCli { public String explainQuery(String sqlString) throws ParseException { return env.explain(sqlString); }  BeamSqlCli metaStore(MetaStore metaStore); BeamSqlCli metaStore(
      MetaStore metaStore, boolean autoLoadUdfUdaf, PipelineOptions pipelineOptions); MetaStore getMetaStore(); String explainQuery(String sqlString); void execute(String sqlString);  }
@Test public void testExplainQuery() throws Exception { InMemoryMetaStore metaStore = new InMemoryMetaStore(); metaStore.registerProvider(new TextTableProvider()); BeamSqlCli cli = new BeamSqlCli().metaStore(metaStore); cli.execute( "CREATE EXTERNAL TABLE person (\n" + "id int COMMENT 'id', \n" + "name varchar COMMENT 'name', \n" + "age int COMMENT 'age') \n" + "TYPE 'text' \n" + "COMMENT '' LOCATION '/home/admin/orders'"); String plan = cli.explainQuery("select * from person"); assertThat( plan, equalTo( "BeamCalcRel(expr#0..2=[{inputs}], proj#0..2=[{exprs}])\n" + " BeamIOSourceRel(table=[[beam, person]])\n")); }