-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Elide 5 Agg Store: Multiple time grains (#1806)
* Prototype code to add multiple time grains back * Revised test HJSON files * Fixed a bunch of bugs * Revamped all analytic time types * Month Serde tests pass * Added time serde tests * YearSerde tests pass * QuarterSerde tests pass * Second, Minute, Hour, and Day serdes now pass * Week and ISOWeek serde tests pass * Fixed bug in grain validation logic * Fixed more bugs * Fixed most aggregation store tests * Fixed last bug in Aggregation store * Build complete * Added support for conversions to java.sql.Date * Added one multi-grain time dimension model and test * Added multiple time grain fetch unit test * Added failing filter by alias tests * All tests pass but one * Filter by month alias test working * Added sort by alias test * Added new IT test for parameterized time dimensions * Added graphql test DSL unit test * Added dynamic IT tests with multiple time grains * Added tests for ParameterizedModel * Added test for invalid grain * Added GraphQL entity projection maker unit test * Added unit tests for entity hydration * Inspection rework * More inspection rework Co-authored-by: Aaron Klish <[email protected]>
- Loading branch information
Showing
79 changed files
with
1,790 additions
and
828 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
elide-core/src/test/java/com/yahoo/elide/core/type/ParameterizedModelTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* Copyright 2020, Yahoo Inc. | ||
* Licensed under the Apache License, Version 2.0 | ||
* See LICENSE file in project root for terms. | ||
*/ | ||
|
||
package com.yahoo.elide.core.type; | ||
|
||
import static com.yahoo.elide.core.type.ClassType.STRING_TYPE; | ||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertThrows; | ||
import static org.mockito.Mockito.spy; | ||
import com.yahoo.elide.core.exceptions.InvalidParameterizedAttributeException; | ||
import com.yahoo.elide.core.request.Attribute; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class ParameterizedModelTest { | ||
|
||
@Test | ||
public void testInvoke() { | ||
ParameterizedModel testModel = spy(ParameterizedModel.class); | ||
Attribute testAttribute = Attribute.builder().type(STRING_TYPE).name("foo").build(); | ||
String testValue = "bar"; | ||
|
||
testModel.addAttributeValue(testAttribute, testValue); | ||
|
||
assertEquals(testValue, testModel.invoke(testAttribute)); | ||
} | ||
|
||
@Test | ||
public void testInvokeException() { | ||
ParameterizedModel testModel = spy(ParameterizedModel.class); | ||
Attribute testAttribute = Attribute.builder().type(STRING_TYPE).name("foo").build(); | ||
|
||
Exception exception = assertThrows(InvalidParameterizedAttributeException.class, | ||
() -> testModel.invoke(testAttribute)); | ||
|
||
assertEquals("No attribute found with matching parameters for attribute: Attribute(name=foo)", | ||
exception.getMessage()); | ||
} | ||
|
||
@Test | ||
public void testFetch() { | ||
ParameterizedModel testModel = spy(ParameterizedModel.class); | ||
Attribute testAttribute = Attribute.builder().type(STRING_TYPE).name("foo").build(); | ||
String testValue = "bar"; | ||
|
||
testModel.addAttributeValue(testAttribute, testValue); | ||
|
||
assertEquals(testValue, testModel.fetch(testAttribute.getAlias(), "blah")); | ||
} | ||
|
||
@Test | ||
public void testFetchDefault() { | ||
ParameterizedModel testModel = spy(ParameterizedModel.class); | ||
Attribute testAttribute = Attribute.builder().type(STRING_TYPE).name("foo").build(); | ||
String testValue = "blah"; | ||
|
||
assertEquals(testValue, testModel.fetch(testAttribute.getAlias(), testValue)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.