Uploaded image for project: 'Apache Lens (Retired)'
  1. Apache Lens (Retired)
  2. LENS-927

Test case failing org.apache.lens.cube.parse.TestDenormalizationResolver.testDenormsAsDirectFields()

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.5
    • 2.5
    • cube
    • None

    Description

      Error Message

      expected [Actual Query: select dim3chain.name, testcube.dim2big1, max(testcube.msr3), sum(testcube.msr2) FROM TestQueryRewrite.C2_summary4 testCube JOIN TestQueryRewrite.c2_testdim2tbl3 dim2chain on testcube.dim2big1 = dim2chain.bigid1 join TestQueryRewrite.c2_testdim3tbl dim3chain on dim2chain.testdim3id = dim3chain.id WHERE ((testCube.it = '2016-01-17-04') OR (testCube.it = '2016-01-17-05') OR (testCube.it = '2016-01-17-06') OR (testCube.it = '2016-01-17-07') OR (testCube.it = '2016-01-17-08') OR (testCube.it = '2016-01-17-09') OR (testCube.it = '2016-01-17-10') OR (testCube.it = '2016-01-17-11') OR (testCube.it = '2016-01-17-12') OR (testCube.it = '2016-01-17-13') OR (testCube.it = '2016-01-17-14') OR (testCube.it = '2016-01-17-15') OR (testCube.it = '2016-01-17-16') OR (testCube.it = '2016-01-17-17') OR (testCube.it = '2016-01-17-18') OR (testCube.it = '2016-01-17-19') OR (testCube.it = '2016-01-17-20') OR (testCube.it = '2016-01-17-21') OR (testCube.it = '2016-01-17-22') OR (testCube.it = '2016-01-17-23') OR (testCube.it = '2016-01-18') OR (testCube.it = '2016-01-19-00') OR (testCube.it = '2016-01-19-01') OR (testCube.it = '2016-01-19-02') OR (testCube.it = '2016-01-19-03')) group by dim3chain.name, (testcube.dim2big1)
      JoinQueryString: {JOIN=[TESTQUERYREWRITEC2_TESTDIM2TBL3DIM2CHAINONTESTCUBEDIM2BIG1DIM2CHAINBIGID1, TESTQUERYREWRITEC2_TESTDIM3TBLDIM3CHAINONDIM2CHAINTESTDIM3IDDIM3CHAINID]}] but found [Actual Query: SELECT ( dim3chain . name ), ( testcube . dim2big1 ), max(( testcube . msr3 )), sum(( testcube . msr2 )) FROM TestQueryRewrite.c2_summary4 testcube join TestQueryRewrite.c2_testdim2tbl3 testdim2 on testcube.dim2big1 = testdim2.bigid1 join TestQueryRewrite.c2_testdim3tbl dim3chain on testdim2.testdim3id = dim3chain.id WHERE (((((((((((((((((((((((((((( testcube . it ) =  '2016-01-17-04' ) or (( testcube . it ) =  '2016-01-17-05' )) or (( testcube . it ) =  '2016-01-17-06' )) or (( testcube . it ) =  '2016-01-17-07' )) or (( testcube . it ) =  '2016-01-17-08' )) or (( testcube . it ) =  '2016-01-17-09' )) or (( testcube . it ) =  '2016-01-17-10' )) or (( testcube . it ) =  '2016-01-17-11' )) or (( testcube . it ) =  '2016-01-17-12' )) or (( testcube . it ) =  '2016-01-17-13' )) or (( testcube . it ) =  '2016-01-17-14' )) or (( testcube . it ) =  '2016-01-17-15' )) or (( testcube . it ) =  '2016-01-17-16' )) or (( testcube . it ) =  '2016-01-17-17' )) or (( testcube . it ) =  '2016-01-17-18' )) or (( testcube . it ) =  '2016-01-17-19' )) or (( testcube . it ) =  '2016-01-17-20' )) or (( testcube . it ) =  '2016-01-17-21' )) or (( testcube . it ) =  '2016-01-17-22' )) or (( testcube . it ) =  '2016-01-17-23' )) or (( testcube . it ) =  '2016-01-18' )) or (( testcube . it ) =  '2016-01-19-00' )) or (( testcube . it ) =  '2016-01-19-01' )) or (( testcube . it ) =  '2016-01-19-02' )) or (( testcube . it ) =  '2016-01-19-03' )))) GROUP BY ( dim3chain . name ), ( testcube . dim2big1 )
      JoinQueryString: {JOIN=[TESTQUERYREWRITEC2_TESTDIM2TBL3TESTDIM2ONTESTCUBEDIM2BIG1TESTDIM2BIGID1, TESTQUERYREWRITEC2_TESTDIM3TBLDIM3CHAINONTESTDIM2TESTDIM3IDDIM3CHAINID]}]
      

      Stacktrace

      java.lang.AssertionError: expected [Actual Query: select dim3chain.name, testcube.dim2big1, max(testcube.msr3), sum(testcube.msr2) FROM TestQueryRewrite.C2_summary4 testCube JOIN TestQueryRewrite.c2_testdim2tbl3 dim2chain on testcube.dim2big1 = dim2chain.bigid1 join TestQueryRewrite.c2_testdim3tbl dim3chain on dim2chain.testdim3id = dim3chain.id WHERE ((testCube.it = '2016-01-17-04') OR (testCube.it = '2016-01-17-05') OR (testCube.it = '2016-01-17-06') OR (testCube.it = '2016-01-17-07') OR (testCube.it = '2016-01-17-08') OR (testCube.it = '2016-01-17-09') OR (testCube.it = '2016-01-17-10') OR (testCube.it = '2016-01-17-11') OR (testCube.it = '2016-01-17-12') OR (testCube.it = '2016-01-17-13') OR (testCube.it = '2016-01-17-14') OR (testCube.it = '2016-01-17-15') OR (testCube.it = '2016-01-17-16') OR (testCube.it = '2016-01-17-17') OR (testCube.it = '2016-01-17-18') OR (testCube.it = '2016-01-17-19') OR (testCube.it = '2016-01-17-20') OR (testCube.it = '2016-01-17-21') OR (testCube.it = '2016-01-17-22') OR (testCube.it = '2016-01-17-23') OR (testCube.it = '2016-01-18') OR (testCube.it = '2016-01-19-00') OR (testCube.it = '2016-01-19-01') OR (testCube.it = '2016-01-19-02') OR (testCube.it = '2016-01-19-03')) group by dim3chain.name, (testcube.dim2big1)
      JoinQueryString: {JOIN=[TESTQUERYREWRITEC2_TESTDIM2TBL3DIM2CHAINONTESTCUBEDIM2BIG1DIM2CHAINBIGID1, TESTQUERYREWRITEC2_TESTDIM3TBLDIM3CHAINONDIM2CHAINTESTDIM3IDDIM3CHAINID]}] but found [Actual Query: SELECT ( dim3chain . name ), ( testcube . dim2big1 ), max(( testcube . msr3 )), sum(( testcube . msr2 )) FROM TestQueryRewrite.c2_summary4 testcube join TestQueryRewrite.c2_testdim2tbl3 testdim2 on testcube.dim2big1 = testdim2.bigid1 join TestQueryRewrite.c2_testdim3tbl dim3chain on testdim2.testdim3id = dim3chain.id WHERE (((((((((((((((((((((((((((( testcube . it ) =  '2016-01-17-04' ) or (( testcube . it ) =  '2016-01-17-05' )) or (( testcube . it ) =  '2016-01-17-06' )) or (( testcube . it ) =  '2016-01-17-07' )) or (( testcube . it ) =  '2016-01-17-08' )) or (( testcube . it ) =  '2016-01-17-09' )) or (( testcube . it ) =  '2016-01-17-10' )) or (( testcube . it ) =  '2016-01-17-11' )) or (( testcube . it ) =  '2016-01-17-12' )) or (( testcube . it ) =  '2016-01-17-13' )) or (( testcube . it ) =  '2016-01-17-14' )) or (( testcube . it ) =  '2016-01-17-15' )) or (( testcube . it ) =  '2016-01-17-16' )) or (( testcube . it ) =  '2016-01-17-17' )) or (( testcube . it ) =  '2016-01-17-18' )) or (( testcube . it ) =  '2016-01-17-19' )) or (( testcube . it ) =  '2016-01-17-20' )) or (( testcube . it ) =  '2016-01-17-21' )) or (( testcube . it ) =  '2016-01-17-22' )) or (( testcube . it ) =  '2016-01-17-23' )) or (( testcube . it ) =  '2016-01-18' )) or (( testcube . it ) =  '2016-01-19-00' )) or (( testcube . it ) =  '2016-01-19-01' )) or (( testcube . it ) =  '2016-01-19-02' )) or (( testcube . it ) =  '2016-01-19-03' )))) GROUP BY ( dim3chain . name ), ( testcube . dim2big1 )
      JoinQueryString: {JOIN=[TESTQUERYREWRITEC2_TESTDIM2TBL3TESTDIM2ONTESTCUBEDIM2BIG1TESTDIM2BIGID1, TESTQUERYREWRITEC2_TESTDIM3TBLDIM3CHAINONTESTDIM2TESTDIM3IDDIM3CHAINID]}]
      	at org.testng.Assert.fail(Assert.java:94)
      	at org.testng.Assert.failNotEquals(Assert.java:494)
      	at org.testng.Assert.assertEquals(Assert.java:123)
      	at org.testng.Assert.assertEquals(Assert.java:165)
      	at org.apache.lens.cube.parse.TestCubeRewriter.compareQueries(TestCubeRewriter.java:285)
      	at org.apache.lens.cube.parse.TestDenormalizationResolver.testDenormsAsDirectFields(TestDenormalizationResolver.java:97)
      

      Standard Output

      Configuring TestNG with: TestNG652Configurator
      Tue Jan 01 00:00:00 UTC 2013
      Thu Jan 31 00:00:00 UTC 2013
      Tue Jan 01 00:00:00 UTC 2013
      Fri May 31 00:00:00 UTC 2013
      Tue Jan 01 00:00:00 UTC 2013
      Tue Dec 31 00:00:00 UTC 2013
      Fri Feb 01 00:00:00 UTC 2013
      Thu Apr 25 00:00:00 UTC 2013
      Wed Feb 01 00:00:00 UTC 2012
      Fri Feb 01 00:00:00 UTC 2013
      Tue Feb 01 00:00:00 UTC 2011
      Fri Feb 01 00:00:00 UTC 2013
      Fri Feb 01 00:00:00 UTC 2013
      Thu Feb 21 00:00:00 UTC 2013
      Fri Feb 01 00:00:00 UTC 2013
      Mon Feb 04 00:00:00 UTC 2013
      Test TWODAYS_BACK:Sun Jan 17 04:54:12 UTC 2016
      Test TWO_MONTHS_BACK:Thu Nov 19 04:54:12 UTC 2015
      hql[0]:SELECT ( testcube . cityid ), sum(( testcube . msr2 )) FROM TestQueryRewrite.c2_testfact testcube WHERE (((((((((((((((((((((((((((( testcube . dt ) =  '2016-01-17-04' ) or (( testcube . dt ) =  '2016-01-17-05' )) or (( testcube . dt ) =  '2016-01-17-06' )) or (( testcube . dt ) =  '2016-01-17-07' )) or (( testcube . dt ) =  '2016-01-17-08' )) or (( testcube . dt ) =  '2016-01-17-09' )) or (( testcube . dt ) =  '2016-01-17-10' )) or (( testcube . dt ) =  '2016-01-17-11' )) or (( testcube . dt ) =  '2016-01-17-12' )) or (( testcube . dt ) =  '2016-01-17-13' )) or (( testcube . dt ) =  '2016-01-17-14' )) or (( testcube . dt ) =  '2016-01-17-15' )) or (( testcube . dt ) =  '2016-01-17-16' )) or (( testcube . dt ) =  '2016-01-17-17' )) or (( testcube . dt ) =  '2016-01-17-18' )) or (( testcube . dt ) =  '2016-01-17-19' )) or (( testcube . dt ) =  '2016-01-17-20' )) or (( testcube . dt ) =  '2016-01-17-21' )) or (( testcube . dt ) =  '2016-01-17-22' )) or (( testcube . dt ) =  '2016-01-17-23' )) or (( testcube . dt ) =  '2016-01-18' )) or (( testcube . dt ) =  '2016-01-19-00' )) or (( testcube . dt ) =  '2016-01-19-01' )) or (( testcube . dt ) =  '2016-01-19-02' )) or (( testcube . dt ) =  '2016-01-19-03' )))) GROUP BY ( testcube . cityid )
      hql[1]:SELECT ( testcube . cityid ), (sum(( testcube . msr2 )) * max(( testcube . msr3 ))) FROM TestQueryRewrite.c2_testfact testcube WHERE (((((((((((((((((((((((((((( testcube . dt ) =  '2016-01-17-04' ) or (( testcube . dt ) =  '2016-01-17-05' )) or (( testcube . dt ) =  '2016-01-17-06' )) or (( testcube . dt ) =  '2016-01-17-07' )) or (( testcube . dt ) =  '2016-01-17-08' )) or (( testcube . dt ) =  '2016-01-17-09' )) or (( testcube . dt ) =  '2016-01-17-10' )) or (( testcube . dt ) =  '2016-01-17-11' )) or (( testcube . dt ) =  '2016-01-17-12' )) or (( testcube . dt ) =  '2016-01-17-13' )) or (( testcube . dt ) =  '2016-01-17-14' )) or (( testcube . dt ) =  '2016-01-17-15' )) or (( testcube . dt ) =  '2016-01-17-16' )) or (( testcube . dt ) =  '2016-01-17-17' )) or (( testcube . dt ) =  '2016-01-17-18' )) or (( testcube . dt ) =  '2016-01-17-19' )) or (( testcube . dt ) =  '2016-01-17-20' )) or (( testcube . dt ) =  '2016-01-17-21' )) or (( testcube . dt ) =  '2016-01-17-22' )) or (( testcube . dt ) =  '2016-01-17-23' )) or (( testcube . dt ) =  '2016-01-18' )) or (( testcube . dt ) =  '2016-01-19-00' )) or (( testcube . dt ) =  '2016-01-19-01' )) or (( testcube . dt ) =  '2016-01-19-02' )) or (( testcube . dt ) =  '2016-01-19-03' )))) GROUP BY ( testcube . cityid )
      hql[2]:SELECT ( testcube . cityid ), sum(( testcube . msr2 )) FROM TestQueryRewrite.c2_testfact testcube WHERE (((((((((((((((((((((((((((( testcube . dt ) =  '2016-01-17-04' ) or (( testcube . dt ) =  '2016-01-17-05' )) or (( testcube . dt ) =  '2016-01-17-06' )) or (( testcube . dt ) =  '2016-01-17-07' )) or (( testcube . dt ) =  '2016-01-17-08' )) or (( testcube . dt ) =  '2016-01-17-09' )) or (( testcube . dt ) =  '2016-01-17-10' )) or (( testcube . dt ) =  '2016-01-17-11' )) or (( testcube . dt ) =  '2016-01-17-12' )) or (( testcube . dt ) =  '2016-01-17-13' )) or (( testcube . dt ) =  '2016-01-17-14' )) or (( testcube . dt ) =  '2016-01-17-15' )) or (( testcube . dt ) =  '2016-01-17-16' )) or (( testcube . dt ) =  '2016-01-17-17' )) or (( testcube . dt ) =  '2016-01-17-18' )) or (( testcube . dt ) =  '2016-01-17-19' )) or (( testcube . dt ) =  '2016-01-17-20' )) or (( testcube . dt ) =  '2016-01-17-21' )) or (( testcube . dt ) =  '2016-01-17-22' )) or (( testcube . dt ) =  '2016-01-17-23' )) or (( testcube . dt ) =  '2016-01-18' )) or (( testcube . dt ) =  '2016-01-19-00' )) or (( testcube . dt ) =  '2016-01-19-01' )) or (( testcube . dt ) =  '2016-01-19-02' )) or (( testcube . dt ) =  '2016-01-19-03' )))) GROUP BY ( testcube . cityid )
      hql[3]:SELECT ( testcube . cityid ), sum(( testcube . msr2 )) FROM TestQueryRewrite.c2_testfact testcube WHERE (((((((((((((((((((((((((((( testcube . dt ) =  '2016-01-17-04' ) or (( testcube . dt ) =  '2016-01-17-05' )) or (( testcube . dt ) =  '2016-01-17-06' )) or (( testcube . dt ) =  '2016-01-17-07' )) or (( testcube . dt ) =  '2016-01-17-08' )) or (( testcube . dt ) =  '2016-01-17-09' )) or (( testcube . dt ) =  '2016-01-17-10' )) or (( testcube . dt ) =  '2016-01-17-11' )) or (( testcube . dt ) =  '2016-01-17-12' )) or (( testcube . dt ) =  '2016-01-17-13' )) or (( testcube . dt ) =  '2016-01-17-14' )) or (( testcube . dt ) =  '2016-01-17-15' )) or (( testcube . dt ) =  '2016-01-17-16' )) or (( testcube . dt ) =  '2016-01-17-17' )) or (( testcube . dt ) =  '2016-01-17-18' )) or (( testcube . dt ) =  '2016-01-17-19' )) or (( testcube . dt ) =  '2016-01-17-20' )) or (( testcube . dt ) =  '2016-01-17-21' )) or (( testcube . dt ) =  '2016-01-17-22' )) or (( testcube . dt ) =  '2016-01-17-23' )) or (( testcube . dt ) =  '2016-01-18' )) or (( testcube . dt ) =  '2016-01-19-00' )) or (( testcube . dt ) =  '2016-01-19-01' )) or (( testcube . dt ) =  '2016-01-19-02' )) or (( testcube . dt ) =  '2016-01-19-03' )))) GROUP BY ( testcube . cityid ) HAVING (sum(( testcube . msr2 )) >  100 )
      hql[4]:SELECT ( testcube . cityid ), sum(( testcube . msr2 )) FROM TestQueryRewrite.c2_testfact testcube WHERE (((((((((((((((((((((((((((( testcube . dt ) =  '2016-01-17-04' ) or (( testcube . dt ) =  '2016-01-17-05' )) or (( testcube . dt ) =  '2016-01-17-06' )) or (( testcube . dt ) =  '2016-01-17-07' )) or (( testcube . dt ) =  '2016-01-17-08' )) or (( testcube . dt ) =  '2016-01-17-09' )) or (( testcube . dt ) =  '2016-01-17-10' )) or (( testcube . dt ) =  '2016-01-17-11' )) or (( testcube . dt ) =  '2016-01-17-12' )) or (( testcube . dt ) =  '2016-01-17-13' )) or (( testcube . dt ) =  '2016-01-17-14' )) or (( testcube . dt ) =  '2016-01-17-15' )) or (( testcube . dt ) =  '2016-01-17-16' )) or (( testcube . dt ) =  '2016-01-17-17' )) or (( testcube . dt ) =  '2016-01-17-18' )) or (( testcube . dt ) =  '2016-01-17-19' )) or (( testcube . dt ) =  '2016-01-17-20' )) or (( testcube . dt ) =  '2016-01-17-21' )) or (( testcube . dt ) =  '2016-01-17-22' )) or (( testcube . dt ) =  '2016-01-17-23' )) or (( testcube . dt ) =  '2016-01-18' )) or (( testcube . dt ) =  '2016-01-19-00' )) or (( testcube . dt ) =  '2016-01-19-01' )) or (( testcube . dt ) =  '2016-01-19-02' )) or (( testcube . dt ) =  '2016-01-19-03' )))) GROUP BY ( testcube . cityid ) HAVING ((sum(( testcube . msr2 )) + max(( testcube . msr3 ))) >  100 )
      hql[5]:SELECT ( testcube . cityid ), sum(( testcube . msr2 )) FROM TestQueryRewrite.c2_testfact testcube WHERE (((((((((((((((((((((((((((( testcube . dt ) =  '2016-01-17-04' ) or (( testcube . dt ) =  '2016-01-17-05' )) or (( testcube . dt ) =  '2016-01-17-06' )) or (( testcube . dt ) =  '2016-01-17-07' )) or (( testcube . dt ) =  '2016-01-17-08' )) or (( testcube . dt ) =  '2016-01-17-09' )) or (( testcube . dt ) =  '2016-01-17-10' )) or (( testcube . dt ) =  '2016-01-17-11' )) or (( testcube . dt ) =  '2016-01-17-12' )) or (( testcube . dt ) =  '2016-01-17-13' )) or (( testcube . dt ) =  '2016-01-17-14' )) or (( testcube . dt ) =  '2016-01-17-15' )) or (( testcube . dt ) =  '2016-01-17-16' )) or (( testcube . dt ) =  '2016-01-17-17' )) or (( testcube . dt ) =  '2016-01-17-18' )) or (( testcube . dt ) =  '2016-01-17-19' )) or (( testcube . dt ) =  '2016-01-17-20' )) or (( testcube . dt ) =  '2016-01-17-21' )) or (( testcube . dt ) =  '2016-01-17-22' )) or (( testcube . dt ) =  '2016-01-17-23' )) or (( testcube . dt ) =  '2016-01-18' )) or (( testcube . dt ) =  '2016-01-19-00' )) or (( testcube . dt ) =  '2016-01-19-01' )) or (( testcube . dt ) =  '2016-01-19-02' )) or (( testcube . dt ) =  '2016-01-19-03' )))) GROUP BY ( testcube . cityid ) HAVING ((sum(( testcube . msr2 )) >  100 ) and (sum(( testcube . msr2 )) <  1000 ))
      hql[6]:SELECT ( testcube . cityid ), sum(( testcube . msr2 )) FROM TestQueryRewrite.c2_testfact testcube WHERE (((((((((((((((((((((((((((( testcube . dt ) =  '2016-01-17-04' ) or (( testcube . dt ) =  '2016-01-17-05' )) or (( testcube . dt ) =  '2016-01-17-06' )) or (( testcube . dt ) =  '2016-01-17-07' )) or (( testcube . dt ) =  '2016-01-17-08' )) or (( testcube . dt ) =  '2016-01-17-09' )) or (( testcube . dt ) =  '2016-01-17-10' )) or (( testcube . dt ) =  '2016-01-17-11' )) or (( testcube . dt ) =  '2016-01-17-12' )) or (( testcube . dt ) =  '2016-01-17-13' )) or (( testcube . dt ) =  '2016-01-17-14' )) or (( testcube . dt ) =  '2016-01-17-15' )) or (( testcube . dt ) =  '2016-01-17-16' )) or (( testcube . dt ) =  '2016-01-17-17' )) or (( testcube . dt ) =  '2016-01-17-18' )) or (( testcube . dt ) =  '2016-01-17-19' )) or (( testcube . dt ) =  '2016-01-17-20' )) or (( testcube . dt ) =  '2016-01-17-21' )) or (( testcube . dt ) =  '2016-01-17-22' )) or (( testcube . dt ) =  '2016-01-17-23' )) or (( testcube . dt ) =  '2016-01-18' )) or (( testcube . dt ) =  '2016-01-19-00' )) or (( testcube . dt ) =  '2016-01-19-01' )) or (( testcube . dt ) =  '2016-01-19-02' )) or (( testcube . dt ) =  '2016-01-19-03' )))) GROUP BY ( testcube . cityid ) HAVING ((sum(( testcube . msr2 )) >  100 ) or ((sum(( testcube . msr2 )) <  100 ) and (max(( testcube . msr3 )) >  1000 )))
      hql[7]:SELECT ( testcube . cityid ), (sum(( testcube . msr2 )) * max(( testcube . msr3 ))) FROM TestQueryRewrite.c2_testfact testcube WHERE (((((((((((((((((((((((((((( testcube . dt ) =  '2016-01-17-04' ) or (( testcube . dt ) =  '2016-01-17-05' )) or (( testcube . dt ) =  '2016-01-17-06' )) or (( testcube . dt ) =  '2016-01-17-07' )) or (( testcube . dt ) =  '2016-01-17-08' )) or (( testcube . dt ) =  '2016-01-17-09' )) or (( testcube . dt ) =  '2016-01-17-10' )) or (( testcube . dt ) =  '2016-01-17-11' )) or (( testcube . dt ) =  '2016-01-17-12' )) or (( testcube . dt ) =  '2016-01-17-13' )) or (( testcube . dt ) =  '2016-01-17-14' )) or (( testcube . dt ) =  '2016-01-17-15' )) or (( testcube . dt ) =  '2016-01-17-16' )) or (( testcube . dt ) =  '2016-01-17-17' )) or (( testcube . dt ) =  '2016-01-17-18' )) or (( testcube . dt ) =  '2016-01-17-19' )) or (( testcube . dt ) =  '2016-01-17-20' )) or (( testcube . dt ) =  '2016-01-17-21' )) or (( testcube . dt ) =  '2016-01-17-22' )) or (( testcube . dt ) =  '2016-01-17-23' )) or (( testcube . dt ) =  '2016-01-18' )) or (( testcube . dt ) =  '2016-01-19-00' )) or (( testcube . dt ) =  '2016-01-19-01' )) or (( testcube . dt ) =  '2016-01-19-02' )) or (( testcube . dt ) =  '2016-01-19-03' )))) GROUP BY ( testcube . cityid )
      hql[8]:SELECT ( testcube . cityid ) as `c1` , max(( testcube . msr3 )) as `m3`  FROM TestQueryRewrite.c2_testfact testcube WHERE (((( c1  >  100 ) and (((((((((((((((((((((((((( testcube . dt ) =  '2016-01-17-04' ) or (( testcube . dt ) =  '2016-01-17-05' )) or (( testcube . dt ) =  '2016-01-17-06' )) or (( testcube . dt ) =  '2016-01-17-07' )) or (( testcube . dt ) =  '2016-01-17-08' )) or (( testcube . dt ) =  '2016-01-17-09' )) or (( testcube . dt ) =  '2016-01-17-10' )) or (( testcube . dt ) =  '2016-01-17-11' )) or (( testcube . dt ) =  '2016-01-17-12' )) or (( testcube . dt ) =  '2016-01-17-13' )) or (( testcube . dt ) =  '2016-01-17-14' )) or (( testcube . dt ) =  '2016-01-17-15' )) or (( testcube . dt ) =  '2016-01-17-16' )) or (( testcube . dt ) =  '2016-01-17-17' )) or (( testcube . dt ) =  '2016-01-17-18' )) or (( testcube . dt ) =  '2016-01-17-19' )) or (( testcube . dt ) =  '2016-01-17-20' )) or (( testcube . dt ) =  '2016-01-17-21' )) or (( testcube . dt ) =  '2016-01-17-22' )) or (( testcube . dt ) =  '2016-01-17-23' )) or (( testcube . dt ) =  '2016-01-18' )) or (( testcube . dt ) =  '2016-01-19-00' )) or (( testcube . dt ) =  '2016-01-19-01' )) or (( testcube . dt ) =  '2016-01-19-02' )) or (( testcube . dt ) =  '2016-01-19-03' ))))) GROUP BY ( testcube . cityid ) HAVING ((sum(( testcube . msr2 )) <  100 ) and ( m3  >  1000 ))
      hql[9]:SELECT ( testcube . cityid ), round(sum(( testcube . msr2 ))) FROM TestQueryRewrite.c2_testfact testcube WHERE (((((((((((((((((((((((((((( testcube . dt ) =  '2016-01-17-04' ) or (( testcube . dt ) =  '2016-01-17-05' )) or (( testcube . dt ) =  '2016-01-17-06' )) or (( testcube . dt ) =  '2016-01-17-07' )) or (( testcube . dt ) =  '2016-01-17-08' )) or (( testcube . dt ) =  '2016-01-17-09' )) or (( testcube . dt ) =  '2016-01-17-10' )) or (( testcube . dt ) =  '2016-01-17-11' )) or (( testcube . dt ) =  '2016-01-17-12' )) or (( testcube . dt ) =  '2016-01-17-13' )) or (( testcube . dt ) =  '2016-01-17-14' )) or (( testcube . dt ) =  '2016-01-17-15' )) or (( testcube . dt ) =  '2016-01-17-16' )) or (( testcube . dt ) =  '2016-01-17-17' )) or (( testcube . dt ) =  '2016-01-17-18' )) or (( testcube . dt ) =  '2016-01-17-19' )) or (( testcube . dt ) =  '2016-01-17-20' )) or (( testcube . dt ) =  '2016-01-17-21' )) or (( testcube . dt ) =  '2016-01-17-22' )) or (( testcube . dt ) =  '2016-01-17-23' )) or (( testcube . dt ) =  '2016-01-18' )) or (( testcube . dt ) =  '2016-01-19-00' )) or (( testcube . dt ) =  '2016-01-19-01' )) or (( testcube . dt ) =  '2016-01-19-02' )) or (( testcube . dt ) =  '2016-01-19-03' )))) GROUP BY ( testcube . cityid )
      hql[10]:SELECT ( testcube . cityid ) FROM TestQueryRewrite.c2_testfact testcube WHERE (((((((((((((((((((((((((((( testcube . dt ) =  '2016-01-17-04' ) or (( testcube . dt ) =  '2016-01-17-05' )) or (( testcube . dt ) =  '2016-01-17-06' )) or (( testcube . dt ) =  '2016-01-17-07' )) or (( testcube . dt ) =  '2016-01-17-08' )) or (( testcube . dt ) =  '2016-01-17-09' )) or (( testcube . dt ) =  '2016-01-17-10' )) or (( testcube . dt ) =  '2016-01-17-11' )) or (( testcube . dt ) =  '2016-01-17-12' )) or (( testcube . dt ) =  '2016-01-17-13' )) or (( testcube . dt ) =  '2016-01-17-14' )) or (( testcube . dt ) =  '2016-01-17-15' )) or (( testcube . dt ) =  '2016-01-17-16' )) or (( testcube . dt ) =  '2016-01-17-17' )) or (( testcube . dt ) =  '2016-01-17-18' )) or (( testcube . dt ) =  '2016-01-17-19' )) or (( testcube . dt ) =  '2016-01-17-20' )) or (( testcube . dt ) =  '2016-01-17-21' )) or (( testcube . dt ) =  '2016-01-17-22' )) or (( testcube . dt ) =  '2016-01-17-23' )) or (( testcube . dt ) =  '2016-01-18' )) or (( testcube . dt ) =  '2016-01-19-00' )) or (( testcube . dt ) =  '2016-01-19-01' )) or (( testcube . dt ) =  '2016-01-19-02' )) or (( testcube . dt ) =  '2016-01-19-03' )))) GROUP BY ( testcube . cityid ) HAVING (sum(( testcube . msr2 )) >  100 )
      NoViableAltException(290@[221:1: constant : ( Number | dateLiteral | StringLiteral | stringLiteralSequence | BigintLiteral | SmallintLiteral | TinyintLiteral | DecimalLiteral | charSetStringLiteral | booleanValue );])
      	at org.antlr.runtime.DFA.noViableAlt(DFA.java:158)
      	at org.antlr.runtime.DFA.predict(DFA.java:116)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.constant(HiveParser_IdentifiersParser.java:6129)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.atomExpression(HiveParser_IdentifiersParser.java:6784)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceFieldExpression(HiveParser_IdentifiersParser.java:6947)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceUnaryPrefixExpression(HiveParser_IdentifiersParser.java:7332)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceUnarySuffixExpression(HiveParser_IdentifiersParser.java:7392)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceBitwiseXorExpression(HiveParser_IdentifiersParser.java:7576)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceStarExpression(HiveParser_IdentifiersParser.java:7736)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedencePlusExpression(HiveParser_IdentifiersParser.java:7896)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceAmpersandExpression(HiveParser_IdentifiersParser.java:8047)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceBitwiseOrExpression(HiveParser_IdentifiersParser.java:8206)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceEqualExpression(HiveParser_IdentifiersParser.java:8862)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceNotExpression(HiveParser_IdentifiersParser.java:9749)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceAndExpression(HiveParser_IdentifiersParser.java:9899)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceOrExpression(HiveParser_IdentifiersParser.java:10027)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.expression(HiveParser_IdentifiersParser.java:6652)
      	at org.apache.hadoop.hive.ql.parse.HiveParser.expression(HiveParser.java:40376)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_FromClauseParser.searchCondition(HiveParser_FromClauseParser.java:6480)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_FromClauseParser.whereClause(HiveParser_FromClauseParser.java:6388)
      	at org.apache.hadoop.hive.ql.parse.HiveParser.whereClause(HiveParser.java:40394)
      	at org.apache.hadoop.hive.ql.parse.HiveParser.singleSelectStatement(HiveParser.java:38168)
      	at org.apache.hadoop.hive.ql.parse.HiveParser.selectStatement(HiveParser.java:37796)
      	at org.apache.hadoop.hive.ql.parse.HiveParser.regularBody(HiveParser.java:37733)
      	at org.apache.hadoop.hive.ql.parse.HiveParser.queryStatementExpressionBody(HiveParser.java:36902)
      	at org.apache.hadoop.hive.ql.parse.HiveParser.queryStatementExpression(HiveParser.java:36777)
      	at org.apache.hadoop.hive.ql.parse.HiveParser.execStatement(HiveParser.java:1341)
      	at org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:1038)
      	at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:199)
      	at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
      	at org.apache.lens.cube.parse.HQLParser.parseHQL(HQLParser.java:155)
      	at org.apache.lens.cube.parse.TestQuery.getAST(TestQuery.java:81)
      	at org.apache.lens.cube.parse.TestQuery.equals(TestQuery.java:230)
      	at org.testng.Assert.assertEquals(Assert.java:119)
      	at org.testng.Assert.assertEquals(Assert.java:165)
      	at org.apache.lens.cube.parse.TestCubeRewriter.compareQueries(TestCubeRewriter.java:285)
      	at org.apache.lens.cube.parse.TestBaseCubeQueries.testFallbackPartCol(TestBaseCubeQueries.java:542)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
      	at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
      	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
      	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
      	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
      	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
      	at org.testng.TestRunner.privateRun(TestRunner.java:767)
      	at org.testng.TestRunner.run(TestRunner.java:617)
      	at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
      	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
      	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
      	at org.testng.SuiteRunner.run(SuiteRunner.java:240)
      	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
      	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
      	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1198)
      	at org.testng.TestNG.runSuitesLocally(TestNG.java:1123)
      	at org.testng.TestNG.run(TestNG.java:1031)
      	at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:69)
      	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:181)
      	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:99)
      	at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:113)
      	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
      	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
      	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
      @@HQL SELECT sum(( testcube . msr2 )) as `msr2`  FROM TestQueryRewrite.c1_testfact2 testcube WHERE ((((((((((((((((((((((((((((((((((((((((((((((((((( testcube . dt ) =  '2016-01-17-04' ) or (( testcube . dt ) =  '2016-01-17-05' )) or (( testcube . dt ) =  '2016-01-17-06' )) or (( testcube . dt ) =  '2016-01-17-07' )) or (( testcube . dt ) =  '2016-01-17-08' )) or (( testcube . dt ) =  '2016-01-17-09' )) or (( testcube . dt ) =  '2016-01-17-10' )) or (( testcube . dt ) =  '2016-01-17-11' )) or (( testcube . dt ) =  '2016-01-17-12' )) or (( testcube . dt ) =  '2016-01-17-13' )) or (( testcube . dt ) =  '2016-01-17-14' )) or (( testcube . dt ) =  '2016-01-17-15' )) or (( testcube . dt ) =  '2016-01-17-16' )) or (( testcube . dt ) =  '2016-01-17-17' )) or (( testcube . dt ) =  '2016-01-17-18' )) or (( testcube . dt ) =  '2016-01-17-19' )) or (( testcube . dt ) =  '2016-01-17-20' )) or (( testcube . dt ) =  '2016-01-17-21' )) or (( testcube . dt ) =  '2016-01-17-22' )) or (( testcube . dt ) =  '2016-01-17-23' )) or (( testcube . dt ) =  '2016-01-18-00' )) or (( testcube . dt ) =  '2016-01-18-01' )) or (( testcube . dt ) =  '2016-01-18-02' )) or (( testcube . dt ) =  '2016-01-18-03' )) or (( testcube . dt ) =  '2016-01-18-04' )) or (( testcube . dt ) =  '2016-01-18-05' )) or (( testcube . dt ) =  '2016-01-18-06' )) or (( testcube . dt ) =  '2016-01-18-07' )) or (( testcube . dt ) =  '2016-01-18-08' )) or (( testcube . dt ) =  '2016-01-18-09' )) or (( testcube . dt ) =  '2016-01-18-10' )) or (( testcube . dt ) =  '2016-01-18-11' )) or (( testcube . dt ) =  '2016-01-18-12' )) or (( testcube . dt ) =  '2016-01-18-13' )) or (( testcube . dt ) =  '2016-01-18-14' )) or (( testcube . dt ) =  '2016-01-18-15' )) or (( testcube . dt ) =  '2016-01-18-16' )) or (( testcube . dt ) =  '2016-01-18-17' )) or (( testcube . dt ) =  '2016-01-18-18' )) or (( testcube . dt ) =  '2016-01-18-19' )) or (( testcube . dt ) =  '2016-01-18-20' )) or (( testcube . dt ) =  '2016-01-18-21' )) or (( testcube . dt ) =  '2016-01-18-22' )) or (( testcube . dt ) =  '2016-01-18-23' )) or (( testcube . dt ) =  '2016-01-19-00' )) or (( testcube . dt ) =  '2016-01-19-01' )) or (( testcube . dt ) =  '2016-01-19-02' )) or (( testcube . dt ) =  '2016-01-19-03' ))))
      Non existing parts:{"testfact":["dt:[2016-01-17-04-00-00, 2016-01-19-04-00-00)"]}
      @@ hql: SELECT sum(( testcube . msr2 )) as `a measure`  FROM TestQueryRewrite.c1_testfact2 testcube WHERE ((((((((((((((((((((((((((((((((((((((((((((((((((( testcube . dt ) =  '2016-01-17-04' ) or (( testcube . dt ) =  '2016-01-17-05' )) or (( testcube . dt ) =  '2016-01-17-06' )) or (( testcube . dt ) =  '2016-01-17-07' )) or (( testcube . dt ) =  '2016-01-17-08' )) or (( testcube . dt ) =  '2016-01-17-09' )) or (( testcube . dt ) =  '2016-01-17-10' )) or (( testcube . dt ) =  '2016-01-17-11' )) or (( testcube . dt ) =  '2016-01-17-12' )) or (( testcube . dt ) =  '2016-01-17-13' )) or (( testcube . dt ) =  '2016-01-17-14' )) or (( testcube . dt ) =  '2016-01-17-15' )) or (( testcube . dt ) =  '2016-01-17-16' )) or (( testcube . dt ) =  '2016-01-17-17' )) or (( testcube . dt ) =  '2016-01-17-18' )) or (( testcube . dt ) =  '2016-01-17-19' )) or (( testcube . dt ) =  '2016-01-17-20' )) or (( testcube . dt ) =  '2016-01-17-21' )) or (( testcube . dt ) =  '2016-01-17-22' )) or (( testcube . dt ) =  '2016-01-17-23' )) or (( testcube . dt ) =  '2016-01-18-00' )) or (( testcube . dt ) =  '2016-01-18-01' )) or (( testcube . dt ) =  '2016-01-18-02' )) or (( testcube . dt ) =  '2016-01-18-03' )) or (( testcube . dt ) =  '2016-01-18-04' )) or (( testcube . dt ) =  '2016-01-18-05' )) or (( testcube . dt ) =  '2016-01-18-06' )) or (( testcube . dt ) =  '2016-01-18-07' )) or (( testcube . dt ) =  '2016-01-18-08' )) or (( testcube . dt ) =  '2016-01-18-09' )) or (( testcube . dt ) =  '2016-01-18-10' )) or (( testcube . dt ) =  '2016-01-18-11' )) or (( testcube . dt ) =  '2016-01-18-12' )) or (( testcube . dt ) =  '2016-01-18-13' )) or (( testcube . dt ) =  '2016-01-18-14' )) or (( testcube . dt ) =  '2016-01-18-15' )) or (( testcube . dt ) =  '2016-01-18-16' )) or (( testcube . dt ) =  '2016-01-18-17' )) or (( testcube . dt ) =  '2016-01-18-18' )) or (( testcube . dt ) =  '2016-01-18-19' )) or (( testcube . dt ) =  '2016-01-18-20' )) or (( testcube . dt ) =  '2016-01-18-21' )) or (( testcube . dt ) =  '2016-01-18-22' )) or (( testcube . dt ) =  '2016-01-18-23' )) or (( testcube . dt ) =  '2016-01-19-00' )) or (( testcube . dt ) =  '2016-01-19-01' )) or (( testcube . dt ) =  '2016-01-19-02' )) or (( testcube . dt ) =  '2016-01-19-03' ))))
      HQL:SELECT sum(( testcube . alias0 )) FROM (SELECT sum(( testcube . msr2 )) as `alias0`  FROM TestQueryRewrite.c1_testfact testcube WHERE (((( testcube . dt ) =  '2016-01-18' ))) UNION ALL SELECT sum(( testcube . msr2 )) as `alias0`  FROM TestQueryRewrite.c2_testfact testcube WHERE ((((((((((((((((((((((((((( testcube . dt ) =  '2016-01-17-04' ) or (( testcube . dt ) =  '2016-01-17-05' )) or (( testcube . dt ) =  '2016-01-17-06' )) or (( testcube . dt ) =  '2016-01-17-07' )) or (( testcube . dt ) =  '2016-01-17-08' )) or (( testcube . dt ) =  '2016-01-17-09' )) or (( testcube . dt ) =  '2016-01-17-10' )) or (( testcube . dt ) =  '2016-01-17-11' )) or (( testcube . dt ) =  '2016-01-17-12' )) or (( testcube . dt ) =  '2016-01-17-13' )) or (( testcube . dt ) =  '2016-01-17-14' )) or (( testcube . dt ) =  '2016-01-17-15' )) or (( testcube . dt ) =  '2016-01-17-16' )) or (( testcube . dt ) =  '2016-01-17-17' )) or (( testcube . dt ) =  '2016-01-17-18' )) or (( testcube . dt ) =  '2016-01-17-19' )) or (( testcube . dt ) =  '2016-01-17-20' )) or (( testcube . dt ) =  '2016-01-17-21' )) or (( testcube . dt ) =  '2016-01-17-22' )) or (( testcube . dt ) =  '2016-01-17-23' )) or (( testcube . dt ) =  '2016-01-19-00' )) or (( testcube . dt ) =  '2016-01-19-01' )) or (( testcube . dt ) =  '2016-01-19-02' )) or (( testcube . dt ) =  '2016-01-19-03' ))))) testcube
      HQL:SELECT sum(( testcube . alias0 )) FROM (SELECT sum(( testcube . msr2 )) as `alias0`  FROM TestQueryRewrite.c1_testfact testcube WHERE ((((((((((((((((((((((((((( testcube . dt ) =  '2015-11-19-04' ) or (( testcube . dt ) =  '2015-11-19-05' )) or (( testcube . dt ) =  '2015-11-19-06' )) or (( testcube . dt ) =  '2015-11-19-07' )) or (( testcube . dt ) =  '2015-11-19-08' )) or (( testcube . dt ) =  '2015-11-19-09' )) or (( testcube . dt ) =  '2015-11-19-10' )) or (( testcube . dt ) =  '2015-11-19-11' )) or (( testcube . dt ) =  '2015-11-19-12' )) or (( testcube . dt ) =  '2015-11-19-13' )) or (( testcube . dt ) =  '2015-11-19-14' )) or (( testcube . dt ) =  '2015-11-19-15' )) or (( testcube . dt ) =  '2015-11-19-16' )) or (( testcube . dt ) =  '2015-11-19-17' )) or (( testcube . dt ) =  '2015-11-19-18' )) or (( testcube . dt ) =  '2015-11-19-19' )) or (( testcube . dt ) =  '2015-11-19-20' )) or (( testcube . dt ) =  '2015-11-19-21' )) or (( testcube . dt ) =  '2015-11-19-22' )) or (( testcube . dt ) =  '2015-11-19-23' )) or (( testcube . dt ) =  '2016-01-19-00' )) or (( testcube . dt ) =  '2016-01-19-01' )) or (( testcube . dt ) =  '2016-01-19-02' )) or (( testcube . dt ) =  '2016-01-19-03' )))) UNION ALL SELECT sum(( testcube . msr2 )) as `alias0`  FROM TestQueryRewrite.c2_testfact testcube WHERE (((((((((((((((((((((((((((((((( testcube . dt ) =  '2015-11-20' ) or (( testcube . dt ) =  '2015-11-21' )) or (( testcube . dt ) =  '2015-11-22' )) or (( testcube . dt ) =  '2015-11-23' )) or (( testcube . dt ) =  '2015-11-24' )) or (( testcube . dt ) =  '2015-11-25' )) or (( testcube . dt ) =  '2015-11-26' )) or (( testcube . dt ) =  '2015-11-27' )) or (( testcube . dt ) =  '2015-11-28' )) or (( testcube . dt ) =  '2015-11-29' )) or (( testcube . dt ) =  '2015-11-30' )) or (( testcube . dt ) =  '2016-01-01' )) or (( testcube . dt ) =  '2016-01-02' )) or (( testcube . dt ) =  '2016-01-03' )) or (( testcube . dt ) =  '2016-01-04' )) or (( testcube . dt ) =  '2016-01-05' )) or (( testcube . dt ) =  '2016-01-06' )) or (( testcube . dt ) =  '2016-01-07' )) or (( testcube . dt ) =  '2016-01-08' )) or (( testcube . dt ) =  '2016-01-09' )) or (( testcube . dt ) =  '2016-01-10' )) or (( testcube . dt ) =  '2016-01-11' )) or (( testcube . dt ) =  '2016-01-12' )) or (( testcube . dt ) =  '2016-01-13' )) or (( testcube . dt ) =  '2016-01-14' )) or (( testcube . dt ) =  '2016-01-15' )) or (( testcube . dt ) =  '2016-01-16' )) or (( testcube . dt ) =  '2016-01-17' )) or (( testcube . dt ) =  '2016-01-18' )))) UNION ALL SELECT sum(( testcube . msr2 )) as `alias0`  FROM TestQueryRewrite.c3_testfact testcube WHERE (((( testcube . dt ) =  '2015-12' )))) testcube
      Non existing parts:{"testfact":["dt:[2016-01-17-04-00-00, 2016-01-19-04-00-00)"]}
      @@ HQL with IN and OR: SELECT ( testcube . dim1 ), max(( testcube . msr3 )), sum(( testcube . msr2 )) FROM TestQueryRewrite.c2_summary1 testcube WHERE (((( testcube . it ) in ( '2016-01-17-04'  ,  '2016-01-17-05'  ,  '2016-01-17-06'  ,  '2016-01-17-07'  ,  '2016-01-17-08'  ,  '2016-01-17-09'  ,  '2016-01-17-10'  ,  '2016-01-17-11'  ,  '2016-01-17-12'  ,  '2016-01-17-13'  ,  '2016-01-17-14'  ,  '2016-01-17-15'  ,  '2016-01-17-16'  ,  '2016-01-17-17'  ,  '2016-01-17-18'  ,  '2016-01-17-19'  ,  '2016-01-17-20'  ,  '2016-01-17-21'  ,  '2016-01-17-22'  ,  '2016-01-17-23'  ,  '2016-01-18'  ,  '2016-01-19-00'  ,  '2016-01-19-01'  ,  '2016-01-19-02'  ,  '2016-01-19-03' ) or (( testcube . pt ) in ( '2016-01-19-00'  ,  '2016-01-19-01'  ,  '2016-01-19-02'  ,  '2016-01-19-03'  ,  '2016-01-19-04'  ,  '2016-01-19-05'  ,  '2016-01-19-06'  ,  '2016-01-19-07'  ,  '2016-01-19-08'  ,  '2016-01-19-09'  ,  '2016-01-19-10'  ,  '2016-01-19-11'  ,  '2016-01-19-12'  ,  '2016-01-19-13'  ,  '2016-01-19-14'  ,  '2016-01-19-15'  ,  '2016-01-19-16'  ,  '2016-01-19-17'  ,  '2016-01-19-18'  ,  '2016-01-19-19'  ,  '2016-01-19-20'  ,  '2016-01-19-21'  ,  '2016-01-19-22'  ,  '2016-01-19-23' ) and ( testcube . it ) in ( '2016-01-18-00'  ,  '2016-01-18-01'  ,  '2016-01-18-02'  ,  '2016-01-18-03'  ,  '2016-01-18-04'  ,  '2016-01-18-05'  ,  '2016-01-18-06'  ,  '2016-01-18-07'  ,  '2016-01-18-08'  ,  '2016-01-18-09'  ,  '2016-01-18-10'  ,  '2016-01-18-11'  ,  '2016-01-18-12'  ,  '2016-01-18-13'  ,  '2016-01-18-14'  ,  '2016-01-18-15'  ,  '2016-01-18-16'  ,  '2016-01-18-17'  ,  '2016-01-18-18'  ,  '2016-01-18-19'  ,  '2016-01-18-20'  ,  '2016-01-18-21'  ,  '2016-01-18-22'  ,  '2016-01-18-23' ))))) GROUP BY ( testcube . dim1 )
      OK
      OK
      SELECT COALESCE(mq1.zipcode, mq2.zipcode) zipcode, mq2.msr4 msr4, mq1.msr15 msr15 FROM (SELECT ( testcube . zipcode ) as `zipcode` , sum(( testcube . msr15 )) as `msr15`  FROM TestQueryRewrite.c1_testfact2 testcube WHERE (((((( testcube . zipcode ) =  'a' ) and (( testcube . cityid ) =  'b' )) and ((((((((((((((((((((((( testcube . dt ) =  '2016-01-17-04' ) or (( testcube . dt ) =  '2016-01-17-05' )) or (( testcube . dt ) =  '2016-01-17-06' )) or (( testcube . dt ) =  '2016-01-17-07' )) or (( testcube . dt ) =  '2016-01-17-08' )) or (( testcube . dt ) =  '2016-01-17-09' )) or (( testcube . dt ) =  '2016-01-17-10' )) or (( testcube . dt ) =  '2016-01-17-11' )) or (( testcube . dt ) =  '2016-01-17-12' )) or (( testcube . dt ) =  '2016-01-17-13' )) or (( testcube . dt ) =  '2016-01-17-14' )) or (( testcube . dt ) =  '2016-01-17-15' )) or (( testcube . dt ) =  '2016-01-17-16' )) or (( testcube . dt ) =  '2016-01-17-17' )) or (( testcube . dt ) =  '2016-01-17-18' )) or (( testcube . dt ) =  '2016-01-17-19' )) or (( testcube . dt ) =  '2016-01-17-20' )) or (( testcube . dt ) =  '2016-01-17-21' )) or (( testcube . dt ) =  '2016-01-17-22' )) or (( testcube . dt ) =  '2016-01-17-23' )) or ((((( testcube . dt ) =  '2016-01-19-00' ) or (( testcube . dt ) =  '2016-01-19-01' )) or (( testcube . dt ) =  '2016-01-19-02' )) or (( testcube . dt ) =  '2016-01-19-03' ))) or ((((((((((((((((((((((((( testcube . dt ) =  '2016-01-18-00' ) or (( testcube . dt ) =  '2016-01-18-01' )) or (( testcube . dt ) =  '2016-01-18-02' )) or (( testcube . dt ) =  '2016-01-18-03' )) or (( testcube . dt ) =  '2016-01-18-04' )) or (( testcube . dt ) =  '2016-01-18-05' )) or (( testcube . dt ) =  '2016-01-18-06' )) or (( testcube . dt ) =  '2016-01-18-07' )) or (( testcube . dt ) =  '2016-01-18-08' )) or (( testcube . dt ) =  '2016-01-18-09' )) or (( testcube . dt ) =  '2016-01-18-10' )) or (( testcube . dt ) =  '2016-01-18-11' )) or (( testcube . dt ) =  '2016-01-18-12' )) or (( testcube . dt ) =  '2016-01-18-13' )) or (( testcube . dt ) =  '2016-01-18-14' )) or (( testcube . dt ) =  '2016-01-18-15' )) or (( testcube . dt ) =  '2016-01-18-16' )) or (( testcube . dt ) =  '2016-01-18-17' )) or (( testcube . dt ) =  '2016-01-18-18' )) or (( testcube . dt ) =  '2016-01-18-19' )) or (( testcube . dt ) =  '2016-01-18-20' )) or (( testcube . dt ) =  '2016-01-18-21' )) or (( testcube . dt ) =  '2016-01-18-22' )) or (( testcube . dt ) =  '2016-01-18-23' ))))))) mq1 full outer join (SELECT ( testcube . alias0 ) as `zipcode` , count(( testcube . alias1 )) as `msr4`  FROM (SELECT ( testcube . zipcode ) as `alias0` , count(( testcube . msr4 )) as `alias1`  FROM TestQueryRewrite.c1_testfact testcube WHERE (((((( testcube . alias0 ) =  'a' ) and (( testcube . cityid ) =  'b' )) and ((((((((((((((((((((((( testcube . dt ) =  '2016-01-17-04' ) or (( testcube . dt ) =  '2016-01-17-05' )) or (( testcube . dt ) =  '2016-01-17-06' )) or (( testcube . dt ) =  '2016-01-17-07' )) or (( testcube . dt ) =  '2016-01-17-08' )) or (( testcube . dt ) =  '2016-01-17-09' )) or (( testcube . dt ) =  '2016-01-17-10' )) or (( testcube . dt ) =  '2016-01-17-11' )) or (( testcube . dt ) =  '2016-01-17-12' )) or (( testcube . dt ) =  '2016-01-17-13' )) or (( testcube . dt ) =  '2016-01-17-14' )) or (( testcube . dt ) =  '2016-01-17-15' )) or (( testcube . dt ) =  '2016-01-17-16' )) or (( testcube . dt ) =  '2016-01-17-17' )) or (( testcube . dt ) =  '2016-01-17-18' )) or (( testcube . dt ) =  '2016-01-17-19' )) or (( testcube . dt ) =  '2016-01-17-20' )) or (( testcube . dt ) =  '2016-01-17-21' )) or (( testcube . dt ) =  '2016-01-17-22' )) or (( testcube . dt ) =  '2016-01-17-23' )) or ((((( testcube . dt ) =  '2016-01-19-00' ) or (( testcube . dt ) =  '2016-01-19-01' )) or (( testcube . dt ) =  '2016-01-19-02' )) or (( testcube . dt ) =  '2016-01-19-03' ))) or (( testcube . dt ) =  '2016-01-18' ))))) UNION ALL SELECT ( testcube . zipcode ) as `alias0` , count(( testcube . msr4 )) as `alias1`  FROM TestQueryRewrite.c2_testfact testcube WHERE (((((( testcube . alias0 ) =  'a' ) and (( testcube . cityid ) =  'b' )) and ((((((((((((((((((((((( testcube . dt ) =  '2016-01-17-04' ) or (( testcube . dt ) =  '2016-01-17-05' )) or (( testcube . dt ) =  '2016-01-17-06' )) or (( testcube . dt ) =  '2016-01-17-07' )) or (( testcube . dt ) =  '2016-01-17-08' )) or (( testcube . dt ) =  '2016-01-17-09' )) or (( testcube . dt ) =  '2016-01-17-10' )) or (( testcube . dt ) =  '2016-01-17-11' )) or (( testcube . dt ) =  '2016-01-17-12' )) or (( testcube . dt ) =  '2016-01-17-13' )) or (( testcube . dt ) =  '2016-01-17-14' )) or (( testcube . dt ) =  '2016-01-17-15' )) or (( testcube . dt ) =  '2016-01-17-16' )) or (( testcube . dt ) =  '2016-01-17-17' )) or (( testcube . dt ) =  '2016-01-17-18' )) or (( testcube . dt ) =  '2016-01-17-19' )) or (( testcube . dt ) =  '2016-01-17-20' )) or (( testcube . dt ) =  '2016-01-17-21' )) or (( testcube . dt ) =  '2016-01-17-22' )) or (( testcube . dt ) =  '2016-01-17-23' )) or ((((( testcube . dt ) =  '2016-01-19-00' ) or (( testcube . dt ) =  '2016-01-19-01' )) or (( testcube . dt ) =  '2016-01-19-02' )) or (( testcube . dt ) =  '2016-01-19-03' ))) or (( testcube . dt ) =  '2016-01-18' )))))) testcube) mq2 on mq1.zipcode <=> mq2.zipcode
      rewrittenQuery.toHQL() SELECT sum(( testcube . msr15 )) FROM TestQueryRewrite.c0_testfact_continuous testcube WHERE ((( testcube . dt ) between  '2016-01-17-04-54-12'  and  '2016-01-19-04-54-12' ))
      expected select SUM((testCube.msr15)) from TestQueryRewrite.c0_testFact_CONTINUOUS testcube WHERE ((( testcube . dt ) between  '2016-01-17-04-54-12'  and  '2016-01-19-04-54-12' ))
      rewrittenQuery.toHQL() SELECT sum(( testcube . msr2 )) FROM TestQueryRewrite.c0_testfact testcube WHERE ((( testcube . dt ) between  '2016-01-17-04-54-12'  and  '2016-01-19-04-54-12' ))
      expected select SUM((testCube.msr2)) from TestQueryRewrite.c0_testFact testcube WHERE ((( testcube . dt ) between  '2016-01-17-04-54-12'  and  '2016-01-19-04-54-12' ))
      @@ HQL = SELECT count( distinct ( cubecity . name )) FROM TestQueryRewrite.c1_testfact2 testcube join TestQueryRewrite.c1_citytable cubecity on testcube.cityid = cubecity.id and (cubecity.dt = 'latest') WHERE ((((((((((((((((((((((((((((((((((((((((((((((((((( testcube . dt ) =  '2016-01-17-04' ) or (( testcube . dt ) =  '2016-01-17-05' )) or (( testcube . dt ) =  '2016-01-17-06' )) or (( testcube . dt ) =  '2016-01-17-07' )) or (( testcube . dt ) =  '2016-01-17-08' )) or (( testcube . dt ) =  '2016-01-17-09' )) or (( testcube . dt ) =  '2016-01-17-10' )) or (( testcube . dt ) =  '2016-01-17-11' )) or (( testcube . dt ) =  '2016-01-17-12' )) or (( testcube . dt ) =  '2016-01-17-13' )) or (( testcube . dt ) =  '2016-01-17-14' )) or (( testcube . dt ) =  '2016-01-17-15' )) or (( testcube . dt ) =  '2016-01-17-16' )) or (( testcube . dt ) =  '2016-01-17-17' )) or (( testcube . dt ) =  '2016-01-17-18' )) or (( testcube . dt ) =  '2016-01-17-19' )) or (( testcube . dt ) =  '2016-01-17-20' )) or (( testcube . dt ) =  '2016-01-17-21' )) or (( testcube . dt ) =  '2016-01-17-22' )) or (( testcube . dt ) =  '2016-01-17-23' )) or (( testcube . dt ) =  '2016-01-18-00' )) or (( testcube . dt ) =  '2016-01-18-01' )) or (( testcube . dt ) =  '2016-01-18-02' )) or (( testcube . dt ) =  '2016-01-18-03' )) or (( testcube . dt ) =  '2016-01-18-04' )) or (( testcube . dt ) =  '2016-01-18-05' )) or (( testcube . dt ) =  '2016-01-18-06' )) or (( testcube . dt ) =  '2016-01-18-07' )) or (( testcube . dt ) =  '2016-01-18-08' )) or (( testcube . dt ) =  '2016-01-18-09' )) or (( testcube . dt ) =  '2016-01-18-10' )) or (( testcube . dt ) =  '2016-01-18-11' )) or (( testcube . dt ) =  '2016-01-18-12' )) or (( testcube . dt ) =  '2016-01-18-13' )) or (( testcube . dt ) =  '2016-01-18-14' )) or (( testcube . dt ) =  '2016-01-18-15' )) or (( testcube . dt ) =  '2016-01-18-16' )) or (( testcube . dt ) =  '2016-01-18-17' )) or (( testcube . dt ) =  '2016-01-18-18' )) or (( testcube . dt ) =  '2016-01-18-19' )) or (( testcube . dt ) =  '2016-01-18-20' )) or (( testcube . dt ) =  '2016-01-18-21' )) or (( testcube . dt ) =  '2016-01-18-22' )) or (( testcube . dt ) =  '2016-01-18-23' )) or (( testcube . dt ) =  '2016-01-19-00' )) or (( testcube . dt ) =  '2016-01-19-01' )) or (( testcube . dt ) =  '2016-01-19-02' )) or (( testcube . dt ) =  '2016-01-19-03' ))))
      @@SELECT ( timehourchain1 . full_hour ), sum(( testcube . msr2 )) FROM TestQueryRewrite.c4_testfact2 testcube join TestQueryRewrite.c3_hourdimtbl timehourchain1 on testcube.test_time_dim_hour_id = timehourchain1.id and (timehourchain1.dt = 'latest') WHERE ((((((((((((((((((((((((((((((((((((((((((((((((((( testcube . ttd ) =  '2016-01-17-04' ) or (( testcube . ttd ) =  '2016-01-17-05' )) or (( testcube . ttd ) =  '2016-01-17-06' )) or (( testcube . ttd ) =  '2016-01-17-07' )) or (( testcube . ttd ) =  '2016-01-17-08' )) or (( testcube . ttd ) =  '2016-01-17-09' )) or (( testcube . ttd ) =  '2016-01-17-10' )) or (( testcube . ttd ) =  '2016-01-17-11' )) or (( testcube . ttd ) =  '2016-01-17-12' )) or (( testcube . ttd ) =  '2016-01-17-13' )) or (( testcube . ttd ) =  '2016-01-17-14' )) or (( testcube . ttd ) =  '2016-01-17-15' )) or (( testcube . ttd ) =  '2016-01-17-16' )) or (( testcube . ttd ) =  '2016-01-17-17' )) or (( testcube . ttd ) =  '2016-01-17-18' )) or (( testcube . ttd ) =  '2016-01-17-19' )) or (( testcube . ttd ) =  '2016-01-17-20' )) or (( testcube . ttd ) =  '2016-01-17-21' )) or (( testcube . ttd ) =  '2016-01-17-22' )) or (( testcube . ttd ) =  '2016-01-17-23' )) or (( testcube . ttd ) =  '2016-01-18-00' )) or (( testcube . ttd ) =  '2016-01-18-01' )) or (( testcube . ttd ) =  '2016-01-18-02' )) or (( testcube . ttd ) =  '2016-01-18-03' )) or (( testcube . ttd ) =  '2016-01-18-04' )) or (( testcube . ttd ) =  '2016-01-18-05' )) or (( testcube . ttd ) =  '2016-01-18-06' )) or (( testcube . ttd ) =  '2016-01-18-07' )) or (( testcube . ttd ) =  '2016-01-18-08' )) or (( testcube . ttd ) =  '2016-01-18-09' )) or (( testcube . ttd ) =  '2016-01-18-10' )) or (( testcube . ttd ) =  '2016-01-18-11' )) or (( testcube . ttd ) =  '2016-01-18-12' )) or (( testcube . ttd ) =  '2016-01-18-13' )) or (( testcube . ttd ) =  '2016-01-18-14' )) or (( testcube . ttd ) =  '2016-01-18-15' )) or (( testcube . ttd ) =  '2016-01-18-16' )) or (( testcube . ttd ) =  '2016-01-18-17' )) or (( testcube . ttd ) =  '2016-01-18-18' )) or (( testcube . ttd ) =  '2016-01-18-19' )) or (( testcube . ttd ) =  '2016-01-18-20' )) or (( testcube . ttd ) =  '2016-01-18-21' )) or (( testcube . ttd ) =  '2016-01-18-22' )) or (( testcube . ttd ) =  '2016-01-18-23' )) or (( testcube . ttd ) =  '2016-01-19-00' )) or (( testcube . ttd ) =  '2016-01-19-01' )) or (( testcube . ttd ) =  '2016-01-19-02' )) or (( testcube . ttd ) =  '2016-01-19-03' )))) GROUP BY ( timehourchain1 . full_hour )
      @@2 SELECT ( timehourchain1 . full_hour ), sum(( testcube . msr2 )) FROM TestQueryRewrite.c4_testfact2 testcube join TestQueryRewrite.c3_hourdimtbl timehourchain1 on testcube.test_time_dim_hour_id = timehourchain1.id and (timehourchain1.dt = 'latest') WHERE ((((((((((((((((((((((((((((((((((((((((((((((((((( timehourchain1 . full_hour ) =  '2016-01-17-04' ) or (( timehourchain1 . full_hour ) =  '2016-01-17-05' )) or (( timehourchain1 . full_hour ) =  '2016-01-17-06' )) or (( timehourchain1 . full_hour ) =  '2016-01-17-07' )) or (( timehourchain1 . full_hour ) =  '2016-01-17-08' )) or (( timehourchain1 . full_hour ) =  '2016-01-17-09' )) or (( timehourchain1 . full_hour ) =  '2016-01-17-10' )) or (( timehourchain1 . full_hour ) =  '2016-01-17-11' )) or (( timehourchain1 . full_hour ) =  '2016-01-17-12' )) or (( timehourchain1 . full_hour ) =  '2016-01-17-13' )) or (( timehourchain1 . full_hour ) =  '2016-01-17-14' )) or (( timehourchain1 . full_hour ) =  '2016-01-17-15' )) or (( timehourchain1 . full_hour ) =  '2016-01-17-16' )) or (( timehourchain1 . full_hour ) =  '2016-01-17-17' )) or (( timehourchain1 . full_hour ) =  '2016-01-17-18' )) or (( timehourchain1 . full_hour ) =  '2016-01-17-19' )) or (( timehourchain1 . full_hour ) =  '2016-01-17-20' )) or (( timehourchain1 . full_hour ) =  '2016-01-17-21' )) or (( timehourchain1 . full_hour ) =  '2016-01-17-22' )) or (( timehourchain1 . full_hour ) =  '2016-01-17-23' )) or (( timehourchain1 . full_hour ) =  '2016-01-18-00' )) or (( timehourchain1 . full_hour ) =  '2016-01-18-01' )) or (( timehourchain1 . full_hour ) =  '2016-01-18-02' )) or (( timehourchain1 . full_hour ) =  '2016-01-18-03' )) or (( timehourchain1 . full_hour ) =  '2016-01-18-04' )) or (( timehourchain1 . full_hour ) =  '2016-01-18-05' )) or (( timehourchain1 . full_hour ) =  '2016-01-18-06' )) or (( timehourchain1 . full_hour ) =  '2016-01-18-07' )) or (( timehourchain1 . full_hour ) =  '2016-01-18-08' )) or (( timehourchain1 . full_hour ) =  '2016-01-18-09' )) or (( timehourchain1 . full_hour ) =  '2016-01-18-10' )) or (( timehourchain1 . full_hour ) =  '2016-01-18-11' )) or (( timehourchain1 . full_hour ) =  '2016-01-18-12' )) or (( timehourchain1 . full_hour ) =  '2016-01-18-13' )) or (( timehourchain1 . full_hour ) =  '2016-01-18-14' )) or (( timehourchain1 . full_hour ) =  '2016-01-18-15' )) or (( timehourchain1 . full_hour ) =  '2016-01-18-16' )) or (( timehourchain1 . full_hour ) =  '2016-01-18-17' )) or (( timehourchain1 . full_hour ) =  '2016-01-18-18' )) or (( timehourchain1 . full_hour ) =  '2016-01-18-19' )) or (( timehourchain1 . full_hour ) =  '2016-01-18-20' )) or (( timehourchain1 . full_hour ) =  '2016-01-18-21' )) or (( timehourchain1 . full_hour ) =  '2016-01-18-22' )) or (( timehourchain1 . full_hour ) =  '2016-01-18-23' )) or (( timehourchain1 . full_hour ) =  '2016-01-19-00' )) or (( timehourchain1 . full_hour ) =  '2016-01-19-01' )) or (( timehourchain1 . full_hour ) =  '2016-01-19-02' )) or (( timehourchain1 . full_hour ) =  '2016-01-19-03' )))) GROUP BY ( timehourchain1 . full_hour )
      @@ testDateStr=2014/09/23-12.02.05.500 parsed date=Tue Sep 23 12:02:05 UTC 2014MismatchedTokenException(-1!=295)
      	at org.antlr.runtime.BaseRecognizer.recoverFromMismatchedToken(BaseRecognizer.java:617)
      	at org.antlr.runtime.BaseRecognizer.match(BaseRecognizer.java:115)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.atomExpression(HiveParser_IdentifiersParser.java:6882)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceFieldExpression(HiveParser_IdentifiersParser.java:6947)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceUnaryPrefixExpression(HiveParser_IdentifiersParser.java:7332)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceUnarySuffixExpression(HiveParser_IdentifiersParser.java:7392)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceBitwiseXorExpression(HiveParser_IdentifiersParser.java:7576)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceStarExpression(HiveParser_IdentifiersParser.java:7736)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedencePlusExpression(HiveParser_IdentifiersParser.java:7896)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceAmpersandExpression(HiveParser_IdentifiersParser.java:8047)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceBitwiseOrExpression(HiveParser_IdentifiersParser.java:8206)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceEqualExpression(HiveParser_IdentifiersParser.java:8736)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceNotExpression(HiveParser_IdentifiersParser.java:9749)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceAndExpression(HiveParser_IdentifiersParser.java:9868)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceOrExpression(HiveParser_IdentifiersParser.java:10027)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.expression(HiveParser_IdentifiersParser.java:6652)
      	at org.apache.hadoop.hive.ql.parse.HiveParser.expression(HiveParser.java:40376)
      	at org.apache.hadoop.hive.ql.parse.ParseDriver.parseExpression(ParseDriver.java:267)
      	at org.apache.lens.cube.metadata.MetastoreUtil.parseExpr(MetastoreUtil.java:549)
      	at org.apache.lens.cube.metadata.ExprColumn$ExprSpec.getASTNode(ExprColumn.java:148)
      	at org.apache.lens.cube.metadata.ExprColumn$ExprSpec.<init>(ExprColumn.java:142)
      	at org.apache.lens.cube.metadata.TestExprColumn.testExprColumnCreationErrors(TestExprColumn.java:168)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
      	at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
      	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
      	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
      	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
      	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
      	at org.testng.TestRunner.privateRun(TestRunner.java:767)
      	at org.testng.TestRunner.run(TestRunner.java:617)
      	at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
      	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
      	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
      	at org.testng.SuiteRunner.run(SuiteRunner.java:240)
      	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
      	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
      	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1198)
      	at org.testng.TestNG.runSuitesLocally(TestNG.java:1123)
      	at org.testng.TestNG.run(TestNG.java:1031)
      	at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:69)
      	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:181)
      	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:99)
      	at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:113)
      	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
      	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
      	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
      MismatchedTokenException(-1!=295)
      	at org.antlr.runtime.BaseRecognizer.recoverFromMismatchedToken(BaseRecognizer.java:617)
      	at org.antlr.runtime.BaseRecognizer.match(BaseRecognizer.java:115)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.atomExpression(HiveParser_IdentifiersParser.java:6882)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceFieldExpression(HiveParser_IdentifiersParser.java:6947)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceUnaryPrefixExpression(HiveParser_IdentifiersParser.java:7332)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceUnarySuffixExpression(HiveParser_IdentifiersParser.java:7392)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceBitwiseXorExpression(HiveParser_IdentifiersParser.java:7576)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceStarExpression(HiveParser_IdentifiersParser.java:7736)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedencePlusExpression(HiveParser_IdentifiersParser.java:7896)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceAmpersandExpression(HiveParser_IdentifiersParser.java:8047)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceBitwiseOrExpression(HiveParser_IdentifiersParser.java:8206)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceEqualExpression(HiveParser_IdentifiersParser.java:8736)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceNotExpression(HiveParser_IdentifiersParser.java:9749)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceAndExpression(HiveParser_IdentifiersParser.java:9868)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceOrExpression(HiveParser_IdentifiersParser.java:10027)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.expression(HiveParser_IdentifiersParser.java:6652)
      	at org.apache.hadoop.hive.ql.parse.HiveParser.expression(HiveParser.java:40376)
      	at org.apache.hadoop.hive.ql.parse.ParseDriver.parseExpression(ParseDriver.java:267)
      	at org.apache.lens.cube.metadata.MetastoreUtil.parseExpr(MetastoreUtil.java:549)
      	at org.apache.lens.cube.metadata.ExprColumn$ExprSpec.getASTNode(ExprColumn.java:148)
      	at org.apache.lens.cube.metadata.ExprColumn$ExprSpec.<init>(ExprColumn.java:142)
      	at org.apache.lens.cube.metadata.TestExprColumn.testExprColumnCreationErrors(TestExprColumn.java:176)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
      	at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
      	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
      	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
      	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
      	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
      	at org.testng.TestRunner.privateRun(TestRunner.java:767)
      	at org.testng.TestRunner.run(TestRunner.java:617)
      	at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
      	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
      	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
      	at org.testng.SuiteRunner.run(SuiteRunner.java:240)
      	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
      	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
      	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1198)
      	at org.testng.TestNG.runSuitesLocally(TestNG.java:1123)
      	at org.testng.TestNG.run(TestNG.java:1031)
      	at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:69)
      	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:181)
      	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:99)
      	at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:113)
      	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
      	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
      	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
       * 
       tab . * , ( tab2 . a ), ( tab2 . b )
       count(*) 
      count( tab . * )
       col1  between  10  and  100 
      (((((((((( a  <=>  10 ) and (( b  &  c ) =  10 )) and (( d  |  e ) =  10 )) and (( f  ^  g ) =  10 )) and (( h  %  2 ) =  1 )) and ( ~  i  =  10 )) and  not  j ) and  not  k ) and  true ) and  false )
      reconstructed clause 
       case ((( col1  *  100 ) /  200 ) +  5 ) when  'ABC'  then  'def'  when  'EFG'  then  'hij'  else  'XyZ'  end  as `ComplexCaseStatement` 
      reconstructed clause 2
       case  when ( col1  =  'abc' ) then  'def'  when ( col1  =  'ghi' ) then  'jkl'  else  'none'  end  as `Complex_Case_Statement_2` 
      reconstructed clause 
       case ((( col1  *  100 ) /  200 ) +  5 ) when  'ABC'  then  'def'  when  'EFG'  then  'hij'  end  as `ComplexCaseStatement` 
      reconstructed clause 2
       case  when ( col1  =  'abc' ) then  'def'  when ( col1  =  'ghi' ) then  'jkl'  end  as `Complex_Case_Statement_2` 
      
      TOK_QUERY
         TOK_FROM
            TOK_TABREF
               TOK_TABNAME
                  table
         TOK_INSERT
            TOK_DESTINATION
               TOK_DIR
                  TOK_TMP_FILE
            TOK_SELECT
               TOK_SELEXPR
                  3.1415926BD
            TOK_LIMIT
               1
      
       a [ 2 ],  b [ 'key' ], ( c . d )
      ###Actual order by:a  asc , g( b )  asc ,  e  /  100   asc
       a  in ( 'B'  ,  'C'  ,  'D'  ,  'E'  ,  'F' )
       a  not  in ( 'B'  ,  'C'  ,  'D'  ,  'E'  ,  'F' )
       col1  is not null 
       col1  is null 
      TOK_SELECT [TOK_SELECT] (l0c0p8) {
        TOK_SELEXPR [TOK_SELEXPR] (l1c1p8) {
          - [MINUS] (l2c1p8) {
            2 [Number] (l3c1p7)$
            1 [Number] (l3c2p9)$
          }
          col1 [Identifier] (l2c2p14)$
        }
        TOK_SELEXPR [TOK_SELEXPR] (l1c2p19) {
          TOK_TABLE_OR_COL [TOK_TABLE_OR_COL] (l2c1p19) {
            col2 [Identifier] (l3c1p19)$
          }
        }
      }
      genQuery1: ( 2  -  1 ) as `col1` ,  col2 
      TOK_SELECT [TOK_SELECT] (l0c0p7) {
        TOK_SELEXPR [TOK_SELEXPR] (l1c1p7) {
          - [MINUS] (l2c1p7) {
            1 [Number] (l3c1p8)$
          }
          col1 [Identifier] (l2c2p13)$
        }
        TOK_SELEXPR [TOK_SELEXPR] (l1c2p18) {
          TOK_TABLE_OR_COL [TOK_TABLE_OR_COL] (l2c1p18) {
            col2 [Identifier] (l3c1p18)$
          }
        }
      }
      genQuery2: ( -  1 ) as `col1` ,  col2 
      TOK_SELECT [TOK_SELECT] (l0c0p9) {
        TOK_SELEXPR [TOK_SELEXPR] (l1c1p9) {
          - [MINUS] (l2c1p9) {
            1 [Number] (l3c1p12)$
          }
          col1 [Identifier] (l2c2p19)$
        }
        TOK_SELEXPR [TOK_SELEXPR] (l1c2p29) {
          TOK_TABLE_OR_COL [TOK_TABLE_OR_COL] (l2c1p29) {
            col2 [Identifier] (l3c1p29)$
          }
        }
      }
       col1  not between  10  and  100 
      RECONSTRUCTED0: citytable . id   asc 
      RECONSTRUCTED1: citytable . id   asc 
      RECONSTRUCTED2: citytable . id   asc ,  citytable . name   desc 
      RECONSTRUCTED3: citytable . id   asc 
      testAutoJoinResolverauto join HQL:SELECT ( cubecity . name ), ( dim2chain . name ), ( dim4chain . name ), ( testcube . msr2 ) FROM TestQueryRewrite.c1_testfact2_raw testcube join TestQueryRewrite.c1_citytable cubecity on testcube.cityid = cubecity.id and (cubecity.dt = 'latest') join TestQueryRewrite.c1_testdim2tbl dim2chain on testcube.dim2 = dim2chain.id and (dim2chain.dt = 'latest') join TestQueryRewrite.c1_testdim3tbl testdim3 on dim2chain.testdim3id = testdim3.id and (testdim3.dt = 'latest') join TestQueryRewrite.c1_testdim4tbl dim4chain on testdim3.testdim4id = dim4chain.id and (dim4chain.dt = 'latest') WHERE ((((((((((((((((((((((((((((((((((((((((((((((((((( testcube . dt ) =  '2016-01-17-04' ) or (( testcube . dt ) =  '2016-01-17-05' )) or (( testcube . dt ) =  '2016-01-17-06' )) or (( testcube . dt ) =  '2016-01-17-07' )) or (( testcube . dt ) =  '2016-01-17-08' )) or (( testcube . dt ) =  '2016-01-17-09' )) or (( testcube . dt ) =  '2016-01-17-10' )) or (( testcube . dt ) =  '2016-01-17-11' )) or (( testcube . dt ) =  '2016-01-17-12' )) or (( testcube . dt ) =  '2016-01-17-13' )) or (( testcube . dt ) =  '2016-01-17-14' )) or (( testcube . dt ) =  '2016-01-17-15' )) or (( testcube . dt ) =  '2016-01-17-16' )) or (( testcube . dt ) =  '2016-01-17-17' )) or (( testcube . dt ) =  '2016-01-17-18' )) or (( testcube . dt ) =  '2016-01-17-19' )) or (( testcube . dt ) =  '2016-01-17-20' )) or (( testcube . dt ) =  '2016-01-17-21' )) or (( testcube . dt ) =  '2016-01-17-22' )) or (( testcube . dt ) =  '2016-01-17-23' )) or (( testcube . dt ) =  '2016-01-18-00' )) or (( testcube . dt ) =  '2016-01-18-01' )) or (( testcube . dt ) =  '2016-01-18-02' )) or (( testcube . dt ) =  '2016-01-18-03' )) or (( testcube . dt ) =  '2016-01-18-04' )) or (( testcube . dt ) =  '2016-01-18-05' )) or (( testcube . dt ) =  '2016-01-18-06' )) or (( testcube . dt ) =  '2016-01-18-07' )) or (( testcube . dt ) =  '2016-01-18-08' )) or (( testcube . dt ) =  '2016-01-18-09' )) or (( testcube . dt ) =  '2016-01-18-10' )) or (( testcube . dt ) =  '2016-01-18-11' )) or (( testcube . dt ) =  '2016-01-18-12' )) or (( testcube . dt ) =  '2016-01-18-13' )) or (( testcube . dt ) =  '2016-01-18-14' )) or (( testcube . dt ) =  '2016-01-18-15' )) or (( testcube . dt ) =  '2016-01-18-16' )) or (( testcube . dt ) =  '2016-01-18-17' )) or (( testcube . dt ) =  '2016-01-18-18' )) or (( testcube . dt ) =  '2016-01-18-19' )) or (( testcube . dt ) =  '2016-01-18-20' )) or (( testcube . dt ) =  '2016-01-18-21' )) or (( testcube . dt ) =  '2016-01-18-22' )) or (( testcube . dt ) =  '2016-01-18-23' )) or (( testcube . dt ) =  '2016-01-19-00' )) or (( testcube . dt ) =  '2016-01-19-01' )) or (( testcube . dt ) =  '2016-01-19-02' )) or (( testcube . dt ) =  '2016-01-19-03' ))))
      testAutoJoinResolver@@Resolved join chain:[TestQueryRewrite.c1_testfact2_raw testcube join TestQueryRewrite.c1_citytable cubecity on testcube.cityid = cubecity.id and (cubecity.dt = 'latest') join TestQueryRewrite.c1_testdim2tbl dim2chain on testcube.dim2 = dim2chain.id and (dim2chain.dt = 'latest') join TestQueryRewrite.c1_testdim3tbl testdim3 on dim2chain.testdim3id = testdim3.id and (testdim3.dt = 'latest') join TestQueryRewrite.c1_testdim4tbl dim4chain on testdim3.testdim4id = dim4chain.id and (dim4chain.dt = 'latest')]
      testAutoJoinResolverExpected1[TestQueryRewrite.c1_testfact2_raw testcube, TestQueryRewrite.c1_citytable cubecity on testcube.cityid = cubecity.id and (cubecity.dt = 'latest'), TestQueryRewrite.c1_testdim2tbl dim2chain on testcube.dim2 = dim2chain.id and (dim2chain.dt = 'latest'), TestQueryRewrite.c1_testdim3tbl testdim3 on dim2chain.testdim3id = testdim3.id and (testdim3.dt = 'latest'), TestQueryRewrite.c1_testdim4tbl dim4chain on testdim3.testdim4id = dim4chain.id and (dim4chain.dt = 'latest')]
      testAutoJoinResolverActual1[TestQueryRewrite.c1_testfact2_raw testcube, TestQueryRewrite.c1_citytable cubecity on testcube.cityid = cubecity.id and (cubecity.dt = 'latest'), TestQueryRewrite.c1_testdim2tbl dim2chain on testcube.dim2 = dim2chain.id and (dim2chain.dt = 'latest'), TestQueryRewrite.c1_testdim3tbl testdim3 on dim2chain.testdim3id = testdim3.id and (testdim3.dt = 'latest'), TestQueryRewrite.c1_testdim4tbl dim4chain on testdim3.testdim4id = dim4chain.id and (dim4chain.dt = 'latest')]
      testAutoJoinResolverauto join HQL:SELECT ( testdim2 . name ), ( dim4chain . name ) FROM TestQueryRewrite.c1_testdim2tbl testdim2 join TestQueryRewrite.c1_testdim3tbl testdim3 on testdim2.testdim3id = testdim3.id and (testdim3.dt = 'latest') join TestQueryRewrite.c1_testdim4tbl dim4chain on testdim3.testdim4id = dim4chain.id and (dim4chain.dt = 'latest') WHERE ((time_range_in( d_time ,  '2016-01-17-04' ,  '2016-01-19-04' ) AND ((testdim2.dt = 'latest'))))
      testAutoJoinResolver@@Resolved join chain:[TestQueryRewrite.c1_testdim2tbl testdim2 join TestQueryRewrite.c1_testdim3tbl testdim3 on testdim2.testdim3id = testdim3.id and (testdim3.dt = 'latest') join TestQueryRewrite.c1_testdim4tbl dim4chain on testdim3.testdim4id = dim4chain.id and (dim4chain.dt = 'latest')]
      testAutoJoinResolverExpected2[TestQueryRewrite.c1_testdim2tbl testdim2, TestQueryRewrite.c1_testdim3tbl testdim3 on testdim2.testdim3id = testdim3.id and (testdim3.dt = 'latest'), TestQueryRewrite.c1_testdim4tbl dim4chain on testdim3.testdim4id = dim4chain.id and (dim4chain.dt = 'latest')]
      testAutoJoinResolverActual2[TestQueryRewrite.c1_testdim2tbl testdim2, TestQueryRewrite.c1_testdim3tbl testdim3 on testdim2.testdim3id = testdim3.id and (testdim3.dt = 'latest'), TestQueryRewrite.c1_testdim4tbl dim4chain on testdim3.testdim4id = dim4chain.id and (dim4chain.dt = 'latest')]
      testAutoJoinResolverauto join HQL:SELECT ( testdim2 . name ), ( citystate . capital ) FROM TestQueryRewrite.c1_testdim2tbl testdim2 join TestQueryRewrite.c1_citytable citydim on testdim2.cityid = citydim.id and (citydim.dt = 'latest') join TestQueryRewrite.c1_statetable citystate on citydim.stateid = citystate.id and (citystate.dt = 'latest') WHERE ((time_range_in( d_time ,  '2016-01-17-04' ,  '2016-01-19-04' ) AND ((testdim2.dt = 'latest'))))
      testAutoJoinResolver@@Resolved join chain:[TestQueryRewrite.c1_testdim2tbl testdim2 join TestQueryRewrite.c1_citytable citydim on testdim2.cityid = citydim.id and (citydim.dt = 'latest') join TestQueryRewrite.c1_statetable citystate on citydim.stateid = citystate.id and (citystate.dt = 'latest')]
      testDimOnlyJoinChainExpected1 : [TestQueryRewrite.c1_testdim2tbl testdim2, TestQueryRewrite.c1_citytable citydim on testdim2.cityid = citydim.id and (citydim.dt = 'latest'), TestQueryRewrite.c1_statetable citystate on citydim.stateid = citystate.id and (citystate.dt = 'latest')]
      testDimOnlyJoinChainActual1 : [TestQueryRewrite.c1_testdim2tbl testdim2, TestQueryRewrite.c1_citytable citydim on testdim2.cityid = citydim.id and (citydim.dt = 'latest'), TestQueryRewrite.c1_statetable citystate on citydim.stateid = citystate.id and (citystate.dt = 'latest')]
      testAutoJoinResolverauto join HQL:SELECT ( testdim2 . name ), ( citystate . capital ) FROM TestQueryRewrite.c1_testdim2tbl testdim2 join TestQueryRewrite.c1_citytable citydim on testdim2.cityid = citydim.id and (citydim.dt = 'latest') join TestQueryRewrite.c1_statetable citystate on citydim.stateid = citystate.id and (citystate.dt = 'latest') WHERE ((time_range_in( d_time ,  '2016-01-17-04' ,  '2016-01-19-04' ) AND ((testdim2.dt = 'latest'))))
      testAutoJoinResolver@@Resolved join chain:[TestQueryRewrite.c1_testdim2tbl testdim2 join TestQueryRewrite.c1_citytable citydim on testdim2.cityid = citydim.id and (citydim.dt = 'latest') join TestQueryRewrite.c1_statetable citystate on citydim.stateid = citystate.id and (citystate.dt = 'latest')]
      testDimOnlyJoinChainExpected1 : [TestQueryRewrite.c1_testdim2tbl testdim2, TestQueryRewrite.c1_citytable citydim on testdim2.cityid = citydim.id and (citydim.dt = 'latest'), TestQueryRewrite.c1_statetable citystate on citydim.stateid = citystate.id and (citystate.dt = 'latest')]
      testDimOnlyJoinChainActual1 : [TestQueryRewrite.c1_testdim2tbl testdim2, TestQueryRewrite.c1_citytable citydim on testdim2.cityid = citydim.id and (citydim.dt = 'latest'), TestQueryRewrite.c1_statetable citystate on citydim.stateid = citystate.id and (citystate.dt = 'latest')]
      testAutoJoinResolverauto join HQL:SELECT ( testdim2 . name ), ( citystate . capital ) FROM TestQueryRewrite.c1_testdim2tbl testdim2 join TestQueryRewrite.c1_citytable citydim on testdim2.cityid = citydim.id and (citydim.dt = 'latest') join TestQueryRewrite.c1_statetable citystate on citydim.stateid = citystate.id and (citystate.dt = 'latest') WHERE ((time_range_in( d_time ,  '2016-01-17-04' ,  '2016-01-19-04' ) AND ((testdim2.dt = 'latest'))))
      testAutoJoinResolver@@Resolved join chain:[TestQueryRewrite.c1_testdim2tbl testdim2 join TestQueryRewrite.c1_citytable citydim on testdim2.cityid = citydim.id and (citydim.dt = 'latest') join TestQueryRewrite.c1_statetable citystate on citydim.stateid = citystate.id and (citystate.dt = 'latest')]
      testDimOnlyJoinChainExpected1 : [TestQueryRewrite.c1_testdim2tbl testdim2, TestQueryRewrite.c1_citytable citydim on testdim2.cityid = citydim.id and (citydim.dt = 'latest'), TestQueryRewrite.c1_statetable citystate on citydim.stateid = citystate.id and (citystate.dt = 'latest')]
      testDimOnlyJoinChainActual1 : [TestQueryRewrite.c1_testdim2tbl testdim2, TestQueryRewrite.c1_citytable citydim on testdim2.cityid = citydim.id and (citydim.dt = 'latest'), TestQueryRewrite.c1_statetable citystate on citydim.stateid = citystate.id and (citystate.dt = 'latest')]
      NoViableAltException(33@[266:1: atomExpression : ( KW_NULL -> TOK_NULL | dateLiteral | constant | castExpression | caseExpression | whenExpression | ( functionName LPAREN )=> function | tableOrColumn | LPAREN ! expression RPAREN !);])
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser$DFA34.specialStateTransition(HiveParser_IdentifiersParser.java:14963)
      	at org.antlr.runtime.DFA.predict(DFA.java:80)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.atomExpression(HiveParser_IdentifiersParser.java:6726)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceFieldExpression(HiveParser_IdentifiersParser.java:6947)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceUnaryPrefixExpression(HiveParser_IdentifiersParser.java:7332)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceUnarySuffixExpression(HiveParser_IdentifiersParser.java:7392)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceBitwiseXorExpression(HiveParser_IdentifiersParser.java:7576)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceStarExpression(HiveParser_IdentifiersParser.java:7736)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedencePlusExpression(HiveParser_IdentifiersParser.java:7919)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceAmpersandExpression(HiveParser_IdentifiersParser.java:8047)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceBitwiseOrExpression(HiveParser_IdentifiersParser.java:8206)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceEqualExpression(HiveParser_IdentifiersParser.java:8862)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceNotExpression(HiveParser_IdentifiersParser.java:9749)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceAndExpression(HiveParser_IdentifiersParser.java:9868)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceOrExpression(HiveParser_IdentifiersParser.java:10027)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.expression(HiveParser_IdentifiersParser.java:6652)
      	at org.apache.hadoop.hive.ql.parse.HiveParser.expression(HiveParser.java:40376)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_FromClauseParser.joinSource(HiveParser_FromClauseParser.java:1871)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_FromClauseParser.fromClause(HiveParser_FromClauseParser.java:1466)
      	at org.apache.hadoop.hive.ql.parse.HiveParser.fromClause(HiveParser.java:40426)
      	at org.apache.hadoop.hive.ql.parse.HiveParser.singleSelectStatement(HiveParser.java:38141)
      	at org.apache.hadoop.hive.ql.parse.HiveParser.selectStatement(HiveParser.java:37796)
      	at org.apache.hadoop.hive.ql.parse.HiveParser.regularBody(HiveParser.java:37733)
      	at org.apache.hadoop.hive.ql.parse.HiveParser.queryStatementExpressionBody(HiveParser.java:36902)
      	at org.apache.hadoop.hive.ql.parse.HiveParser.queryStatementExpression(HiveParser.java:36777)
      	at org.apache.hadoop.hive.ql.parse.HiveParser.execStatement(HiveParser.java:1341)
      	at org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:1038)
      	at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:199)
      	at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
      	at org.apache.lens.cube.parse.HQLParser.parseHQL(HQLParser.java:155)
      	at org.apache.lens.cube.parse.TestQuery.getAST(TestQuery.java:81)
      	at org.apache.lens.cube.parse.TestQuery.equals(TestQuery.java:230)
      	at org.testng.Assert.assertEquals(Assert.java:119)
      	at org.testng.Assert.assertEquals(Assert.java:165)
      	at org.apache.lens.cube.parse.TestCubeRewriter.compareQueries(TestCubeRewriter.java:285)
      	at org.apache.lens.cube.parse.TestJoinResolver.testJoinFilters(TestJoinResolver.java:147)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
      	at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
      	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
      	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
      	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
      	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
      	at org.testng.TestRunner.privateRun(TestRunner.java:767)
      	at org.testng.TestRunner.run(TestRunner.java:617)
      	at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
      	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
      	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
      	at org.testng.SuiteRunner.run(SuiteRunner.java:240)
      	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
      	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
      	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1198)
      	at org.testng.TestNG.runSuitesLocally(TestNG.java:1123)
      	at org.testng.TestNG.run(TestNG.java:1031)
      	at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:69)
      	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:181)
      	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:99)
      	at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:113)
      	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
      	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
      	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
      results:{S3=[dt = '2015-11', dt = '2016-01-17', dt = '2016-01-19-04']}
      results:{S3=[dt = '2015-11'], S4=[dt = '2016-01-17'], S5=[dt = '2016-01-19-04']}
      results:{S3=[dt = '2016-01-19-04'], S1=[dt = '2015-11'], S2=[dt = '2016-01-17']}
      results:{S4=[dt = '2016-01-19-04'], S2=[dt = '2015-11', dt = '2016-01-17']}
      results:{S4=[dt = '2016-01-17', dt = '2016-01-19-04'], S1=[dt = '2015-11']}
      results:{S3=[dt = '2016-01-17', dt = '2016-01-19-04'], S1=[dt = '2015-11']}
      results:{S1=[dt = '2015-11', dt = '2016-01-19-04'], S2=[dt = '2016-01-17']}
      ###
      Expected :(test.dt = '2016-01-18')
      Expected :(test.dt = '2016-01-18 04:54:12')
      Expected :(test.dt = '2016-01-18') OR (test.dt = '2016-01-17') OR (test.dt = '2016-01-19')
      Expected :(test.dt = '2016-01-18 04:54:12') OR (test.dt = '2016-01-17 04:54:12') OR (test.dt = '2016-01-19 04:54:12')
      Expected :(test.dt = '2015-11') OR (test.dt = '2016-01-17') OR (test.dt = '2016-01-19-04')
      Expected :(test.dt = '2015-11-19 04:54:12') OR (test.dt = '2016-01-17 04:54:12') OR (test.dt = '2016-01-19 04:54:12')
      Expected :(test.dt = '2016-01-18')
      Expected :(test.dt = '2016-01-18 04:54:12')
      HQL:SELECT sum(( testcube . msr2 )) FROM TestQueryRewrite.c1_testfact testcube WHERE ((( testcube . dt ) between  '2016-01-17-04-54-12'  and  '2016-01-19-04-54-12' ))
      HQL:SELECT sum(( testcube . msr2 )) FROM TestQueryRewrite.c1_testfact testcube WHERE (((( testcube . dt ) between  '2016-01-17-04-54-12'  and  '2016-01-19-04-54-12'  or ( testcube . dt ) between  '2016-01-13-04-54-12'  and  '2016-01-19-04-54-12' )))
      HQL:SELECT sum(( testcube . msr2 )) FROM TestQueryRewrite.c1_testfact testcube WHERE ((( testcube . dt ) between  '2016-01-17 04:00:00'  and  '2016-01-19 04:00:00' ))
      HQL:SELECT ( timehourchain1 . full_hour ), sum(( testcube . msr2 )) FROM TestQueryRewrite.c4_testfact2 testcube join TestQueryRewrite.c4_hourdimtbl timehourchain1 on testcube.test_time_dim_hour_id = timehourchain1.id WHERE ((( timehourchain1 . full_hour ) between  '2016-01-17 04:00:00'  and  '2016-01-19 03:00:00' )) GROUP BY ( timehourchain1 . full_hour )
      HQL:SELECT sum(( testcube . msr2 )) FROM TestQueryRewrite.c4_testfact2 testcube join TestQueryRewrite.c4_hourdimtbl timehourchain1 on testcube.test_time_dim_hour_id = timehourchain1.id WHERE ((( timehourchain1 . full_hour ) between  '2016-01-17 04:00:00'  and  '2016-01-19 03:00:00' ))
      HQL:SELECT sum(( testcube . msr2 )) FROM TestQueryRewrite.c4_testfact2 testcube join TestQueryRewrite.c4_hourdimtbl timehourchain1 on testcube.test_time_dim_hour_id = timehourchain1.id WHERE (((((( testcube . cityid ) >  2 ) and ( timehourchain1 . full_hour ) between  '2016-01-17 04:00:00'  and  '2016-01-19 03:00:00' ) and (( testcube . cityid ) !=  5 ))))
      HQL:SELECT sum(( testcube . msr2 )) FROM TestQueryRewrite.c4_testfact2 testcube join TestQueryRewrite.c4_hourdimtbl timehourchain1 on testcube.test_time_dim_hour_id = timehourchain1.id WHERE (((( timehourchain1 . full_hour ) between  '2016-01-17 04:00:00'  and  '2016-01-19 03:00:00'  or ( timehourchain1 . full_hour ) between  '2016-01-13 04:00:00'  and  '2016-01-15 03:00:00' )))
      HQL:SELECT to_date(( timehourchain1 . full_hour )), sum(( testcube . msr2 )) FROM TestQueryRewrite.c4_testfact2 testcube join TestQueryRewrite.c4_hourdimtbl timehourchain1 on testcube.test_time_dim_hour_id = timehourchain1.id WHERE (((( timehourchain1 . full_hour ) between  '2016-01-17 04:00:00'  and  '2016-01-19 03:00:00'  or ( timehourchain1 . full_hour ) between  '2016-01-13 04:00:00'  and  '2016-01-15 03:00:00' ))) GROUP BY to_date(( timehourchain1 . full_hour ))
      HQL:SELECT ( timehourchain2 . full_hour ), sum(( testcube . msr2 )) FROM TestQueryRewrite.c4_testfact2 testcube join TestQueryRewrite.c4_hourdimtbl timehourchain2 on testcube.test_time_dim_hour_id2 = timehourchain2.id WHERE ((( timehourchain2 . full_hour ) between  '2016-01-17 04:00:00'  and  '2016-01-19 03:00:00' )) GROUP BY ( timehourchain2 . full_hour )
      HQL:SELECT sum(( testcube . msr2 )) FROM TestQueryRewrite.c4_testfact2 testcube join TestQueryRewrite.c4_hourdimtbl timehourchain2 on testcube.test_time_dim_hour_id2 = timehourchain2.id WHERE ((( timehourchain2 . full_hour ) between  '2016-01-17 04:00:00'  and  '2016-01-19 03:00:00' ))
      HQL:SELECT sum(( testcube . msr2 )) FROM TestQueryRewrite.c4_testfact2 testcube join TestQueryRewrite.c4_hourdimtbl timehourchain2 on testcube.test_time_dim_hour_id2 = timehourchain2.id WHERE (((((( testcube . cityid ) >  2 ) and ( timehourchain2 . full_hour ) between  '2016-01-17 04:00:00'  and  '2016-01-19 03:00:00' ) and (( testcube . cityid ) !=  5 ))))
      HQL:SELECT sum(( testcube . msr2 )) FROM TestQueryRewrite.c4_testfact2 testcube join TestQueryRewrite.c4_hourdimtbl timehourchain2 on testcube.test_time_dim_hour_id2 = timehourchain2.id WHERE (((( timehourchain2 . full_hour ) between  '2016-01-17 04:00:00'  and  '2016-01-19 03:00:00'  or ( timehourchain2 . full_hour ) between  '2016-01-13 04:00:00'  and  '2016-01-15 03:00:00' )))
      HQL:SELECT to_date(( timehourchain2 . full_hour )), sum(( testcube . msr2 )) FROM TestQueryRewrite.c4_testfact2 testcube join TestQueryRewrite.c4_hourdimtbl timehourchain2 on testcube.test_time_dim_hour_id2 = timehourchain2.id WHERE (((( timehourchain2 . full_hour ) between  '2016-01-17 04:00:00'  and  '2016-01-19 03:00:00'  or ( timehourchain2 . full_hour ) between  '2016-01-13 04:00:00'  and  '2016-01-15 03:00:00' ))) GROUP BY to_date(( timehourchain2 . full_hour ))
      MismatchedTokenException(-1!=295)
      	at org.antlr.runtime.BaseRecognizer.recoverFromMismatchedToken(BaseRecognizer.java:617)
      	at org.antlr.runtime.BaseRecognizer.match(BaseRecognizer.java:115)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.function(HiveParser_IdentifiersParser.java:4979)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.atomExpression(HiveParser_IdentifiersParser.java:6844)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceFieldExpression(HiveParser_IdentifiersParser.java:6947)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceUnaryPrefixExpression(HiveParser_IdentifiersParser.java:7332)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceUnarySuffixExpression(HiveParser_IdentifiersParser.java:7392)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceBitwiseXorExpression(HiveParser_IdentifiersParser.java:7576)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceStarExpression(HiveParser_IdentifiersParser.java:7736)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedencePlusExpression(HiveParser_IdentifiersParser.java:7896)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceAmpersandExpression(HiveParser_IdentifiersParser.java:8047)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceBitwiseOrExpression(HiveParser_IdentifiersParser.java:8206)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceEqualExpression(HiveParser_IdentifiersParser.java:8736)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceNotExpression(HiveParser_IdentifiersParser.java:9749)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceAndExpression(HiveParser_IdentifiersParser.java:9868)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceOrExpression(HiveParser_IdentifiersParser.java:10027)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.expression(HiveParser_IdentifiersParser.java:6652)
      	at org.apache.hadoop.hive.ql.parse.HiveParser.expression(HiveParser.java:40376)
      	at org.apache.hadoop.hive.ql.parse.ParseDriver.parseExpression(ParseDriver.java:267)
      	at org.apache.lens.cube.metadata.MetastoreUtil.parseExpr(MetastoreUtil.java:549)
      	at org.apache.lens.cube.metadata.ExprColumn.addExpression(ExprColumn.java:387)
      	at org.apache.lens.cube.metadata.TestCubeMetastoreClient.testDimension(TestCubeMetastoreClient.java:540)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
      	at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
      	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
      	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
      	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
      	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
      	at org.testng.TestRunner.privateRun(TestRunner.java:767)
      	at org.testng.TestRunner.run(TestRunner.java:617)
      	at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
      	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
      	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
      	at org.testng.SuiteRunner.run(SuiteRunner.java:240)
      	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
      	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
      	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1198)
      	at org.testng.TestNG.runSuitesLocally(TestNG.java:1123)
      	at org.testng.TestNG.run(TestNG.java:1031)
      	at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:69)
      	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:181)
      	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:99)
      	at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:113)
      	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
      	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
      	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
      

      https://builds.apache.org/job/Lens-Commit-Java8/85/org.apache.lens$lens-cube/testReport/org.apache.lens.cube.parse/TestDenormalizationResolver/testDenormsAsDirectFields/

      Attachments

        1. LENS-927.1.patch
          4 kB
          Amareshwari Sriramadasu

        Activity

          People

            amareshwari Amareshwari Sriramadasu
            puneet884 Puneet Gupta
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: