[ 
https://issues.apache.org/jira/browse/KYLIN-4485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17126488#comment-17126488
 ] 

ASF GitHub Bot commented on KYLIN-4485:
---------------------------------------

zzcclp commented on a change in pull request #1218:
URL: https://github.com/apache/kylin/pull/1218#discussion_r435741400



##########
File path: 
server-base/src/main/java/org/apache/kylin/rest/service/TableService.java
##########
@@ -105,6 +117,37 @@
     @Autowired
     private AclEvaluate aclEvaluate;
 
+    public TableSchemaUpdateChecker getSchemaUpdateChecker() {
+        return new TableSchemaUpdateChecker(getTableManager(), 
getCubeManager(), getDataModelManager());
+    }
+
+    public void checkTableCompatibility(String prj, TableDesc tableDesc) {
+        TableSchemaUpdateChecker.CheckResult result = 
getSchemaUpdateChecker().allowReload(tableDesc, prj);
+        result.raiseExceptionWhenInvalid();
+    }
+
+    public void checkHiveTableCompatibility(String prj, TableDesc tableDesc) 
throws Exception {
+        Preconditions.checkNotNull(tableDesc.getDatabase());
+        Preconditions.checkNotNull(tableDesc.getName());
+
+        String database = tableDesc.getDatabase().toUpperCase(Locale.ROOT);
+        String tableName = tableDesc.getName().toUpperCase(Locale.ROOT);
+        ProjectInstance projectInstance = getProjectManager().getProject(prj);
+        ISourceMetadataExplorer explr = 
SourceManager.getSource(projectInstance).getSourceMetadataExplorer();
+
+        TableDesc hiveTableDesc;
+        try {
+            Pair<TableDesc, TableExtDesc> pair = 
explr.loadTableMetadata(database, tableName, prj);
+            hiveTableDesc = pair.getFirst();
+        } catch (Exception e) {
+            logger.error("Fail to get metadata for hive table {} due to ", 
tableDesc.getIdentity(), e);
+            throw new RuntimeException("Fail to get metadata for hive table" + 
tableDesc.getIdentity());

Review comment:
       add one blank space before '" +'




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


> Create a self service interface for cube migration
> --------------------------------------------------
>
>                 Key: KYLIN-4485
>                 URL: https://issues.apache.org/jira/browse/KYLIN-4485
>             Project: Kylin
>          Issue Type: New Feature
>          Components: Tools, Build and Test
>            Reporter: Zhong Yanghong
>            Assignee: Zhong Yanghong
>            Priority: Major
>             Fix For: v3.1.0
>
>         Attachments: cube-migration-new.png, cube-migration-old.png
>
>
> Current cube migration process is as follows:
>   !cube-migration-old.png!
> There're a few drawbacks:
>  * kylin admin has to manually check all related aspects to decide whether a 
> cube is good for migration. If cube design is not good, there'll be many 
> interaction between users & kylin admins
>  * kylin admin has to login to the backend server and then run a command to 
> do the migration, which is tricky and easy to make mistakes
>  * there's little compatibility check between source metadata & destination 
> cluster.
> A self service interface will refine the migration process as follows:
> !cube-migration-new.png!
> We can see with the new migration process, there'll be few interactions 
> between users & kylin admins and much less work for kylin admins.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to