> On March 25, 2015, 7:49 a.m., Himanshu Gahlaut wrote: > > lens-cube/src/main/java/org/apache/lens/driver/cube/RewriterPlan.java, line > > 58 > > <https://reviews.apache.org/r/32393/diff/3/?file=904236#file904236line58> > > > > can we create below method in CubeQueryContext class which can be > > reused in other places in the code as well ? > > > > public void getOrderByCount() { > > if (getOrderByAST() != null) { > > return ctx.getOrderByAST().getChildCount(); > > } > > return 0; > > } > > > > On similar lines, we can create below methods in CubeQueryContext: > > getGroupByCount() > > getHavingCount() > > getSelectCount() > > > > null checks would move to methods inside CubeQueryContext class. This > > will reduce the number of lines of code here and also at other places in > > future which might require these count methods. Also if there is a change > > in counting logic, it will be restricted to one place in CubeQueryContext > > class. > > Himanshu Gahlaut wrote: > Correcting the code sample in above comment: > > public int getOrderByCount() { > if (getOrderByAST() != null) { > return getOrderByAST().getChildCount(); > } > return 0; > }
Planning to remove all these counts from queryplan altogether, as there are issues with counts right now. Follow up ticket for the same - https://issues.apache.org/jira/browse/LENS-437. Not doing the changes as they will be throw away. - Amareshwari ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/32393/#review77716 ----------------------------------------------------------- On March 24, 2015, 12:41 p.m., Amareshwari Sriramadasu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/32393/ > ----------------------------------------------------------- > > (Updated March 24, 2015, 12:41 p.m.) > > > Review request for lens, Jaideep dhok and Rajat Khandelwal. > > > Bugs: LENS-323 > https://issues.apache.org/jira/browse/LENS-323 > > > Repository: lens > > > Description > ------- > > All changes are complete. Changes include: > > - Generating rewriter plan with cube queries involved > - Populating FactPartitions queried in RewriterPlan > - priority getting set only for cube queries; native tables queries are left > with defaults > - TestHiveDriver.testPriority updated > - Fix other test failures > - Clear transient state in QueryContext after launch. > - Add unit tests for rewriter plan construction > > > Diffs > ----- > > lens-cube/src/main/java/org/apache/lens/cube/parse/CandidateDim.java > 3ac207e > lens-cube/src/main/java/org/apache/lens/cube/parse/CandidateFact.java > 66c3b25 > lens-cube/src/main/java/org/apache/lens/cube/parse/CandidateTable.java > 5eaf7ec > lens-cube/src/main/java/org/apache/lens/cube/parse/CubeQueryContext.java > df5a212 > > lens-cube/src/main/java/org/apache/lens/cube/parse/StorageTableResolver.java > c29d88f > lens-cube/src/main/java/org/apache/lens/driver/cube/RewriteUtil.java > 8ed4070 > lens-cube/src/main/java/org/apache/lens/driver/cube/RewriterPlan.java > PRE-CREATION > lens-cube/src/test/java/org/apache/lens/cube/parse/CubeTestSetup.java > 4888ae1 > lens-cube/src/test/java/org/apache/lens/cube/parse/TestRewriterPlan.java > PRE-CREATION > lens-driver-hive/pom.xml 3b8e73a > lens-driver-hive/src/main/java/org/apache/lens/driver/hive/HiveDriver.java > 9e3c723 > > lens-driver-hive/src/main/java/org/apache/lens/driver/hive/HiveQueryPlan.java > 64a6bba > > lens-driver-hive/src/main/java/org/apache/lens/driver/hive/priority/DurationBasedQueryPriorityDecider.java > 4f471cb > > lens-driver-hive/src/test/java/org/apache/lens/driver/hive/TestHiveDriver.java > 8a5839b > lens-driver-hive/src/test/resources/priority_tests.data 230df95 > > lens-server-api/src/main/java/org/apache/lens/server/api/driver/DriverQueryPlan.java > 38ebc55 > > lens-server-api/src/main/java/org/apache/lens/server/api/query/AbstractQueryContext.java > 5233569 > > lens-server-api/src/main/java/org/apache/lens/server/api/query/DriverSelectorQueryContext.java > fef834f > > lens-server-api/src/test/java/org/apache/lens/server/api/driver/MockDriver.java > 67c73b8 > > lens-server/src/main/java/org/apache/lens/server/query/QueryExecutionServiceImpl.java > 390071c > > Diff: https://reviews.apache.org/r/32393/diff/ > > > Testing > ------- > > [INFO] > ------------------------------------------------------------------------ > [INFO] Reactor Summary: > [INFO] > [INFO] Lens Checkstyle Rules ............................. SUCCESS [1.919s] > [INFO] Lens .............................................. SUCCESS [1.576s] > [INFO] Lens API .......................................... SUCCESS [5.225s] > [INFO] Lens API for server and extensions ................ SUCCESS [7.120s] > [INFO] Lens Cube ......................................... SUCCESS [2:09.347s] > [INFO] Lens DB storage ................................... SUCCESS [10.140s] > [INFO] Lens Query Library ................................ SUCCESS [4.501s] > [INFO] Lens Hive Driver .................................. SUCCESS [2:34.637s] > [INFO] Lens Driver for JDBC .............................. SUCCESS [19.133s] > [INFO] Lens Server ....................................... SUCCESS [4:24.467s] > [INFO] Lens client ....................................... SUCCESS [20.594s] > [INFO] Lens CLI .......................................... SUCCESS [2:50.050s] > [INFO] Lens Examples ..................................... SUCCESS [0.932s] > [INFO] Lens Distribution ................................. SUCCESS [9.395s] > [INFO] Lens ML Lib ....................................... SUCCESS [1:01.658s] > [INFO] Lens ML Ext Distribution .......................... SUCCESS [2.549s] > [INFO] Lens Regression ................................... SUCCESS [0.462s] > [INFO] > ------------------------------------------------------------------------ > [INFO] BUILD SUCCESS > [INFO] > ------------------------------------------------------------------------ > [INFO] Total time: 14:24.771s > [INFO] Finished at: Tue Mar 24 12:39:58 UTC 2015 > [INFO] Final Memory: 106M/1097M > [INFO] > ------------------------------------------------------------------------ > > > Thanks, > > Amareshwari Sriramadasu > >
