MV has issues when create on constant column, dupicate columns and limit queries
test case to reproduce
test("test mv with duplicate columns in query and constant column")
{
sql("drop table if exists maintable")
sql("create table maintable(name string, age int, add string) stored by 'carbondata'")
sql("create datamap dupli_mv using 'mv' as select name, sum(age),sum(age) from maintable group by name")
sql("create datamap constant_mv using 'mv' as select name, sum(1) ex1 from maintable group by name")
sql("insert into maintable select 'pheobe',31,'NY'")
val df1 = sql("select sum(age),name from maintable group by name")
val df2 = sql("select sum(age),sum(age),name from maintable group by name")
val df3 = sql("select name, sum(1) ex1 from maintable group by name")
val df4 = sql("select sum(1) ex1 from maintable group by name")
val analyzed1 = df1.queryExecution.analyzed
val analyzed2 = df2.queryExecution.analyzed
val analyzed3 = df3.queryExecution.analyzed
val analyzed4 = df4.queryExecution.analyzed
assert(TestUtil.verifyMVDataMap(analyzed1, "dupli_mv"))
assert(TestUtil.verifyMVDataMap(analyzed2, "dupli_mv"))
assert(TestUtil.verifyMVDataMap(analyzed3, "constant_mv"))
assert(TestUtil.verifyMVDataMap(analyzed4, "constant_mv"))
}