You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@carbondata.apache.org by ra...@apache.org on 2019/08/20 10:53:19 UTC

[carbondata] branch master updated: [CARBONDATA-3494]Fix NullPointerException in drop table and Correct the document formatting

This is an automated email from the ASF dual-hosted git repository.

ravipesala pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/carbondata.git


The following commit(s) were added to refs/heads/master by this push:
     new 499489c  [CARBONDATA-3494]Fix NullPointerException in drop table and Correct the document formatting
499489c is described below

commit 499489c64d0624308a734f8898a9ef23f4773224
Author: akashrn5 <ak...@gmail.com>
AuthorDate: Thu Aug 15 17:56:57 2019 +0530

    [CARBONDATA-3494]Fix NullPointerException in drop table and Correct the document formatting
    
    This closes #Problem:
    
    Fix the formatting of the document in index server md file.
    drop table is calling drop datamap command with force drop as true. Due to this table is removed from meta and physically. Then when processData is called for drop table, it tried to create carbonTable object by reading schema which causes NullPointerException.
    Solution:
    
    correct the formatting
    Skip ProcessData if carbonTable is null
    
    This closes #3359
---
 .../org/apache/carbondata/core/datamap/DataMapStoreManager.java    | 7 ++++++-
 docs/index-server.md                                               | 6 ++----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/core/src/main/java/org/apache/carbondata/core/datamap/DataMapStoreManager.java b/core/src/main/java/org/apache/carbondata/core/datamap/DataMapStoreManager.java
index ce0d6a6..f1f48fa 100644
--- a/core/src/main/java/org/apache/carbondata/core/datamap/DataMapStoreManager.java
+++ b/core/src/main/java/org/apache/carbondata/core/datamap/DataMapStoreManager.java
@@ -598,6 +598,11 @@ public final class DataMapStoreManager {
    */
   public void deleteDataMap(AbsoluteTableIdentifier identifier, String dataMapName) {
     CarbonTable carbonTable = getCarbonTable(identifier);
+    if (carbonTable == null) {
+      // If carbon table is null then it means table is already deleted, therefore return without
+      // doing any further changes.
+      return;
+    }
     String tableUniqueName = identifier.getCarbonTableIdentifier().getTableUniqueName();
     if (CarbonProperties.getInstance()
         .isDistributedPruningEnabled(identifier.getDatabaseName(), identifier.getTableName())) {
@@ -613,7 +618,7 @@ public final class DataMapStoreManager {
       if (tableIndices != null) {
         int i = 0;
         for (TableDataMap tableDataMap : tableIndices) {
-          if (carbonTable != null && tableDataMap != null && dataMapName
+          if (tableDataMap != null && dataMapName
               .equalsIgnoreCase(tableDataMap.getDataMapSchema().getDataMapName())) {
             try {
               DataMapUtil
diff --git a/docs/index-server.md b/docs/index-server.md
index 5dd15c5..9253f2a 100644
--- a/docs/index-server.md
+++ b/docs/index-server.md
@@ -136,11 +136,9 @@ The Index Server is a long running service therefore the 'spark.yarn.keytab' and
 | Name     |      Default Value    |  Description |
 |:----------:|:-------------:|:------:       |
 | carbon.enable.index.server       |  false | Enable the use of index server for pruning for the whole application.       |
-| carbon.index.server.ip |    NA   |   Specify the IP/HOST on which the server is started. Better to
- specify the private IP. |
+| carbon.index.server.ip |    NA   |   Specify the IP/HOST on which the server is started. Better to specify the private IP. |
 | carbon.index.server.port | NA | The port on which the index server is started. |
-| carbon.disable.index.server.fallback | false | Whether to enable/disable fallback for index server
-. Should be used for testing purposes only. Refer: [Fallback](#Fallback)|
+| carbon.disable.index.server.fallback | false | Whether to enable/disable fallback for index server. Should be used for testing purposes only. Refer: [Fallback](#Fallback)|
 |carbon.index.server.max.jobname.length|NA|The max length of the job to show in the index server service UI. For bigger queries this may impact performance as the whole string would be sent from JDBCServer to IndexServer.|