You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@carbondata.apache.org by "ray (JIRA)" <ji...@apache.org> on 2016/07/16 02:33:20 UTC

[jira] [Created] (CARBONDATA-60) wrong result when using union all

ray created CARBONDATA-60:
-----------------------------

             Summary: wrong result when using union all
                 Key: CARBONDATA-60
                 URL: https://issues.apache.org/jira/browse/CARBONDATA-60
             Project: CarbonData
          Issue Type: Bug
            Reporter: ray


the issue can be reproduced by following code:
the expected result is 1 row, but actual result is 2 rows.
+---+---+
| c1|_c1|
+---+---+
|200|  1|
|279|  1|
+---+---+

    import cc.implicits._
    val df=sc.parallelize(1 to 1000).map(x => (x+"", (x+100)+"")).toDF("c1", "c2")

    import org.carbondata.spark._
    df.saveAsCarbonFile(Map("tableName" -> "carbon1"))

    cc.sql("""
    select c1,count(*) from(
      select c1 as c1,c2 as c2 from carbon1
      union all
      select c2 as c1,c1 as c2 from carbon1
     )t
      where c1='200'
      group by c1
    """).show()



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)