LAMDAS: LLM as an Implicit Classifier for Domain-specific Data Selection