in bigquery-antipattern-recognition/src/main/java/com/google/zetasql/toolkit/antipattern/parser/visitors/IdentifyCTEsEvalMultipleTimesVisitor.java [97:113]
public void visit(ASTTablePathExpression tablePathExpression) {
// Loop through all the identifiers in the table path expression.
if(tablePathExpression.getPathExpr() != null) {
tablePathExpression
.getPathExpr()
.getNames()
.forEach(
identifier -> {
// Get the identifier as a string in lower case.
String table = identifier.getIdString().toLowerCase();
// If the count map contains the identifier, increment its count.
if (cteCountMap.containsKey(table)) {
cteCountMap.put(table, cteCountMap.get(table) + 1);
}
});
}
}