Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CARBONDATA-2347][LUCENE]change datamap factory interface to check supported features #2202

Closed
wants to merge 1 commit into from

Conversation

akashrn5
Copy link
Contributor

@akashrn5 akashrn5 commented Apr 21, 2018

Added new method to interface which will decide where the table operation present in list of table operations is allowed on the datamap or not.

Be sure to do all of the following checklist to help us incorporate
your contribution quickly and easily:

  • Any interfaces changed?
    yes

  • Any backward compatibility impacted?
    NA

  • Document update required?
    NA

  • Testing done
    UT tests are run
    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.
    NA

@CarbonDataQA
Copy link

Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4098/

@CarbonDataQA
Copy link

Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5277/


package org.apache.carbondata.core.features;

public enum FeaturesList {
Copy link
Contributor

@jackylk jackylk Apr 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to TableOperation

* @param feature
* @return
*/
public static boolean validateFeatureForDatamap(CarbonTable carbonTable, FeaturesList feature) {
Copy link
Contributor

@jackylk jackylk Apr 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this function and rename to CarbonTable.canAllow, it should return true if the input operation is allowed. If this operation will make the datamap becomes stale, then it is not allowed. Please modify the comment accordingly.

In future, we can change the behavior without changing this API. (After we can incremental refresh the index datamap, carbon table can allow the operation even if it will make the datamap stale)

List<TableDataMap> datamaps = DataMapStoreManager.getInstance().getAllDataMap(carbonTable);
if (!datamaps.isEmpty()) {
for (TableDataMap dataMap : datamaps) {
DataMapFactory factoryClass = DataMapStoreManager.getInstance()
Copy link
Contributor

@jackylk jackylk Apr 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are adding more functionality to the DataMapFactory, it is no long a Factory only. So I suggest to change DataMapFactory class name to IndexDataMap

for (TableDataMap dataMap : datamaps) {
DataMapFactory factoryClass = DataMapStoreManager.getInstance()
.getDataMapFactoryClass(dataMap.getDataMapSchema());
isSupported = factoryClass.dataMapFeatureScope(feature);
Copy link
Contributor

@jackylk jackylk Apr 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename dataMapFeatureScope to willBecomeStale. This function should return true is the input operation enum will make the datamap become stale. Please add this comment to that function

@@ -77,6 +78,11 @@ private[sql] case class CarbonAlterTableRenameCommand(
var oldCarbonTable: CarbonTable = null
oldCarbonTable = metastore.lookupRelation(Some(oldDatabaseName), oldTableName)(sparkSession)
.asInstanceOf[CarbonRelation].carbonTable

if (CarbonUtil.validateFeatureForDatamap(oldCarbonTable, FeaturesList.ALTER_RENAME)) {
Copy link
Contributor

@jackylk jackylk Apr 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After you handle previous comments, I think this line will become:
if (!oldCarbonTable.canAllow(TableOperation.ALTER_RENAME))

@akashrn5 akashrn5 force-pushed the block_features_lucene branch 2 times, most recently from 59a799e to d45cdd1 Compare April 23, 2018 06:37
@akashrn5 akashrn5 changed the title [wip]change datamap factory interface to check supported features [CARBONDATA-2347][LUCENE]change datamap factory interface to check supported features Apr 23, 2018
@CarbonDataQA
Copy link

Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5321/

@akashrn5 akashrn5 force-pushed the block_features_lucene branch 4 times, most recently from c7ea04a to e839ad5 Compare April 23, 2018 09:00
@CarbonDataQA
Copy link

Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4146/

@CarbonDataQA
Copy link

Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4152/

@ravipesala
Copy link
Contributor

SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4476/

@CarbonDataQA
Copy link

Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5331/

@akashrn5
Copy link
Contributor Author

retest this please

@akashrn5
Copy link
Contributor Author

retest sdv please

@CarbonDataQA
Copy link

Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4165/

@ravipesala
Copy link
Contributor

SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4483/

@CarbonDataQA
Copy link

Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4177/

@ravipesala
Copy link
Contributor

SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4492/

@ravipesala
Copy link
Contributor

SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4498/

@akashrn5
Copy link
Contributor Author

retest this please

@CarbonDataQA
Copy link

Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4193/

@akashrn5 akashrn5 force-pushed the block_features_lucene branch 2 times, most recently from efc84c8 to f5b1cc8 Compare April 26, 2018 14:43
@ravipesala
Copy link
Contributor

SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4559/

@CarbonDataQA
Copy link

Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4267/

@CarbonDataQA
Copy link

Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5434/

@CarbonDataQA
Copy link

Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4273/

@akashrn5
Copy link
Contributor Author

retest this please

@CarbonDataQA
Copy link

Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4287/

@CarbonDataQA
Copy link

Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5452/

@ravipesala
Copy link
Contributor

SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4574/

@akashrn5 akashrn5 force-pushed the block_features_lucene branch 3 times, most recently from 67ceb98 to 3924eb3 Compare April 27, 2018 14:48
@ravipesala
Copy link
Contributor

SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4578/

@CarbonDataQA
Copy link

Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4311/

@CarbonDataQA
Copy link

Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5478/

@CarbonDataQA
Copy link

Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4315/

@CarbonDataQA
Copy link

Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5482/

@CarbonDataQA
Copy link

Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5505/

@CarbonDataQA
Copy link

Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4340/

@ravipesala
Copy link
Contributor

SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4608/

@CarbonDataQA
Copy link

Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5523/

@CarbonDataQA
Copy link

Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4359/

@ravipesala
Copy link
Contributor

SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4627/

@jackylk
Copy link
Contributor

jackylk commented May 1, 2018

LGTM

@asfgit asfgit closed this in 5229443 May 1, 2018
anubhav100 pushed a commit to anubhav100/incubator-carbondata that referenced this pull request Jun 22, 2018
…pported features

Added new method to interface which will decide where the table operation present in list of table operations is allowed on the datamap or not.

This closes apache#2202
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants