chore: remove duplicates of validate_adhoc_subquery
#24023
Merged
validate_adhoc_subquery
#24023