You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by GitBox <gi...@apache.org> on 2020/03/02 05:43:58 UTC

[GitHub] [carbondata] akashrn5 commented on a change in pull request #3614: [CARBONDATA-3693] Separate Index command from DataMap command

akashrn5 commented on a change in pull request #3614: [CARBONDATA-3693] Separate Index command from DataMap command
URL: https://github.com/apache/carbondata/pull/3614#discussion_r386205955
 
 

 ##########
 File path: core/src/main/java/org/apache/carbondata/core/datamap/DataMapStoreManager.java
 ##########
 @@ -168,6 +186,38 @@ public DataMapSchema getDataMapSchema(String dataMapName)
     return provider.retrieveSchema(dataMapName);
   }
 
+  public List<DataMapSchema> getAllMVSchemas() throws IOException {
+    return provider.retrieveAllSchemas().stream()
+        .filter(schema -> !schema.isIndexDataMap())
+        .collect(Collectors.toList());
+  }
+
+  public DataMapSchema getIndexSchema(String indexName)
+      throws NoSuchIndexException, IOException {
+    try {
+      DataMapSchema schema = provider.retrieveSchema(indexName);
+      if (!schema.isIndexDataMap()) {
+        throw new NoSuchIndexException(indexName);
+      }
+      return schema;
+    } catch (NoSuchDataMapException e) {
+      throw new NoSuchIndexException(indexName);
+    }
+  }
+
+  public DataMapSchema getMVSchema(String mvName)
+      throws NoSuchMaterializedViewException, IOException {
+    try {
+      DataMapSchema schema = provider.retrieveSchema(mvName);
+      if (schema == null || schema.isIndexDataMap()) {
+        throw new NoSuchMaterializedViewException(mvName);
 
 Review comment:
   just log error with message and the throwable, if we directly throw may be sometimes if the cause is different it will mislead

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services