code: public static RoutingEngine newInstance(final ShardingRule shardingRule,
                                              final ShardingDataSourceMetaData shardingDataSourceMetaData, final SQLStatement sqlStatement, final OptimizeResult optimizeResult) {
          Collection<String> tableNames = sqlStatement.getTables().getTableNames();
          if (SQLType.TCL == sqlStatement.getType()) {
              return new DatabaseBroadcastRoutingEngine(shardingRule);
          }
          if (SQLType.DDL == sqlStatement.getType()) {
              return new TableBroadcastRoutingEngine(shardingRule, sqlStatement);
          }
          if (SQLType.DAL == sqlStatement.getType()) {
              return getDALRoutingEngine(shardingRule, sqlStatement, tableNames);
          }
          if (SQLType.DCL == sqlStatement.getType()) {
              return getDCLRoutingEngine(shardingRule, sqlStatement, shardingDataSourceMetaData);
          }
          if (shardingRule.isAllInDefaultDataSource(tableNames)) {
              return new DefaultDatabaseRoutingEngine(shardingRule, tableNames);
          }
          if (shardingRule.isAllBroadcastTables(tableNames)) {
              return SQLType.DQL == sqlStatement.getType() ? new UnicastRoutingEngine(shardingRule, tableNames) : new DatabaseBroadcastRoutingEngine(shardingRule);
          }
          if (optimizeResult.getShardingConditions().isAlwaysFalse() || tableNames.isEmpty()) {
              return new UnicastRoutingEngine(shardingRule, tableNames);
          }
          Collection<String> shardingTableNames = shardingRule.getShardingLogicTableNames(tableNames);
          if (1 == shardingTableNames.size() || shardingRule.isAllBindingTables(shardingTableNames)) {
              return new StandardRoutingEngine(sqlStatement, shardingRule, shardingTableNames.iterator().next(), optimizeResult);
          }
          // TODO config for cartesian set
          return new ComplexRoutingEngine(sqlStatement, shardingRule, tableNames, optimizeResult);
      }
docs: Create new instance of routing engine.
  
  @param shardingRule sharding rule
  @param shardingDataSourceMetaData sharding data source meta data
  @param sqlStatement sql statement
  @param optimizeResult optimize result
  @return new instance of routing engine