use of com.yahoo.elide.datastores.aggregation.query.ColumnProjection in project elide by yahoo.
the class LogicalReferenceExtractorTest method testPhysicalReference.
@Test
public void testPhysicalReference() {
ColumnProjection recordedDate = playerStats.getColumnProjection("recordedDate");
List<Reference> references = parser.parse(playerStats, recordedDate.getExpression());
assertTrue(references.size() == 1);
ReferenceExtractor<LogicalReference> extractor = new ReferenceExtractor(LogicalReference.class, metaDataStore, ReferenceExtractor.Mode.SAME_QUERY);
Set<LogicalReference> logicalReferences = references.get(0).accept(extractor);
assertTrue(logicalReferences.size() == 0);
}
use of com.yahoo.elide.datastores.aggregation.query.ColumnProjection in project elide by yahoo.
the class LogicalReferenceExtractorTest method testJoinReference.
@Test
public void testJoinReference() {
ColumnProjection countryIsInUsa = playerStats.getColumnProjection("countryIsInUsa");
List<Reference> references = parser.parse(playerStats, countryIsInUsa.getExpression());
assertTrue(references.size() == 1);
ReferenceExtractor<LogicalReference> extractor = new ReferenceExtractor(LogicalReference.class, metaDataStore, ReferenceExtractor.Mode.SAME_QUERY);
Set<LogicalReference> logicalReferences = references.get(0).accept(extractor);
assertEquals(0, logicalReferences.size());
}
use of com.yahoo.elide.datastores.aggregation.query.ColumnProjection in project elide by yahoo.
the class PhysicalReferenceExtractorTest method testLogicalReference.
@Test
public void testLogicalReference() {
ColumnProjection playerLevel = playerStats.getColumnProjection("playerLevel");
List<Reference> references = parser.parse(playerStats, playerLevel.getExpression());
assertTrue(references.size() == 1);
ReferenceExtractor<PhysicalReference> extractor = new ReferenceExtractor(PhysicalReference.class, metaDataStore, ReferenceExtractor.Mode.SAME_QUERY);
Set<PhysicalReference> physicalReferences = references.get(0).accept(extractor);
assertEquals(1, physicalReferences.size());
assertTrue(physicalReferences.contains(PhysicalReference.builder().source(playerStats).name("overallRating").build()));
}
use of com.yahoo.elide.datastores.aggregation.query.ColumnProjection in project elide by yahoo.
the class PhysicalReferenceExtractorTest method testJoinReference.
@Test
public void testJoinReference() {
ColumnProjection countryIsInUsa = playerStats.getColumnProjection("countryIsInUsa");
List<Reference> references = parser.parse(playerStats, countryIsInUsa.getExpression());
assertTrue(references.size() == 1);
ReferenceExtractor<PhysicalReference> extractor = new ReferenceExtractor(PhysicalReference.class, metaDataStore, ReferenceExtractor.Mode.SAME_QUERY);
Set<PhysicalReference> physicalReferences = references.get(0).accept(extractor);
assertEquals(1, physicalReferences.size());
assertTrue(physicalReferences.contains(PhysicalReference.builder().source(playerStats).name("country_id").build()));
}
use of com.yahoo.elide.datastores.aggregation.query.ColumnProjection in project elide by yahoo.
the class SQLColumnProjectionTest method testColumnThatCannotNest.
@Test
public void testColumnThatCannotNest() throws Exception {
SQLTable table = metaDataStore.getTable(ClassType.of(TableA.class));
ColumnProjection projection = table.getColumnProjection("dim1");
assertFalse(projection.canNest(table, metaDataStore));
}
Aggregations