public void validate(List<String> sqlStmts) throws SamzaSqlValidatorException {
    for (String sql: sqlStmts) {
      SamzaSqlApplicationConfig sqlConfig = SamzaSqlDslConverter.getSqlConfig(Collections.singletonList(sql), config);
      QueryPlanner planner = SamzaSqlDslConverter.getQueryPlanner(sqlConfig);

      // we always pass only select query to the planner for samza sql. The reason is that samza sql supports
      // schema evolution where source and destination could up to an extent have independent schema evolution while
      // calcite expects strict conformance of the destination schema with that of the fields in the select query.
      SamzaSqlQueryParser.QueryInfo qinfo = SamzaSqlQueryParser.parseQuery(sql);
      RelRoot relRoot;
      try {
        relRoot = planner.plan(qinfo.getSelectQuery());
      } catch (SamzaException e) {
        throw new SamzaSqlValidatorException(String.format("Validation failed for sql stmt:\n%s\n with the following"
            + " error: \n%s\n", sql, e), e);
      }

      // Now that we have logical plan, validate different aspects.
      String sink = qinfo.getSink();
      validate(relRoot, sink, sqlConfig.getRelSchemaProviders().get(sink), sqlConfig.getSamzaRelConverters().get(sink));
    }
  }
Validate a list of sql statements
@param sqlStmts list of sql statements
@throws SamzaSqlValidatorException exception for sql validation
samza-sql/src/main/java/org/apache/samza/sql/planner/SamzaSqlValidator.java