[GitHub] [carbondata] niuge01 commented on a change in pull request #3415: [CARBONDATA-3553] Support SDK Writer using existing schema file

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] niuge01 commented on a change in pull request #3415: [CARBONDATA-3553] Support SDK Writer using existing schema file

GitBox
niuge01 commented on a change in pull request #3415: [CARBONDATA-3553] Support SDK Writer using existing schema file
URL: https://github.com/apache/carbondata/pull/3415#discussion_r337814026
 
 

 ##########
 File path: core/src/main/java/org/apache/carbondata/core/metadata/schema/SchemaReader.java
 ##########
 @@ -58,6 +58,48 @@ public static CarbonTable readCarbonTableFromStore(AbsoluteTableIdentifier ident
     }
   }
 
+  /**
+   * Read specified schema file as CarbonTable
+   * @param schemaFilePath schema file path
+   * @param conf hadoop configuration
+   * @return CarbonTable object
+   * @throws IOException if IO error occurs
+   */
+  public static CarbonTable readCarbonTableFromSchema(String schemaFilePath, Configuration conf)
+      throws IOException {
+    TableInfo tableInfo = readTableInfoFromSchema(schemaFilePath, conf);
+    CarbonMetadata.getInstance().loadTableMetadata(tableInfo);
+    return CarbonMetadata.getInstance().getCarbonTable("dummy_dummy");
+  }
+
+  /**
+   * Read specified schema file as TableInfo
+   * @param schemaFilePath schema file path
+   * @param conf hadoop configuration
+   * @return TableInfo object
+   * @throws IOException if IO error occurs
+   */
+  public static TableInfo readTableInfoFromSchema(String schemaFilePath, Configuration conf)
 
 Review comment:
   resolved

----------------------------------------------------------------
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