private String replaceTableNames(String source) {
    for (String table : srcTables) {
      source = source.replaceAll("(?is)(\\s+)(" + table + ")([\\s;\\n\\),])", "$1default.$2$3");
    }
    return source;
  }
Replace the default src database TABLE_NAMEs in the queries with default.TABLE_NAME, like
src->default.src, srcpart->default.srcpart, so the queries could be run even if the used
database is query specific. This change is only a best effort, since we do not want to parse
the queries, we could not be sure that we do not replace other strings which are not
tablenames. Like 'select src from othertable;'. The q files containing these commands should
be excluded. Only replace the tablenames, if rewriteSourceTables is set.
@param source The original query string
@return The query string where the tablenames are replaced
itests/util/src/main/java/org/apache/hive/beeline/QFile.java