You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by kumarvishal09 <gi...@git.apache.org> on 2017/12/15 15:26:16 UTC

[GitHub] carbondata pull request #1671: [CARBONDATA-1901]Fixed Pre aggregate data map...

GitHub user kumarvishal09 opened a pull request:

    https://github.com/apache/carbondata/pull/1671

    [CARBONDATA-1901]Fixed Pre aggregate data map creation and query parsing 

    *Problem:*Fixed below issues in case of pre aggregate
    1. Pre aggregate data map table column order is not as per query given by user because of which while data is loaded to wrong column
    2. when aggregate function contains any expression query is failing with match error
    3. pre aggregate data map columns and parent tables columns encoder is not matching
    Solution:
    1. Do not consider group columns in pre aggregate
    2. when aggregate function contains any expression hit the maintable
    3. Get encoder from main table and add in pre aggregate table column
    When aggregation type is sum or avg create measure column
    
     - [ ] Any interfaces changed?
    No
     - [ ] Any backward compatibility impacted?
    No
      - [ ] Document update required?
    No
     - [ ] Testing done
         Added UT for all the scenario 
           
     - [ ] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA. 
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/kumarvishal09/incubator-carbondata master_13-12

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/carbondata/pull/1671.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1671
    
----
commit d24e9bcd7878b72f8fcad4b1100d03ef5c4299e2
Author: kumarvishal <ku...@gmail.com>
Date:   2017-12-14T10:37:11Z

    Fixed aggregate issue

----


---

[GitHub] carbondata issue #1671: [CARBONDATA-1901]Fixed Pre aggregate data map creati...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1671
  
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2028/



---

[GitHub] carbondata pull request #1671: [CARBONDATA-1901]Fixed Pre aggregate data map...

Posted by ravipesala <gi...@git.apache.org>.
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1671#discussion_r157337178
  
    --- Diff: integration/spark-common/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchemaCommon.scala ---
    @@ -514,17 +514,40 @@ class TableNewProcessor(cm: TableModel) {
         }
     
         cm.msrCols.foreach { field =>
    -      val encoders = new java.util.ArrayList[Encoding]()
    +      // if aggregate function is defined in case of preaggregate and agg function is sum or avg
    +      // then it can be stored as measure
    +      var isAggFunPresent = false
    +      // getting the encoder from maintable so whatever encoding is applied in maintable
    +      // same encoder can be applied on aggregate table
    +      val encoders = if (cm.parentTable.isDefined && cm.dataMapRelation.get.get(field).isDefined) {
    +        isAggFunPresent =
    +          cm.dataMapRelation.get.get(field).get.aggregateFunction.equalsIgnoreCase("sum") ||
    +          cm.dataMapRelation.get.get(field).get.aggregateFunction.equals("avg")
    --- End diff --
    
    How about count aggregate?


---

[GitHub] carbondata pull request #1671: [CARBONDATA-1901]Fixed Pre aggregate data map...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/carbondata/pull/1671


---

[GitHub] carbondata issue #1671: [CARBONDATA-1901]Fixed Pre aggregate data map creati...

Posted by ravipesala <gi...@git.apache.org>.
Github user ravipesala commented on the issue:

    https://github.com/apache/carbondata/pull/1671
  
    SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2339/



---

[GitHub] carbondata issue #1671: [CARBONDATA-1901]Fixed Pre aggregate data map creati...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1671
  
    Build Failed with Spark 2.2.0, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/815/



---

[GitHub] carbondata issue #1671: [CARBONDATA-1901]Fixed Pre aggregate data map creati...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1671
  
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2046/



---

[GitHub] carbondata issue #1671: [CARBONDATA-1901]Fixed Pre aggregate data map creati...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1671
  
    Build Success with Spark 2.2.0, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/793/



---

[GitHub] carbondata pull request #1671: [CARBONDATA-1901]Fixed Pre aggregate data map...

Posted by ravipesala <gi...@git.apache.org>.
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1671#discussion_r157337026
  
    --- Diff: integration/spark-common-test/src/test/scala/org/apache/carbondata/integration/spark/testsuite/preaggregate/TestPreAggregateTableSelection.scala ---
    @@ -46,7 +38,7 @@ class TestPreAggregateTableSelection extends QueryTest with BeforeAndAfterAll {
         sql("create datamap agg6 on table mainTable using 'preaggregate' as select name,min(age) from mainTable group by name")
         sql("create datamap agg7 on table mainTable using 'preaggregate' as select name,max(age) from mainTable group by name")
         sql("create datamap agg8 on table maintable using 'preaggregate' as select name, sum(id), avg(id) from maintable group by name")
    -    sql(s"LOAD DATA LOCAL INPATH '$resourcesPath/measureinsertintotest.csv' into table mainTable")
    +    sql(s"LOAD DATA LOCAL INPATH 'D:/measureinsertintotest.csv' into table mainTable")
    --- End diff --
    
    Provide proper csv path


---

[GitHub] carbondata issue #1671: [CARBONDATA-1901]Fixed Pre aggregate data map creati...

Posted by ravipesala <gi...@git.apache.org>.
Github user ravipesala commented on the issue:

    https://github.com/apache/carbondata/pull/1671
  
    LGTM


---

[GitHub] carbondata pull request #1671: [CARBONDATA-1901]Fixed Pre aggregate data map...

Posted by kumarvishal09 <gi...@git.apache.org>.
Github user kumarvishal09 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1671#discussion_r157337872
  
    --- Diff: integration/spark-common/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchemaCommon.scala ---
    @@ -514,17 +514,40 @@ class TableNewProcessor(cm: TableModel) {
         }
     
         cm.msrCols.foreach { field =>
    -      val encoders = new java.util.ArrayList[Encoding]()
    +      // if aggregate function is defined in case of preaggregate and agg function is sum or avg
    +      // then it can be stored as measure
    +      var isAggFunPresent = false
    +      // getting the encoder from maintable so whatever encoding is applied in maintable
    +      // same encoder can be applied on aggregate table
    +      val encoders = if (cm.parentTable.isDefined && cm.dataMapRelation.get.get(field).isDefined) {
    +        isAggFunPresent =
    +          cm.dataMapRelation.get.get(field).get.aggregateFunction.equalsIgnoreCase("sum") ||
    +          cm.dataMapRelation.get.get(field).get.aggregateFunction.equals("avg")
    --- End diff --
    
    In case of sum and average data type will  be always bigint or double so we can store as measure in case of count it will be of actual data type 


---

[GitHub] carbondata issue #1671: [CARBONDATA-1901]Fixed Pre aggregate data map creati...

Posted by ravipesala <gi...@git.apache.org>.
Github user ravipesala commented on the issue:

    https://github.com/apache/carbondata/pull/1671
  
    SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2358/



---