@Test public void testDefect12107() throws Exception{ QueryMetadataInterface metadata = RealMetadataFactory.example1Cached(); String sql = "SELECT SUM(DISTINCT lookup('pm1.g1', 'e2', 'e2', e2)) FROM pm1.g1"; Command command = helpResolve(sql, metadata); sql = "SELECT SUM(DISTINCT lookup('pm1.g1', 'e3', 'e2', e2)) FROM pm1.g1"; command = helpResolve(sql, metadata); ValidatorReport report = Validator.validate(command, metadata); assertEquals("The aggregate function SUM cannot be used with non-numeric expressions: SUM(DISTINCT lookup('pm1.g1', 'e3', 'e2', e2))", report.toString()); }
public static final ValidatorReport validate(LanguageObject object, QueryMetadataInterface metadata) throws TeiidComponentException { ValidatorReport report1 = Validator.validate(object, metadata, new ValidationVisitor()); return report1; }
Validator { public static final ValidatorReport validate(LanguageObject object, QueryMetadataInterface metadata) throws TeiidComponentException { ValidatorReport report1 = Validator.validate(object, metadata, new ValidationVisitor()); return report1; } }
Validator { public static final ValidatorReport validate(LanguageObject object, QueryMetadataInterface metadata) throws TeiidComponentException { ValidatorReport report1 = Validator.validate(object, metadata, new ValidationVisitor()); return report1; }  }
Validator { public static final ValidatorReport validate(LanguageObject object, QueryMetadataInterface metadata) throws TeiidComponentException { ValidatorReport report1 = Validator.validate(object, metadata, new ValidationVisitor()); return report1; }  static final ValidatorReport validate(LanguageObject object, QueryMetadataInterface metadata); static final ValidatorReport validate(LanguageObject object, QueryMetadataInterface metadata, AbstractValidationVisitor visitor); }
Validator { public static final ValidatorReport validate(LanguageObject object, QueryMetadataInterface metadata) throws TeiidComponentException { ValidatorReport report1 = Validator.validate(object, metadata, new ValidationVisitor()); return report1; }  static final ValidatorReport validate(LanguageObject object, QueryMetadataInterface metadata); static final ValidatorReport validate(LanguageObject object, QueryMetadataInterface metadata, AbstractValidationVisitor visitor);  }