@Test public void testRewrittenQuery() throws LensException { conf.set(JDBCDriverConfConstants.JDBC_IS_ORDERBY_SUPPORTED, TRUE); String query = "select fact.time_key as `Time Key`, sum(fact.dollars_sold) from sales_fact fact group by fact.time_key order " + "by dollars_sold"; SessionState.start(hconf); String actual = qtest.rewrite(query, conf, hconf); String expected = "select ( fact . time_key ) as \"Time Key\" , sum(( fact . dollars_sold )) from sales_fact " + "fact group by ( fact . time_key ) order by dollars_sold asc"; compareQueries(actual, expected); }
@Override public String rewrite(String query, Configuration conf, HiveConf metastoreConf) throws LensException { this.query = query; String reWritten = rewrite(HQLParser.parseHQL(query, metastoreConf), conf, metastoreConf, true); log.info("Rewritten : {}", reWritten); String queryReplacedUdf = replaceUDFForDB(reWritten); log.info("Input Query : {}", query); log.info("Rewritten Query : {}", queryReplacedUdf); return queryReplacedUdf; }
DruidSQLRewriter extends ColumnarSQLRewriter { @Override public String rewrite(String query, Configuration conf, HiveConf metastoreConf) throws LensException { this.query = query; String reWritten = rewrite(HQLParser.parseHQL(query, metastoreConf), conf, metastoreConf, true); log.info("Rewritten : {}", reWritten); String queryReplacedUdf = replaceUDFForDB(reWritten); log.info("Input Query : {}", query); log.info("Rewritten Query : {}", queryReplacedUdf); return queryReplacedUdf; } }
DruidSQLRewriter extends ColumnarSQLRewriter { @Override public String rewrite(String query, Configuration conf, HiveConf metastoreConf) throws LensException { this.query = query; String reWritten = rewrite(HQLParser.parseHQL(query, metastoreConf), conf, metastoreConf, true); log.info("Rewritten : {}", reWritten); String queryReplacedUdf = replaceUDFForDB(reWritten); log.info("Input Query : {}", query); log.info("Rewritten Query : {}", queryReplacedUdf); return queryReplacedUdf; }  }
DruidSQLRewriter extends ColumnarSQLRewriter { @Override public String rewrite(String query, Configuration conf, HiveConf metastoreConf) throws LensException { this.query = query; String reWritten = rewrite(HQLParser.parseHQL(query, metastoreConf), conf, metastoreConf, true); log.info("Rewritten : {}", reWritten); String queryReplacedUdf = replaceUDFForDB(reWritten); log.info("Input Query : {}", query); log.info("Rewritten Query : {}", queryReplacedUdf); return queryReplacedUdf; }  void analyzeInternal(Configuration conf, HiveConf hconf); void buildDruidQuery(Configuration conf, HiveConf hconf); @Override String rewrite(String query, Configuration conf, HiveConf metastoreConf); String rewrite(ASTNode currNode, Configuration conf, HiveConf metastoreConf, boolean resolveNativeTables); }
DruidSQLRewriter extends ColumnarSQLRewriter { @Override public String rewrite(String query, Configuration conf, HiveConf metastoreConf) throws LensException { this.query = query; String reWritten = rewrite(HQLParser.parseHQL(query, metastoreConf), conf, metastoreConf, true); log.info("Rewritten : {}", reWritten); String queryReplacedUdf = replaceUDFForDB(reWritten); log.info("Input Query : {}", query); log.info("Rewritten Query : {}", queryReplacedUdf); return queryReplacedUdf; }  void analyzeInternal(Configuration conf, HiveConf hconf); void buildDruidQuery(Configuration conf, HiveConf hconf); @Override String rewrite(String query, Configuration conf, HiveConf metastoreConf); String rewrite(ASTNode currNode, Configuration conf, HiveConf metastoreConf, boolean resolveNativeTables);  }