### Question:
RelToSqlConverter extends SqlImplementor implements ReflectiveVisitor { private SqlCall as(SqlNode e, String alias) { return SqlStdOperatorTable.AS.createCall(POS, e, new SqlIdentifier(alias, POS)); } RelToSqlConverter(SqlDialect dialect); Result visitChild(int i, RelNode e); Result visit(RelNode e); Result visit(Join e); Result visit(Correlate e); Result visit(Filter e); Result visit(Project e); Result visit(Aggregate e); Result visit(TableScan e); Result visit(Union e); Result visit(Intersect e); Result visit(Minus e); Result visit(Calc e); Result visit(Values e); Result visit(DruidQuery e); Result visit(Sort e); boolean hasTrickyRollup(Sort e, Aggregate aggregate); Result visit(TableModify modify); Result visit(Match e); Result visit(Uncollect e); List<SqlNode> createAsFullOperands(RelDataType rowType, SqlNode leftOperand,
      String alias); @Override void addSelect(List<SqlNode> selectList, SqlNode node,
      RelDataType rowType);  }### Answer:
@Test public void testSum0BecomesCoalesce() { final RelBuilder builder = relBuilder(); final RelNode root = builder .scan("EMP") .aggregate(builder.groupKey(), builder.aggregateCall(SqlStdOperatorTable.SUM0, builder.field(3)) .as("s")) .build(); final String expectedMysql = "SELECT COALESCE(SUM(`MGR`), 0) AS `s`\n" + "FROM `scott`.`EMP`"; assertThat(toSql(root, SqlDialect.DatabaseProduct.MYSQL.getDialect()), isLinux(expectedMysql)); final String expectedPostgresql = "SELECT COALESCE(SUM(\"MGR\"), 0) AS \"s\"\n" + "FROM \"scott\".\"EMP\""; assertThat(toSql(root, SqlDialect.DatabaseProduct.POSTGRESQL.getDialect()), isLinux(expectedPostgresql)); }