@Test public void testMaterializedExpressionPickingMaterializedValue() throws Exception { Configuration newConf = new Configuration(conf); newConf.set(CubeQueryConfUtil.DRIVER_SUPPORTED_STORAGES, "C2"); newConf.set(CubeQueryConfUtil.getValidFactTablesKey(cubeName), "testFact"); String hqlQuery = rewrite("select msr5 from testCube where " + TWO_DAYS_RANGE, newConf); String expected = getExpectedQuery( cubeName, "select testcube.msr5 FROM ", null, null, getWhereForDailyAndHourly2days(cubeName, "C2_testfact")); TestCubeRewriter.compareQueries(hqlQuery, expected); }