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
Conversation
Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4098/ |
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 { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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)) { |
There was a problem hiding this comment.
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))
59a799e
to
d45cdd1
Compare
Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5321/ |
c7ea04a
to
e839ad5
Compare
Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4146/ |
e839ad5
to
79c5a43
Compare
Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4152/ |
SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4476/ |
Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5331/ |
retest this please |
retest sdv please |
Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4165/ |
SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4483/ |
79c5a43
to
951f00a
Compare
Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4177/ |
SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4492/ |
SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4498/ |
retest this please |
Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4193/ |
efc84c8
to
f5b1cc8
Compare
SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4559/ |
Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4267/ |
Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5434/ |
Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4273/ |
retest this please |
Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4287/ |
Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5452/ |
SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4574/ |
67ceb98
to
3924eb3
Compare
SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4578/ |
Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4311/ |
Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5478/ |
Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4315/ |
Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5482/ |
3924eb3
to
f72d8c0
Compare
Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5505/ |
Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4340/ |
SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4608/ |
f72d8c0
to
f316ccc
Compare
Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5523/ |
Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4359/ |
SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4627/ |
LGTM |
…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
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