public static void init(String queryRewritersClassNamesStr) {
    List<String> queryRewritersClassNames =
        (queryRewritersClassNamesStr != null) ? Arrays.asList(queryRewritersClassNamesStr.split(","))
            : DEFAULT_QUERY_REWRITERS_CLASS_NAMES;
    final List<QueryRewriter> queryRewriters = getQueryRewriters(queryRewritersClassNames);
    synchronized (CalciteSqlParser.class) {
      CalciteSqlParser.QUERY_REWRITERS.clear();
      CalciteSqlParser.QUERY_REWRITERS.addAll(queryRewriters);
    }
  }
@Test
  public void testQueryRewriters() {
    // Default behavior
    QueryRewriterFactory.init(null);
    Assert.assertEquals(QUERY_REWRITERS.size(), 6);
    Assert.assertTrue(QUERY_REWRITERS.get(0) instanceof CompileTimeFunctionsInvoker);
    Assert.assertTrue(QUERY_REWRITERS.get(1) instanceof SelectionsRewriter);
    Assert.assertTrue(QUERY_REWRITERS.get(2) instanceof PredicateComparisonRewriter);
    Assert.assertTrue(QUERY_REWRITERS.get(3) instanceof AliasApplier);
    Assert.assertTrue(QUERY_REWRITERS.get(4) instanceof OrdinalsUpdater);
    Assert.assertTrue(QUERY_REWRITERS.get(5) instanceof NonAggregationGroupByToDistinctQueryRewriter);

    // Check init with other configs
    QueryRewriterFactory.init("org.apache.pinot.sql.parsers.rewriter.PredicateComparisonRewriter,"
        + "org.apache.pinot.sql.parsers.rewriter.CompileTimeFunctionsInvoker,"
        + "org.apache.pinot.sql.parsers.rewriter.SelectionsRewriter");
    Assert.assertEquals(QUERY_REWRITERS.size(), 3);
    Assert.assertTrue(QUERY_REWRITERS.get(0) instanceof PredicateComparisonRewriter);
    Assert.assertTrue(QUERY_REWRITERS.get(1) instanceof CompileTimeFunctionsInvoker);
    Assert.assertTrue(QUERY_REWRITERS.get(2) instanceof SelectionsRewriter);

    // Revert back to default behavior
    QueryRewriterFactory.init(null);
    Assert.assertEquals(QUERY_REWRITERS.size(), 6);
    Assert.assertTrue(QUERY_REWRITERS.get(0) instanceof CompileTimeFunctionsInvoker);
    Assert.assertTrue(QUERY_REWRITERS.get(1) instanceof SelectionsRewriter);
    Assert.assertTrue(QUERY_REWRITERS.get(2) instanceof PredicateComparisonRewriter);
    Assert.assertTrue(QUERY_REWRITERS.get(3) instanceof AliasApplier);
    Assert.assertTrue(QUERY_REWRITERS.get(4) instanceof OrdinalsUpdater);
    Assert.assertTrue(QUERY_REWRITERS.get(5) instanceof NonAggregationGroupByToDistinctQueryRewriter);
  }