xubo245 commented on a change in pull request #3254: [CARBONDATA-3411] Fix clear datamaps logs an exception in SDK
URL:
https://github.com/apache/carbondata/pull/3254#discussion_r290274854
##########
File path: core/src/main/java/org/apache/carbondata/core/datamap/DataMapStoreManager.java
##########
@@ -511,44 +511,41 @@ public void clearDataMaps(AbsoluteTableIdentifier identifier) {
*/
public void clearDataMaps(AbsoluteTableIdentifier identifier, boolean launchJob) {
String tableUniqueName = identifier.getCarbonTableIdentifier().getTableUniqueName();
- CarbonTable carbonTable = getCarbonTable(identifier);
- if (launchJob && CarbonProperties.getInstance()
- .isDistributedPruningEnabled(identifier.getDatabaseName(), identifier.getTableName())) {
+ if (launchJob) {
+ String jobClassName;
+ if (CarbonProperties.getInstance()
+ .isDistributedPruningEnabled(identifier.getDatabaseName(), identifier.getTableName())) {
+ jobClassName = DataMapUtil.DISTRIBUTED_JOB_NAME;
+ } else {
+ jobClassName = DataMapUtil.EMBEDDED_JOB_NAME;
+ }
+ // carbon table need to lookup only if launch job is set.
+ CarbonTable carbonTable = getCarbonTable(identifier);
if (null != carbonTable) {
try {
- DataMapUtil.executeClearDataMapJob(carbonTable, DataMapUtil.DISTRIBUTED_JOB_NAME);
+ DataMapUtil.executeClearDataMapJob(carbonTable, jobClassName);
Review comment:
Only when null != carbonTable, it will use jobClassName. So can you move
`
String jobClassName;
.isDistributedPruningEnabled(identifier.getDatabaseName(), identifier.getTableName())) { if (CarbonProperties.getInstance()
.isDistributedPruningEnabled(identifier.getDatabaseName(), identifier.getTableName())) {
jobClassName = DataMapUtil.DISTRIBUTED_JOB_NAME;
} else {
jobClassName = DataMapUtil.EMBEDDED_JOB_NAME;
}
`
into null != carbonTable?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[hidden email]
With regards,
Apache Git Services