[GitHub] carbondata pull request #1919: [WIP]Refactor datamap schema thrift and datam...

classic Classic list List threaded Threaded
33 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #1919: [WIP]Refactor datamap schema thrift and datam...

qiuchenjian-2
GitHub user ravipesala opened a pull request:

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

    [WIP]Refactor datamap schema thrift and datamap provider to use short name and classname

   
   
    Be sure to do all of the following checklist to help us incorporate
    your contribution quickly and easily:
   
     - [ ] Any interfaces changed?
     
     - [ ] Any backward compatibility impacted?
     
     - [ ] Document update required?
   
     - [ ] Testing done
            Please provide details on
            - Whether new unit test cases have been added or why no new tests are required?
            - How it is tested? Please attach test report.
            - Is it a performance related change? Please attach the performance test report.
            - Any additional information to help reviewers in testing this change.
           
     - [ ] 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/ravipesala/incubator-carbondata refactor-datamap-schemathrift

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

    https://github.com/apache/carbondata/pull/1919.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 #1919
   
----
commit d9d718dd2e4c30a5daac2ea8b31a694063c7ca77
Author: ravipesala <ravi.pesala@...>
Date:   2018-02-02T18:48:10Z

    Refactor datamap schema thrift and datamap provider to use short name and classname

----


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1919: [WIP]Refactor datamap schema thrift and datamap prov...

qiuchenjian-2
Github user CarbonDataQA commented on the issue:

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



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1919: [WIP]Refactor datamap schema thrift and datamap prov...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1919
 
    Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/2222/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1919: [CARBONDATA-2123] Refactor datamap schema thrift and...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1919
 
    Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/2228/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1919: [CARBONDATA-2123] Refactor datamap schema thrift and...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

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



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1919: [CARBONDATA-2123] Refactor datamap schema thrift and...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:

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



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #1919: [CARBONDATA-2123] Refactor datamap schema thr...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user xubo245 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1919#discussion_r165807734
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/metadata/schema/datamap/DataMapProvider.java ---
    @@ -27,6 +27,40 @@
      */
     
     public enum DataMapProvider {
    -  PREAGGREGATE,
    -  TIMESERIES;
    +  PREAGGREGATE("org.apache.carbondata.core.datamap.AggregateDataMap", "preaggregate"),
    +  TIMESERIES("org.apache.carbondata.core.datamap.TimeSeriesDataMap", "timeseries");
    +
    +  /**
    +   * Fully qualified class name of datamap
    +   */
    +  private String className;
    +
    +  /**
    +   * Short name representation of datamap
    +   */
    +  private String shortName;
    +
    +  DataMapProvider(String className, String shortName) {
    +    this.className = className;
    +    this.shortName = shortName;
    +  }
    +
    +  public String getClassName() {
    +    return className;
    +  }
    +
    +  private boolean isEqual(String dataMapClass) {
    +    return (dataMapClass != null && (dataMapClass.equals(className) ||
    +        dataMapClass.equalsIgnoreCase(shortName)));
    +  }
    +
    +  public static DataMapProvider getDataMapProvider(String dataMapClass) {
    --- End diff --
   
    suggest change "dataMapClass" to "providerName"


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #1919: [CARBONDATA-2123] Refactor datamap schema thr...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user xubo245 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1919#discussion_r165807745
 
    --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/datamap/CarbonCreateDataMapCommand.scala ---
    @@ -60,7 +61,14 @@ case class CarbonCreateDataMapCommand(
         } else {
           dmProperties
         }
    -
    +    val dataMapProvider = {
    +      try {
    +        DataMapProvider.getDataMapProvider(dmClassName)
    --- End diff --
   
    suggest change "dmClassName" to "providerName"


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1919: [CARBONDATA-2123] Refactor datamap schema thrift and...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:

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



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #1919: [CARBONDATA-2123] Refactor datamap schema thr...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1919#discussion_r165808465
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/metadata/schema/datamap/DataMapProvider.java ---
    @@ -27,6 +27,40 @@
      */
     
     public enum DataMapProvider {
    -  PREAGGREGATE,
    -  TIMESERIES;
    +  PREAGGREGATE("org.apache.carbondata.core.datamap.AggregateDataMap", "preaggregate"),
    +  TIMESERIES("org.apache.carbondata.core.datamap.TimeSeriesDataMap", "timeseries");
    +
    +  /**
    +   * Fully qualified class name of datamap
    +   */
    +  private String className;
    +
    +  /**
    +   * Short name representation of datamap
    +   */
    +  private String shortName;
    +
    +  DataMapProvider(String className, String shortName) {
    +    this.className = className;
    +    this.shortName = shortName;
    +  }
    +
    +  public String getClassName() {
    +    return className;
    +  }
    +
    +  private boolean isEqual(String dataMapClass) {
    +    return (dataMapClass != null && (dataMapClass.equals(className) ||
    +        dataMapClass.equalsIgnoreCase(shortName)));
    +  }
    +
    +  public static DataMapProvider getDataMapProvider(String dataMapClass) {
    --- End diff --
   
    it could be provider name or classname, user can give any one.


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #1919: [CARBONDATA-2123] Refactor datamap schema thr...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1919#discussion_r165808467
 
    --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/datamap/CarbonCreateDataMapCommand.scala ---
    @@ -60,7 +61,14 @@ case class CarbonCreateDataMapCommand(
         } else {
           dmProperties
         }
    -
    +    val dataMapProvider = {
    +      try {
    +        DataMapProvider.getDataMapProvider(dmClassName)
    --- End diff --
   
    it could be provider name or classname, user can give any one.


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #1919: [CARBONDATA-2123] Refactor datamap schema thr...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1919#discussion_r165809070
 
    --- Diff: format/src/main/thrift/schema.thrift ---
    @@ -192,13 +192,13 @@ struct DataMapSchema  {
         1: required string dataMapName;
         // class name
         2: required string className;
    +    // to maintain properties like select query, query type like groupby, join
    +    3: optional map<string, string> properties;
         // relation indentifier
    -    3: optional RelationIdentifier relationIdentifire;
    +    4: optional RelationIdentifier childTableIdentifer;
    --- End diff --
   
    typo, should be `childTableIdentifier`


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #1919: [CARBONDATA-2123] Refactor datamap schema thr...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1919#discussion_r165809109
 
    --- Diff: format/src/main/thrift/schema.thrift ---
    @@ -192,13 +192,13 @@ struct DataMapSchema  {
         1: required string dataMapName;
         // class name
         2: required string className;
    +    // to maintain properties like select query, query type like groupby, join
    +    3: optional map<string, string> properties;
         // relation indentifier
    --- End diff --
   
    modify the comment also, give more information to let reader know it is the relation identifier for the preaggregate table used by `preaggregate` datamap. Not used by `timeseries` datamap, right?


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #1919: [CARBONDATA-2123] Refactor datamap schema thr...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1919#discussion_r165809145
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/metadata/schema/datamap/DataMapProvider.java ---
    @@ -27,6 +27,40 @@
      */
     
     public enum DataMapProvider {
    -  PREAGGREGATE,
    -  TIMESERIES;
    +  PREAGGREGATE("org.apache.carbondata.core.datamap.AggregateDataMap", "preaggregate"),
    +  TIMESERIES("org.apache.carbondata.core.datamap.TimeSeriesDataMap", "timeseries");
    +
    +  /**
    +   * Fully qualified class name of datamap
    +   */
    +  private String className;
    +
    +  /**
    +   * Short name representation of datamap
    +   */
    +  private String shortName;
    +
    +  DataMapProvider(String className, String shortName) {
    +    this.className = className;
    +    this.shortName = shortName;
    +  }
    +
    +  public String getClassName() {
    +    return className;
    +  }
    +
    +  private boolean isEqual(String dataMapClass) {
    +    return (dataMapClass != null && (dataMapClass.equals(className) ||
    +        dataMapClass.equalsIgnoreCase(shortName)));
    +  }
    +
    +  public static DataMapProvider getDataMapProvider(String dataMapClass) {
    +    if (TIMESERIES.isEqual(dataMapClass)) {
    +      return TIMESERIES;
    +    } else if (PREAGGREGATE.isEqual(dataMapClass)) {
    +      return PREAGGREGATE;
    +    } else {
    +      throw new UnsupportedOperationException("Unknown data map type " + dataMapClass);
    --- End diff --
   
    change to: `datamap provider`


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #1919: [CARBONDATA-2123] Refactor datamap schema thr...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1919#discussion_r165809189
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/metadata/schema/datamap/DataMapProvider.java ---
    @@ -27,6 +27,40 @@
      */
     
     public enum DataMapProvider {
    -  PREAGGREGATE,
    -  TIMESERIES;
    +  PREAGGREGATE("org.apache.carbondata.core.datamap.AggregateDataMap", "preaggregate"),
    +  TIMESERIES("org.apache.carbondata.core.datamap.TimeSeriesDataMap", "timeseries");
    +
    +  /**
    +   * Fully qualified class name of datamap
    +   */
    +  private String className;
    +
    +  /**
    +   * Short name representation of datamap
    +   */
    +  private String shortName;
    +
    +  DataMapProvider(String className, String shortName) {
    +    this.className = className;
    +    this.shortName = shortName;
    +  }
    +
    +  public String getClassName() {
    +    return className;
    +  }
    +
    +  private boolean isEqual(String dataMapClass) {
    +    return (dataMapClass != null && (dataMapClass.equals(className) ||
    --- End diff --
   
    move `(dataMapClass.equals(className) ||` to next line to make it more readible


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #1919: [CARBONDATA-2123] Refactor datamap schema thr...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1919#discussion_r165809270
 
    --- Diff: format/src/main/thrift/schema.thrift ---
    @@ -192,13 +192,13 @@ struct DataMapSchema  {
         1: required string dataMapName;
         // class name
         2: required string className;
    +    // to maintain properties like select query, query type like groupby, join
    +    3: optional map<string, string> properties;
         // relation indentifier
    -    3: optional RelationIdentifier relationIdentifire;
    +    4: optional RelationIdentifier childTableIdentifer;
    --- End diff --
   
    ok


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #1919: [CARBONDATA-2123] Refactor datamap schema thr...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1919#discussion_r165809358
 
    --- Diff: format/src/main/thrift/schema.thrift ---
    @@ -192,13 +192,13 @@ struct DataMapSchema  {
         1: required string dataMapName;
         // class name
         2: required string className;
    +    // to maintain properties like select query, query type like groupby, join
    +    3: optional map<string, string> properties;
         // relation indentifier
    --- End diff --
   
    ok


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #1919: [CARBONDATA-2123] Refactor datamap schema thr...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1919#discussion_r165809376
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/metadata/schema/datamap/DataMapProvider.java ---
    @@ -27,6 +27,40 @@
      */
     
     public enum DataMapProvider {
    -  PREAGGREGATE,
    -  TIMESERIES;
    +  PREAGGREGATE("org.apache.carbondata.core.datamap.AggregateDataMap", "preaggregate"),
    +  TIMESERIES("org.apache.carbondata.core.datamap.TimeSeriesDataMap", "timeseries");
    +
    +  /**
    +   * Fully qualified class name of datamap
    +   */
    +  private String className;
    +
    +  /**
    +   * Short name representation of datamap
    +   */
    +  private String shortName;
    +
    +  DataMapProvider(String className, String shortName) {
    +    this.className = className;
    +    this.shortName = shortName;
    +  }
    +
    +  public String getClassName() {
    +    return className;
    +  }
    +
    +  private boolean isEqual(String dataMapClass) {
    +    return (dataMapClass != null && (dataMapClass.equals(className) ||
    +        dataMapClass.equalsIgnoreCase(shortName)));
    +  }
    +
    +  public static DataMapProvider getDataMapProvider(String dataMapClass) {
    +    if (TIMESERIES.isEqual(dataMapClass)) {
    +      return TIMESERIES;
    +    } else if (PREAGGREGATE.isEqual(dataMapClass)) {
    +      return PREAGGREGATE;
    +    } else {
    +      throw new UnsupportedOperationException("Unknown data map type " + dataMapClass);
    --- End diff --
   
    ok


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #1919: [CARBONDATA-2123] Refactor datamap schema thr...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1919#discussion_r165809386
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/metadata/schema/datamap/DataMapProvider.java ---
    @@ -27,6 +27,40 @@
      */
     
     public enum DataMapProvider {
    -  PREAGGREGATE,
    -  TIMESERIES;
    +  PREAGGREGATE("org.apache.carbondata.core.datamap.AggregateDataMap", "preaggregate"),
    +  TIMESERIES("org.apache.carbondata.core.datamap.TimeSeriesDataMap", "timeseries");
    +
    +  /**
    +   * Fully qualified class name of datamap
    +   */
    +  private String className;
    +
    +  /**
    +   * Short name representation of datamap
    +   */
    +  private String shortName;
    +
    +  DataMapProvider(String className, String shortName) {
    +    this.className = className;
    +    this.shortName = shortName;
    +  }
    +
    +  public String getClassName() {
    +    return className;
    +  }
    +
    +  private boolean isEqual(String dataMapClass) {
    +    return (dataMapClass != null && (dataMapClass.equals(className) ||
    --- End diff --
   
    ok


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #1919: [CARBONDATA-2123] Refactor datamap schema thr...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user xubo245 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1919#discussion_r165809708
 
    --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/datamap/CarbonCreateDataMapCommand.scala ---
    @@ -60,7 +61,14 @@ case class CarbonCreateDataMapCommand(
         } else {
           dmProperties
         }
    -
    +    val dataMapProvider = {
    +      try {
    +        DataMapProvider.getDataMapProvider(dmClassName)
    --- End diff --
   
    I understand user can provide className and shortName, both belong to provider name, right?


---
12