[3/3] lens git commit: LENS-1412 : Add capability to define virtual facts in a cube
LENS-1412 : Add capability to define virtual facts in a cube Project: http://git-wip-us.apache.org/repos/asf/lens/repo Commit: http://git-wip-us.apache.org/repos/asf/lens/commit/5de45e0f Tree: http://git-wip-us.apache.org/repos/asf/lens/tree/5de45e0f Diff: http://git-wip-us.apache.org/repos/asf/lens/diff/5de45e0f Branch: refs/heads/master Commit: 5de45e0f8212c2e03eaf9886b720e13868a1c42a Parents: 34500f1 Author: Rajitha R Authored: Tue Jun 6 13:59:58 2017 +0530 Committer: Amareshwari Sriramadasu Committed: Tue Jun 6 13:59:58 2017 +0530 -- .../lens/api/metastore/SchemaTraverser.java | 1 + lens-api/src/main/resources/cube-0.1.xsd| 176 +++ lens-api/src/main/resources/lens-errors.conf| 6 + .../lens/cli/commands/LensFactCommands.java | 6 +- .../lens/cli/commands/LensSchemaCommands.java | 18 +- .../apache/lens/cli/TestLensFactCommands.java | 132 +- .../apache/lens/cli/TestLensSchemaCommands.java | 2 +- .../schema/cubes/base/virtual-cube.xml | 30 ++ .../resources/schema/facts/virtual_fact.xml | 28 ++ .../java/org/apache/lens/client/LensClient.java | 2 +- .../apache/lens/client/LensMetadataClient.java | 18 +- .../lens/cube/error/LensCubeErrorCode.java | 3 +- .../lens/cube/metadata/AbstractCubeTable.java | 22 +- .../lens/cube/metadata/CubeFactTable.java | 52 ++- .../lens/cube/metadata/CubeMetastoreClient.java | 463 ++- .../cube/metadata/CubeVirtualFactTable.java | 186 .../apache/lens/cube/metadata/FactTable.java| 166 +++ .../apache/lens/cube/metadata/JAXBUtils.java| 24 +- .../lens/cube/metadata/MetastoreConstants.java | 2 + .../lens/cube/metadata/MetastoreUtil.java | 26 +- .../apache/lens/cube/metadata/Segmentation.java | 13 +- .../org/apache/lens/cube/parse/Candidate.java | 8 +- .../lens/cube/parse/CandidateTableResolver.java | 11 +- .../lens/cube/parse/StorageCandidate.java | 55 +-- .../cube/parse/StorageCandidateHQLContext.java | 12 +- .../lens/cube/parse/StorageTableResolver.java | 5 +- .../lens/cube/metadata/CubeFactTableTest.java | 12 +- .../cube/metadata/TestCubeMetastoreClient.java | 123 - .../apache/lens/cube/parse/CubeTestSetup.java | 40 +- .../lens/cube/parse/TestCubeRewriter.java | 16 + .../parse/TestCubeSegmentationRewriter.java | 15 +- .../lens/cube/parse/TestUnionQueries.java | 2 +- .../resources/schema/cubes/base/virtualcube.xml | 36 ++ .../test/resources/schema/facts/virtualfact.xml | 27 ++ lens-driver-es/pom.xml | 3 +- lens-examples/pom.xml | 3 +- .../src/test/resources/yaml/fact1.yaml | 4 +- .../src/test/resources/yaml/fact2.yaml | 4 +- .../src/test/resources/yaml/rawfact.yaml| 4 +- .../yaml/sales-aggr-continuous-fact.yaml| 4 +- .../test/resources/yaml/sales-aggr-fact1.yaml | 4 +- .../test/resources/yaml/sales-aggr-fact2.yaml | 4 +- .../src/test/resources/yaml/sales-raw-fact.yaml | 4 +- .../api/metastore/CubeMetastoreService.java | 8 +- lens-server/pom.xml | 2 +- .../metastore/CubeMetastoreServiceImpl.java | 24 +- .../server/metastore/MetastoreResource.java | 17 +- .../lens/server/common/RestAPITestUtil.java | 7 +- .../server/metastore/TestMetastoreService.java | 274 ++- src/site/apt/user/cli.apt | 3 +- tools/scripts/generate-site-public.sh | 2 +- 51 files changed, 1646 insertions(+), 463 deletions(-) -- http://git-wip-us.apache.org/repos/asf/lens/blob/5de45e0f/lens-api/src/main/java/org/apache/lens/api/metastore/SchemaTraverser.java -- diff --git a/lens-api/src/main/java/org/apache/lens/api/metastore/SchemaTraverser.java b/lens-api/src/main/java/org/apache/lens/api/metastore/SchemaTraverser.java index 9564443..09c848a 100644 --- a/lens-api/src/main/java/org/apache/lens/api/metastore/SchemaTraverser.java +++ b/lens-api/src/main/java/org/apache/lens/api/metastore/SchemaTraverser.java @@ -42,6 +42,7 @@ public class SchemaTraverser implements Runnable { types.put("cubes/derived", XDerivedCube.class); types.put("dimensions", XDimension.class); types.put("facts", XFactTable.class); +types.put("facts/virtual", XVirtualFactTable.class); types.put("dimtables", XDimensionTable.class); types.put("dimensiontables", XDimensionTable.class); types.put("dimensiontables", XDimensionTable.class); http://git-wip-us.apache.org/repos/asf/lens/blob/5de45e0f/lens-api/src/main/resources/cube-0.1.xsd -- diff --git a/lens-api/src/main/resources/cube-0.1.xsd b/lens-api/src/main/reso
[3/3] lens git commit: LENS-1412 : Add capability to define virtual facts in a cube
LENS-1412 : Add capability to define virtual facts in a cube Project: http://git-wip-us.apache.org/repos/asf/lens/repo Commit: http://git-wip-us.apache.org/repos/asf/lens/commit/27ad9aa8 Tree: http://git-wip-us.apache.org/repos/asf/lens/tree/27ad9aa8 Diff: http://git-wip-us.apache.org/repos/asf/lens/diff/27ad9aa8 Branch: refs/heads/current-release-line Commit: 27ad9aa8f27082a8ac6d82cbf91fff80b43ab689 Parents: 7c1171c Author: Rajitha R Authored: Tue Jun 6 13:59:58 2017 +0530 Committer: Amareshwari Sriramadasu Committed: Tue Jun 6 14:01:49 2017 +0530 -- .../lens/api/metastore/SchemaTraverser.java | 1 + lens-api/src/main/resources/cube-0.1.xsd| 176 +++ lens-api/src/main/resources/lens-errors.conf| 6 + .../lens/cli/commands/LensFactCommands.java | 6 +- .../lens/cli/commands/LensSchemaCommands.java | 18 +- .../apache/lens/cli/TestLensFactCommands.java | 132 +- .../apache/lens/cli/TestLensSchemaCommands.java | 2 +- .../schema/cubes/base/virtual-cube.xml | 30 ++ .../resources/schema/facts/virtual_fact.xml | 28 ++ .../java/org/apache/lens/client/LensClient.java | 2 +- .../apache/lens/client/LensMetadataClient.java | 18 +- .../lens/cube/error/LensCubeErrorCode.java | 3 +- .../lens/cube/metadata/AbstractCubeTable.java | 22 +- .../lens/cube/metadata/CubeFactTable.java | 52 ++- .../lens/cube/metadata/CubeMetastoreClient.java | 463 ++- .../cube/metadata/CubeVirtualFactTable.java | 186 .../apache/lens/cube/metadata/FactTable.java| 166 +++ .../apache/lens/cube/metadata/JAXBUtils.java| 24 +- .../lens/cube/metadata/MetastoreConstants.java | 2 + .../lens/cube/metadata/MetastoreUtil.java | 26 +- .../apache/lens/cube/metadata/Segmentation.java | 13 +- .../org/apache/lens/cube/parse/Candidate.java | 8 +- .../lens/cube/parse/CandidateTableResolver.java | 11 +- .../lens/cube/parse/StorageCandidate.java | 55 +-- .../cube/parse/StorageCandidateHQLContext.java | 12 +- .../lens/cube/parse/StorageTableResolver.java | 5 +- .../lens/cube/metadata/CubeFactTableTest.java | 12 +- .../cube/metadata/TestCubeMetastoreClient.java | 123 - .../apache/lens/cube/parse/CubeTestSetup.java | 40 +- .../lens/cube/parse/TestCubeRewriter.java | 16 + .../parse/TestCubeSegmentationRewriter.java | 15 +- .../lens/cube/parse/TestUnionQueries.java | 2 +- .../resources/schema/cubes/base/virtualcube.xml | 36 ++ .../test/resources/schema/facts/virtualfact.xml | 27 ++ lens-driver-es/pom.xml | 3 +- lens-examples/pom.xml | 3 +- .../src/test/resources/yaml/fact1.yaml | 4 +- .../src/test/resources/yaml/fact2.yaml | 4 +- .../src/test/resources/yaml/rawfact.yaml| 4 +- .../yaml/sales-aggr-continuous-fact.yaml| 4 +- .../test/resources/yaml/sales-aggr-fact1.yaml | 4 +- .../test/resources/yaml/sales-aggr-fact2.yaml | 4 +- .../src/test/resources/yaml/sales-raw-fact.yaml | 4 +- .../api/metastore/CubeMetastoreService.java | 8 +- lens-server/pom.xml | 2 +- .../metastore/CubeMetastoreServiceImpl.java | 24 +- .../server/metastore/MetastoreResource.java | 17 +- .../lens/server/common/RestAPITestUtil.java | 7 +- .../server/metastore/TestMetastoreService.java | 274 ++- src/site/apt/user/cli.apt | 3 +- tools/scripts/generate-site-public.sh | 2 +- 51 files changed, 1646 insertions(+), 463 deletions(-) -- http://git-wip-us.apache.org/repos/asf/lens/blob/27ad9aa8/lens-api/src/main/java/org/apache/lens/api/metastore/SchemaTraverser.java -- diff --git a/lens-api/src/main/java/org/apache/lens/api/metastore/SchemaTraverser.java b/lens-api/src/main/java/org/apache/lens/api/metastore/SchemaTraverser.java index 9564443..09c848a 100644 --- a/lens-api/src/main/java/org/apache/lens/api/metastore/SchemaTraverser.java +++ b/lens-api/src/main/java/org/apache/lens/api/metastore/SchemaTraverser.java @@ -42,6 +42,7 @@ public class SchemaTraverser implements Runnable { types.put("cubes/derived", XDerivedCube.class); types.put("dimensions", XDimension.class); types.put("facts", XFactTable.class); +types.put("facts/virtual", XVirtualFactTable.class); types.put("dimtables", XDimensionTable.class); types.put("dimensiontables", XDimensionTable.class); types.put("dimensiontables", XDimensionTable.class); http://git-wip-us.apache.org/repos/asf/lens/blob/27ad9aa8/lens-api/src/main/resources/cube-0.1.xsd -- diff --git a/lens-api/src/main/resources/cube-0.1.xsd b/lens-api