in bigquery-antipattern-recognition/src/main/java/com/google/zetasql/toolkit/antipattern/parser/visitors/IdentifySimpleSelectStarVisitor.java [40:63]
public void visit(ASTNodes.ASTSelect selectNode) {
selectNode
.getSelectList()
.getColumns()
.forEach(
selectColumnNode -> {
if (selectColumnNode
.getExpression()
.nodeKindString()
.equals(SELECT_STAR_NODE_KIND_STRING)) {
if (selectNode.getFromClause().getTableExpression()
instanceof ASTTablePathExpression) {
String idString =
((ASTTablePathExpression) selectNode.getFromClause().getTableExpression())
.getPathExpr()
.getNames()
.get(0)
.getIdString();
result.add(String.format(SUGGESTION_MESSAGE, idString));
}
}
});
super.visit(selectNode);
}