You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2021/06/09 16:01:03 UTC

[GitHub] [dolphinscheduler] kyoty opened a new pull request #5611: Some new tables and fields are missing in the sql upgrade script

kyoty opened a new pull request #5611:
URL: https://github.com/apache/dolphinscheduler/pull/5611


   ## Purpose of the pull request
   The PRs associated with [issue-4417](https://github.com/apache/dolphinscheduler/issues/4417)  introduced a large number of database schema changes, but these new features were not represented in the corresponding SQL files in the Dev branch, resulting in some runtime exceptions  in the dev code environment,  such as following:
   ```java
   rg.springframework.jdbc.BadSqlGrammarException: 
   ### Error querying database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'task_code' in 'field list'
   ### The error may exist in file [E:\workspaces\dolphinscheduler\dolphinscheduler-dao\target\classes\org\apache\dolphinscheduler\dao\mapper\TaskInstanceMapper.xml]
   ### The error may involve defaultParameterMap
   ### The error occurred while setting parameters
   ### SQL: select                   id, name, task_type, process_instance_id, task_code, task_definition_version, state, submit_time,         start_time, end_time, host, execute_path, log_path, alert_flag, retry_times, pid, app_link,         flag, retry_interval, max_retry_times, task_instance_priority, worker_group, executor_id,         first_submit_time, delay_time, task_params, var_pool               from t_ds_task_instance         where 1 = 1                                 and state in              (                   ?              ,                  ?              ,                  ?              ,                  ?              ,                  ?              )
   ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'task_code' in 'field list'
   ; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'task_code' in 'field list'
   	at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:239) ~[spring-jdbc-5.1.19.RELEASE.jar:5.1.19.RELEASE]
   	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) ~[spring-jdbc-5.1.19.RELEASE.jar:5.1.19.RELEASE]
   	at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:74) ~[mybatis-spring-2.0.2.jar:2.0.2]
   	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:440) ~[mybatis-spring-2.0.2.jar:2.0.2]
   	at com.sun.proxy.$Proxy43.selectList(Unknown Source) ~[na:na]
   	at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:223) ~[mybatis-spring-2.0.2.jar:2.0.2]
   	at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:158) ~[mybatis-plus-core-3.2.0.jar:3.2.0]
   	at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:76) ~[mybatis-plus-core-3.2.0.jar:3.2.0]
   	at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:61) ~[mybatis-plus-core-3.2.0.jar:3.2.0]
   	at com.sun.proxy.$Proxy50.queryByHostAndStatus(Unknown Source) ~[na:na]
   	at org.apache.dolphinscheduler.service.process.ProcessService.queryNeedFailoverTaskInstances(ProcessService.java:1729) ~[classes/:na]
   	at org.apache.dolphinscheduler.service.process.ProcessService$$FastClassBySpringCGLIB$$ed138739.invoke(<generated>) ~[classes/:na]
   	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.1.19.RELEASE.jar:5.1.19.RELEASE]
   	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:687) ~[spring-aop-5.1.19.RELEASE.jar:5.1.19.RELEASE]
   	at org.apache.dolphinscheduler.service.process.ProcessService$$EnhancerBySpringCGLIB$$7b366cc2.queryNeedFailoverTaskInstances(<generated>) ~[classes/:na]
   	at org.apache.dolphinscheduler.server.master.zk.ZKMasterClient.failoverWorker(ZKMasterClient.java:311) ~[classes/:na]
   	at org.apache.dolphinscheduler.server.master.zk.ZKMasterClient.failoverServerWhenDown(ZKMasterClient.java:187) ~[classes/:na]
   	at org.apache.dolphinscheduler.server.master.zk.ZKMasterClient.removeZKNodePath(ZKMasterClient.java:165) ~[classes/:na]
   	at org.apache.dolphinscheduler.server.master.zk.ZKMasterClient.start(ZKMasterClient.java:99) ~[classes/:na]
   	at org.apache.dolphinscheduler.server.master.MasterServer.run(MasterServer.java:122) ~[classes/:na]
   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
   	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
   	at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
   	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:363) ~[spring-beans-5.1.19.RELEASE.jar:5.1.19.RELEASE]
   	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:307) ~[spring-beans-5.1.19.RELEASE.jar:5.1.19.RELEASE]
   	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:136) ~[spring-beans-5.1.19.RELEASE.jar:5.1.19.RELEASE]
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:413) ~[spring-beans-5.1.19.RELEASE.jar:5.1.19.RELEASE]
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1761) ~[spring-beans-5.1.19.RELEASE.jar:5.1.19.RELEASE]
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592) ~[spring-beans-5.1.19.RELEASE.jar:5.1.19.RELEASE]
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:514) ~[spring-beans-5.1.19.RELEASE.jar:5.1.19.RELEASE]
   	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:321) ~[spring-beans-5.1.19.RELEASE.jar:5.1.19.RELEASE]
   	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.1.19.RELEASE.jar:5.1.19.RELEASE]
   	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:319) ~[spring-beans-5.1.19.RELEASE.jar:5.1.19.RELEASE]
   	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.19.RELEASE.jar:5.1.19.RELEASE]
   	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:866) ~[spring-beans-5.1.19.RELEASE.jar:5.1.19.RELEASE]
   	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878) ~[spring-context-5.1.19.RELEASE.jar:5.1.19.RELEASE]
   	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.1.19.RELEASE.jar:5.1.19.RELEASE]
   	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744) ~[spring-boot-2.1.18.RELEASE.jar:2.1.18.RELEASE]
   	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391) ~[spring-boot-2.1.18.RELEASE.jar:2.1.18.RELEASE]
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) ~[spring-boot-2.1.18.RELEASE.jar:2.1.18.RELEASE]
   	at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:140) ~[spring-boot-2.1.18.RELEASE.jar:2.1.18.RELEASE]
   	at org.apache.dolphinscheduler.server.master.MasterServer.main(MasterServer.java:104) ~[classes/:na]
   Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'task_code' in 'field list'
   	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:na]
   	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:na]
   	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:na]
   	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[na:na]
   	at com.mysql.jdbc.Util.handleNewInstance(Util.java:377) ~[mysql-connector-java-5.1.34.jar:5.1.34]
   	at com.mysql.jdbc.Util.getInstance(Util.java:360) ~[mysql-connector-java-5.1.34.jar:5.1.34]
   	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:978) ~[mysql-connector-java-5.1.34.jar:5.1.34]
   	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887) ~[mysql-connector-java-5.1.34.jar:5.1.34]
   	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3823) ~[mysql-connector-java-5.1.34.jar:5.1.34]
   	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2435) ~[mysql-connector-java-5.1.34.jar:5.1.34]
   	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2582) ~[mysql-connector-java-5.1.34.jar:5.1.34]
   	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2530) ~[mysql-connector-java-5.1.34.jar:5.1.34]
   	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1907) ~[mysql-connector-java-5.1.34.jar:5.1.34]
   	at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1199) ~[mysql-connector-java-5.1.34.jar:5.1.34]
   	at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:497) ~[druid-1.1.22.jar:1.1.22]
   	at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64) ~[mybatis-3.5.2.jar:3.5.2]
   	at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79) ~[mybatis-3.5.2.jar:3.5.2]
   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
   	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
   	at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
   	at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63) ~[mybatis-3.5.2.jar:3.5.2]
   	at com.sun.proxy.$Proxy72.query(Unknown Source) ~[na:na]
   	at com.baomidou.mybatisplus.core.executor.MybatisSimpleExecutor.doQuery(MybatisSimpleExecutor.java:67) ~[mybatis-plus-core-3.2.0.jar:3.2.0]
   	at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324) ~[mybatis-3.5.2.jar:3.5.2]
   	at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) ~[mybatis-3.5.2.jar:3.5.2]
   	at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:136) ~[mybatis-3.5.2.jar:3.5.2]
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) ~[mybatis-3.5.2.jar:3.5.2]
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) ~[mybatis-3.5.2.jar:3.5.2]
   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
   	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
   	at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
   	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426) ~[mybatis-spring-2.0.2.jar:2.0.2]
   	... 39 common frames omitted
   
   ```
   
   ## Brief change log
   
   According to the `sql\dolphinscheduler_mysql.sql` and `sql\dolphinscheduler_postgre.sql`,  I tried to add the newly added tables and fields in the upgrade script.
   
   ## Verify this pull request
   1.  existing UTS
   2.  munual test works well, coverd mysql and postgresql
   
   **what's more , The database schema changes very frequently, and I think the related unit tests may not cover all aspects. When I have time, may be  I can explore whether there is a better way to detect the SQL problem, is anyone has good ideas ?**
   


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



[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #5611: [Fix-5540][JSON Split] Fix some new tables and fields are missing in the sql upgrade script

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on pull request #5611:
URL: https://github.com/apache/dolphinscheduler/pull/5611#issuecomment-858346364


   Kudos, SonarCloud Quality Gate passed!
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=BUG)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=VULNERABILITY)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=SECURITY_HOTSPOT) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=SECURITY_HOTSPOT)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=CODE_SMELL)
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo.png' alt='No Coverage information' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=5611&metric=coverage&view=list) No Coverage information  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/NoDuplicationInfo.png' alt='No Duplication information' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=5611&metric=duplicated_lines_density&view=list) No Duplication information
   
   


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



[GitHub] [dolphinscheduler] JinyLeeChina commented on pull request #5611: [Fix-5540][JSON Split] Fix some new tables and fields are missing in the sql upgrade script

Posted by GitBox <gi...@apache.org>.
JinyLeeChina commented on pull request #5611:
URL: https://github.com/apache/dolphinscheduler/pull/5611#issuecomment-859214895


   +1


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



[GitHub] [dolphinscheduler] kyoty commented on a change in pull request #5611: [Fix-5540][JSON Split] Fix some new tables and fields are missing in the sql upgrade script

Posted by GitBox <gi...@apache.org>.
kyoty commented on a change in pull request #5611:
URL: https://github.com/apache/dolphinscheduler/pull/5611#discussion_r648904526



##########
File path: sql/upgrade/1.4.0_schema/mysql/dolphinscheduler_ddl.sql
##########
@@ -168,6 +268,199 @@ delimiter ;
 CALL ct_dolphin_T_t_ds_process_definition_version;
 DROP PROCEDURE ct_dolphin_T_t_ds_process_definition_version;
 
+-- uc_dolphin_T_t_ds_project_instance_A_add_code
+drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_project_instance_A_add_code;
+delimiter d//
+CREATE PROCEDURE uc_dolphin_T_t_ds_project_instance_A_add_code()
+   BEGIN
+       IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS
+           WHERE TABLE_NAME='t_ds_project'
+           AND TABLE_SCHEMA=(SELECT DATABASE())
+           AND COLUMN_NAME ='code')
+   THEN
+         ALTER TABLE t_ds_project ADD `code` bigint(20) NOT NULL COMMENT 'encoding';
+       END IF;
+ END;
+
+d//
+
+delimiter ;
+CALL uc_dolphin_T_t_ds_project_instance_A_add_code();
+DROP PROCEDURE uc_dolphin_T_t_ds_project_instance_A_add_code;
+
+-- uc_dolphin_T_t_ds_process_definition_A_add_code
+drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_process_definition_A_add_code;
+delimiter d//
+CREATE PROCEDURE uc_dolphin_T_t_ds_process_definition_A_add_code()
+   BEGIN
+       IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS
+           WHERE TABLE_NAME='t_ds_process_definition'
+           AND TABLE_SCHEMA=(SELECT DATABASE())
+           AND COLUMN_NAME ='code')
+   THEN
+         ALTER TABLE t_ds_process_definition ADD `code` bigint(20) NOT NULL COMMENT 'encoding';
+       END IF;
+ END;

Review comment:
        @JinyLeeChina https://github.com/apache/dolphinscheduler/blob/0d303a804da0bd663162b2616ed01e8c8d731c6f/sql/upgrade/1.4.0_schema/mysql/dolphinscheduler_ddl.sql#L208  warning_group_id has been added 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:
users@infra.apache.org



[GitHub] [dolphinscheduler] kyoty commented on a change in pull request #5611: [Fix-5540][JSON Split] Fix some new tables and fields are missing in the sql upgrade script

Posted by GitBox <gi...@apache.org>.
kyoty commented on a change in pull request #5611:
URL: https://github.com/apache/dolphinscheduler/pull/5611#discussion_r651456981



##########
File path: sql/dolphinscheduler_postgre.sql
##########
@@ -303,7 +303,7 @@ CREATE TABLE t_ds_process_definition (
   tenant_id int DEFAULT '-1' ,
   create_time timestamp DEFAULT NULL ,
   update_time timestamp DEFAULT NULL ,
-  PRIMARY KEY (id) ,
+  PRIMARY KEY (id, code) ,

Review comment:
       Thanks @wen-hemin 
   you mean **the primary key should be `id` instead of `(`id`,`code`)`?**
   If so, the schema defined early by other developers in  `dolphinscheduler_mysql.sql`(https://github.com/apache/dolphinscheduler/blob/5d3b75a0a32da02ad562386a8253727ab0dc6b75/sql/dolphinscheduler_mysql.sql#L411) is wrong. Can you confirm this? I'm not familiar with the relevant background
   




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



[GitHub] [dolphinscheduler] kyoty commented on a change in pull request #5611: [Fix-5540][JSON Split] Fix some new tables and fields are missing in the sql upgrade script

Posted by GitBox <gi...@apache.org>.
kyoty commented on a change in pull request #5611:
URL: https://github.com/apache/dolphinscheduler/pull/5611#discussion_r651485800



##########
File path: sql/dolphinscheduler_postgre.sql
##########
@@ -303,7 +303,7 @@ CREATE TABLE t_ds_process_definition (
   tenant_id int DEFAULT '-1' ,
   create_time timestamp DEFAULT NULL ,
   update_time timestamp DEFAULT NULL ,
-  PRIMARY KEY (id) ,
+  PRIMARY KEY (id, code) ,

Review comment:
       Thanks @wen-hemin , I have resubmitted it, please review again.




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



[GitHub] [dolphinscheduler] kyoty commented on a change in pull request #5611: [Fix-5540][JSON Split] Fix some new tables and fields are missing in the sql upgrade script

Posted by GitBox <gi...@apache.org>.
kyoty commented on a change in pull request #5611:
URL: https://github.com/apache/dolphinscheduler/pull/5611#discussion_r649717624



##########
File path: sql/dolphinscheduler_postgre.sql
##########
@@ -303,7 +303,7 @@ CREATE TABLE t_ds_process_definition (
   tenant_id int DEFAULT '-1' ,
   create_time timestamp DEFAULT NULL ,
   update_time timestamp DEFAULT NULL ,
-  PRIMARY KEY (id) ,
+  PRIMARY KEY (id, code) ,

Review comment:
       @wen-hemin  thanks! done this:
   mysql:
   
   ![image](https://user-images.githubusercontent.com/52202080/121639637-6c54e780-cabf-11eb-8af8-2abf611e40d7.png)
   postgresql:
   
   ![image](https://user-images.githubusercontent.com/52202080/121639704-842c6b80-cabf-11eb-94c0-69f93b85c1bc.png)
   




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



[GitHub] [dolphinscheduler] wen-hemin commented on a change in pull request #5611: [Fix-5540][JSON Split] Fix some new tables and fields are missing in the sql upgrade script

Posted by GitBox <gi...@apache.org>.
wen-hemin commented on a change in pull request #5611:
URL: https://github.com/apache/dolphinscheduler/pull/5611#discussion_r651460861



##########
File path: sql/dolphinscheduler_postgre.sql
##########
@@ -303,7 +303,7 @@ CREATE TABLE t_ds_process_definition (
   tenant_id int DEFAULT '-1' ,
   create_time timestamp DEFAULT NULL ,
   update_time timestamp DEFAULT NULL ,
-  PRIMARY KEY (id) ,
+  PRIMARY KEY (id, code) ,

Review comment:
       Yes, no problem. "code" adds a unique index.




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



[GitHub] [dolphinscheduler] sonarcloud[bot] removed a comment on pull request #5611: [Fix-5540][JSON Split] Fix some new tables and fields are missing in the sql upgrade script

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] removed a comment on pull request #5611:
URL: https://github.com/apache/dolphinscheduler/pull/5611#issuecomment-858346364


   Kudos, SonarCloud Quality Gate passed!
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=BUG)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=VULNERABILITY)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=SECURITY_HOTSPOT) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=SECURITY_HOTSPOT)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=CODE_SMELL)
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo.png' alt='No Coverage information' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=5611&metric=coverage&view=list) No Coverage information  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/NoDuplicationInfo.png' alt='No Duplication information' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=5611&metric=duplicated_lines_density&view=list) No Duplication information
   
   


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



[GitHub] [dolphinscheduler] codecov-commenter commented on pull request #5611: [Fix-5540][JSON Split] Fix some new tables and fields are missing in the sql upgrade script

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #5611:
URL: https://github.com/apache/dolphinscheduler/pull/5611#issuecomment-858343709


   # [Codecov](https://codecov.io/gh/apache/dolphinscheduler/pull/5611?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#5611](https://codecov.io/gh/apache/dolphinscheduler/pull/5611?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a02128c) into [dev](https://codecov.io/gh/apache/dolphinscheduler/commit/e2243d63bee789b96d8ceeb302261564c5a28ce7?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e2243d6) will **decrease** coverage by `0.00%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/dolphinscheduler/pull/5611/graphs/tree.svg?width=650&height=150&src=pr&token=bv9iXXRLi9&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/dolphinscheduler/pull/5611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##                dev    #5611      +/-   ##
   ============================================
   - Coverage     45.16%   45.15%   -0.01%     
   + Complexity     3657     3656       -1     
   ============================================
     Files           607      607              
     Lines         24758    24758              
     Branches       2798     2798              
   ============================================
   - Hits          11181    11180       -1     
     Misses        12510    12510              
   - Partials       1067     1068       +1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dolphinscheduler/pull/5611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...dolphinscheduler/remote/future/ResponseFuture.java](https://codecov.io/gh/apache/dolphinscheduler/pull/5611/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1yZW1vdGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvcmVtb3RlL2Z1dHVyZS9SZXNwb25zZUZ1dHVyZS5qYXZh) | `81.35% <0.00%> (-1.70%)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dolphinscheduler/pull/5611?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/dolphinscheduler/pull/5611?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [e2243d6...a02128c](https://codecov.io/gh/apache/dolphinscheduler/pull/5611?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


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



[GitHub] [dolphinscheduler] wen-hemin commented on a change in pull request #5611: [Fix-5540][JSON Split] Fix some new tables and fields are missing in the sql upgrade script

Posted by GitBox <gi...@apache.org>.
wen-hemin commented on a change in pull request #5611:
URL: https://github.com/apache/dolphinscheduler/pull/5611#discussion_r649704710



##########
File path: sql/dolphinscheduler_postgre.sql
##########
@@ -303,7 +303,7 @@ CREATE TABLE t_ds_process_definition (
   tenant_id int DEFAULT '-1' ,
   create_time timestamp DEFAULT NULL ,
   update_time timestamp DEFAULT NULL ,
-  PRIMARY KEY (id) ,
+  PRIMARY KEY (id, code) ,

Review comment:
       Primary key remove "code".
   Add a unique index to "code".




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



[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #5611: [Fix-5540][JSON Split] Fix some new tables and fields are missing in the sql upgrade script

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on pull request #5611:
URL: https://github.com/apache/dolphinscheduler/pull/5611#issuecomment-861221237


   Kudos, SonarCloud Quality Gate passed!
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=BUG)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=VULNERABILITY)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=SECURITY_HOTSPOT) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=SECURITY_HOTSPOT)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=CODE_SMELL)
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo.png' alt='No Coverage information' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=5611&metric=coverage&view=list) No Coverage information  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/NoDuplicationInfo.png' alt='No Duplication information' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=5611&metric=duplicated_lines_density&view=list) No Duplication information
   
   


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



[GitHub] [dolphinscheduler] JinyLeeChina commented on a change in pull request #5611: [Fix-5540][JSON Split] Fix some new tables and fields are missing in the sql upgrade script

Posted by GitBox <gi...@apache.org>.
JinyLeeChina commented on a change in pull request #5611:
URL: https://github.com/apache/dolphinscheduler/pull/5611#discussion_r648890701



##########
File path: sql/upgrade/1.4.0_schema/mysql/dolphinscheduler_ddl.sql
##########
@@ -168,6 +268,199 @@ delimiter ;
 CALL ct_dolphin_T_t_ds_process_definition_version;
 DROP PROCEDURE ct_dolphin_T_t_ds_process_definition_version;
 
+-- uc_dolphin_T_t_ds_project_instance_A_add_code
+drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_project_instance_A_add_code;
+delimiter d//
+CREATE PROCEDURE uc_dolphin_T_t_ds_project_instance_A_add_code()
+   BEGIN
+       IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS
+           WHERE TABLE_NAME='t_ds_project'
+           AND TABLE_SCHEMA=(SELECT DATABASE())
+           AND COLUMN_NAME ='code')
+   THEN
+         ALTER TABLE t_ds_project ADD `code` bigint(20) NOT NULL COMMENT 'encoding';
+       END IF;
+ END;
+
+d//
+
+delimiter ;
+CALL uc_dolphin_T_t_ds_project_instance_A_add_code();
+DROP PROCEDURE uc_dolphin_T_t_ds_project_instance_A_add_code;
+
+-- uc_dolphin_T_t_ds_process_definition_A_add_code
+drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_process_definition_A_add_code;
+delimiter d//
+CREATE PROCEDURE uc_dolphin_T_t_ds_process_definition_A_add_code()
+   BEGIN
+       IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS
+           WHERE TABLE_NAME='t_ds_process_definition'
+           AND TABLE_SCHEMA=(SELECT DATABASE())
+           AND COLUMN_NAME ='code')
+   THEN
+         ALTER TABLE t_ds_process_definition ADD `code` bigint(20) NOT NULL COMMENT 'encoding';
+       END IF;
+ END;
+
+d//
+
+delimiter ;
+CALL uc_dolphin_T_t_ds_process_definition_A_add_code();
+DROP PROCEDURE uc_dolphin_T_t_ds_process_definition_A_add_code;
+
+-- uc_dolphin_T_t_ds_process_definition_A_add_project_code
+drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_process_definition_A_add_project_code;

Review comment:
       I think there should be remove project_id from t_ds_process_definition

##########
File path: sql/upgrade/1.4.0_schema/mysql/dolphinscheduler_ddl.sql
##########
@@ -168,6 +268,199 @@ delimiter ;
 CALL ct_dolphin_T_t_ds_process_definition_version;
 DROP PROCEDURE ct_dolphin_T_t_ds_process_definition_version;
 
+-- uc_dolphin_T_t_ds_project_instance_A_add_code
+drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_project_instance_A_add_code;
+delimiter d//
+CREATE PROCEDURE uc_dolphin_T_t_ds_project_instance_A_add_code()
+   BEGIN
+       IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS
+           WHERE TABLE_NAME='t_ds_project'
+           AND TABLE_SCHEMA=(SELECT DATABASE())
+           AND COLUMN_NAME ='code')
+   THEN
+         ALTER TABLE t_ds_project ADD `code` bigint(20) NOT NULL COMMENT 'encoding';
+       END IF;
+ END;
+
+d//
+
+delimiter ;
+CALL uc_dolphin_T_t_ds_project_instance_A_add_code();
+DROP PROCEDURE uc_dolphin_T_t_ds_project_instance_A_add_code;
+
+-- uc_dolphin_T_t_ds_process_definition_A_add_code
+drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_process_definition_A_add_code;
+delimiter d//
+CREATE PROCEDURE uc_dolphin_T_t_ds_process_definition_A_add_code()
+   BEGIN
+       IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS
+           WHERE TABLE_NAME='t_ds_process_definition'
+           AND TABLE_SCHEMA=(SELECT DATABASE())
+           AND COLUMN_NAME ='code')
+   THEN
+         ALTER TABLE t_ds_process_definition ADD `code` bigint(20) NOT NULL COMMENT 'encoding';
+       END IF;
+ END;

Review comment:
       Please add warning_group_id to t_ds_process_definition 

##########
File path: sql/upgrade/1.4.0_schema/mysql/dolphinscheduler_ddl.sql
##########
@@ -168,6 +268,199 @@ delimiter ;
 CALL ct_dolphin_T_t_ds_process_definition_version;
 DROP PROCEDURE ct_dolphin_T_t_ds_process_definition_version;
 
+-- uc_dolphin_T_t_ds_project_instance_A_add_code
+drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_project_instance_A_add_code;
+delimiter d//
+CREATE PROCEDURE uc_dolphin_T_t_ds_project_instance_A_add_code()
+   BEGIN
+       IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS
+           WHERE TABLE_NAME='t_ds_project'
+           AND TABLE_SCHEMA=(SELECT DATABASE())
+           AND COLUMN_NAME ='code')
+   THEN
+         ALTER TABLE t_ds_project ADD `code` bigint(20) NOT NULL COMMENT 'encoding';
+       END IF;
+ END;
+
+d//
+
+delimiter ;
+CALL uc_dolphin_T_t_ds_project_instance_A_add_code();
+DROP PROCEDURE uc_dolphin_T_t_ds_project_instance_A_add_code;
+
+-- uc_dolphin_T_t_ds_process_definition_A_add_code
+drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_process_definition_A_add_code;

Review comment:
       Please update UNIQUE KEY of t_ds_process_definition 




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



[GitHub] [dolphinscheduler] CalvinKirs commented on pull request #5611: [Fix-5540][JSON Split] Fix some new tables and fields are missing in the sql upgrade script

Posted by GitBox <gi...@apache.org>.
CalvinKirs commented on pull request #5611:
URL: https://github.com/apache/dolphinscheduler/pull/5611#issuecomment-858215572


   @JinyLeeChina please take a look.Thx


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



[GitHub] [dolphinscheduler] JinyLeeChina commented on a change in pull request #5611: [Fix-5540][JSON Split] Fix some new tables and fields are missing in the sql upgrade script

Posted by GitBox <gi...@apache.org>.
JinyLeeChina commented on a change in pull request #5611:
URL: https://github.com/apache/dolphinscheduler/pull/5611#discussion_r648923788



##########
File path: sql/upgrade/1.4.0_schema/mysql/dolphinscheduler_ddl.sql
##########
@@ -168,6 +268,199 @@ delimiter ;
 CALL ct_dolphin_T_t_ds_process_definition_version;
 DROP PROCEDURE ct_dolphin_T_t_ds_process_definition_version;
 
+-- uc_dolphin_T_t_ds_project_instance_A_add_code
+drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_project_instance_A_add_code;
+delimiter d//
+CREATE PROCEDURE uc_dolphin_T_t_ds_project_instance_A_add_code()
+   BEGIN
+       IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS
+           WHERE TABLE_NAME='t_ds_project'
+           AND TABLE_SCHEMA=(SELECT DATABASE())
+           AND COLUMN_NAME ='code')
+   THEN
+         ALTER TABLE t_ds_project ADD `code` bigint(20) NOT NULL COMMENT 'encoding';
+       END IF;
+ END;
+
+d//
+
+delimiter ;
+CALL uc_dolphin_T_t_ds_project_instance_A_add_code();
+DROP PROCEDURE uc_dolphin_T_t_ds_project_instance_A_add_code;
+
+-- uc_dolphin_T_t_ds_process_definition_A_add_code
+drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_process_definition_A_add_code;
+delimiter d//
+CREATE PROCEDURE uc_dolphin_T_t_ds_process_definition_A_add_code()
+   BEGIN
+       IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS
+           WHERE TABLE_NAME='t_ds_process_definition'
+           AND TABLE_SCHEMA=(SELECT DATABASE())
+           AND COLUMN_NAME ='code')
+   THEN
+         ALTER TABLE t_ds_process_definition ADD `code` bigint(20) NOT NULL COMMENT 'encoding';
+       END IF;
+ END;

Review comment:
       OK




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



[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #5611: [Fix-5540][JSON Split] Fix some new tables and fields are missing in the sql upgrade script

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on pull request #5611:
URL: https://github.com/apache/dolphinscheduler/pull/5611#issuecomment-859223630


   Kudos, SonarCloud Quality Gate passed!
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=BUG)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=VULNERABILITY)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=SECURITY_HOTSPOT) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=SECURITY_HOTSPOT)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=CODE_SMELL)
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo.png' alt='No Coverage information' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=5611&metric=coverage&view=list) No Coverage information  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/NoDuplicationInfo.png' alt='No Duplication information' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=5611&metric=duplicated_lines_density&view=list) No Duplication information
   
   


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



[GitHub] [dolphinscheduler] JinyLeeChina commented on pull request #5611: [Fix-5540][JSON Split] Fix some new tables and fields are missing in the sql upgrade script

Posted by GitBox <gi...@apache.org>.
JinyLeeChina commented on pull request #5611:
URL: https://github.com/apache/dolphinscheduler/pull/5611#issuecomment-858358580


   Thanks for your contribution, pls fix review comment


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



[GitHub] [dolphinscheduler] codecov-commenter edited a comment on pull request #5611: [Fix-5540][JSON Split] Fix some new tables and fields are missing in the sql upgrade script

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #5611:
URL: https://github.com/apache/dolphinscheduler/pull/5611#issuecomment-858343709


   # [Codecov](https://codecov.io/gh/apache/dolphinscheduler/pull/5611?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#5611](https://codecov.io/gh/apache/dolphinscheduler/pull/5611?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (aea2629) into [dev](https://codecov.io/gh/apache/dolphinscheduler/commit/e2243d63bee789b96d8ceeb302261564c5a28ce7?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e2243d6) will **increase** coverage by `0.19%`.
   > The diff coverage is `n/a`.
   
   > :exclamation: Current head aea2629 differs from pull request most recent head 77e3b01. Consider uploading reports for the commit 77e3b01 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/dolphinscheduler/pull/5611/graphs/tree.svg?width=650&height=150&src=pr&token=bv9iXXRLi9&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/dolphinscheduler/pull/5611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##                dev    #5611      +/-   ##
   ============================================
   + Coverage     45.16%   45.35%   +0.19%     
   - Complexity     3657     3675      +18     
   ============================================
     Files           607      607              
     Lines         24758    24780      +22     
     Branches       2798     2801       +3     
   ============================================
   + Hits          11181    11240      +59     
   + Misses        12510    12468      -42     
   - Partials       1067     1072       +5     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dolphinscheduler/pull/5611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [.../org/apache/dolphinscheduler/common/Constants.java](https://codecov.io/gh/apache/dolphinscheduler/pull/5611/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvY29tbW9uL0NvbnN0YW50cy5qYXZh) | `80.00% <0.00%> (ø)` | |
   | [...eduler/server/worker/runner/TaskExecuteThread.java](https://codecov.io/gh/apache/dolphinscheduler/pull/5611/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1zZXJ2ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvc2VydmVyL3dvcmtlci9ydW5uZXIvVGFza0V4ZWN1dGVUaHJlYWQuamF2YQ==) | `59.50% <0.00%> (ø)` | |
   | [...ler/server/master/runner/MasterTaskExecThread.java](https://codecov.io/gh/apache/dolphinscheduler/pull/5611/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1zZXJ2ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvc2VydmVyL21hc3Rlci9ydW5uZXIvTWFzdGVyVGFza0V4ZWNUaHJlYWQuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...r/api/service/impl/ProcessInstanceServiceImpl.java](https://codecov.io/gh/apache/dolphinscheduler/pull/5611/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL3NlcnZpY2UvaW1wbC9Qcm9jZXNzSW5zdGFuY2VTZXJ2aWNlSW1wbC5qYXZh) | `73.29% <0.00%> (+0.45%)` | :arrow_up: |
   | [...nscheduler/server/entity/TaskExecutionContext.java](https://codecov.io/gh/apache/dolphinscheduler/pull/5611/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1zZXJ2ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvc2VydmVyL2VudGl0eS9UYXNrRXhlY3V0aW9uQ29udGV4dC5qYXZh) | `85.84% <0.00%> (+0.88%)` | :arrow_up: |
   | [...pache/dolphinscheduler/common/utils/JSONUtils.java](https://codecov.io/gh/apache/dolphinscheduler/pull/5611/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvY29tbW9uL3V0aWxzL0pTT05VdGlscy5qYXZh) | `72.61% <0.00%> (+1.36%)` | :arrow_up: |
   | [...nscheduler/server/worker/task/datax/DataxTask.java](https://codecov.io/gh/apache/dolphinscheduler/pull/5611/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1zZXJ2ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvc2VydmVyL3dvcmtlci90YXNrL2RhdGF4L0RhdGF4VGFzay5qYXZh) | `55.31% <0.00%> (+1.98%)` | :arrow_up: |
   | [...r/plugin/registry/zookeeper/ZookeeperRegistry.java](https://codecov.io/gh/apache/dolphinscheduler/pull/5611/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1yZWdpc3RyeS1wbHVnaW4vZG9scGhpbnNjaGVkdWxlci1yZWdpc3RyeS16b29rZWVwZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvcGx1Z2luL3JlZ2lzdHJ5L3pvb2tlZXBlci9ab29rZWVwZXJSZWdpc3RyeS5qYXZh) | `44.05% <0.00%> (+5.59%)` | :arrow_up: |
   | [...aster/cache/impl/TaskInstanceCacheManagerImpl.java](https://codecov.io/gh/apache/dolphinscheduler/pull/5611/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1zZXJ2ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvc2VydmVyL21hc3Rlci9jYWNoZS9pbXBsL1Rhc2tJbnN0YW5jZUNhY2hlTWFuYWdlckltcGwuamF2YQ==) | `92.30% <0.00%> (+92.30%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dolphinscheduler/pull/5611?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/dolphinscheduler/pull/5611?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [e2243d6...77e3b01](https://codecov.io/gh/apache/dolphinscheduler/pull/5611?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


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



[GitHub] [dolphinscheduler] wen-hemin commented on a change in pull request #5611: [Fix-5540][JSON Split] Fix some new tables and fields are missing in the sql upgrade script

Posted by GitBox <gi...@apache.org>.
wen-hemin commented on a change in pull request #5611:
URL: https://github.com/apache/dolphinscheduler/pull/5611#discussion_r649101323



##########
File path: sql/dolphinscheduler_postgre.sql
##########
@@ -303,7 +303,7 @@ CREATE TABLE t_ds_process_definition (
   tenant_id int DEFAULT '-1' ,
   create_time timestamp DEFAULT NULL ,
   update_time timestamp DEFAULT NULL ,
-  PRIMARY KEY (id) ,
+  PRIMARY KEY (id, code) ,

Review comment:
       Is it more appropriate to add a unique index to "code".




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



[GitHub] [dolphinscheduler] github-actions[bot] commented on pull request #5611: [Fix-5540][JSON Split] Fix some new tables and fields are missing in the sql upgrade script

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #5611:
URL: https://github.com/apache/dolphinscheduler/pull/5611#issuecomment-858573471


   Hi:
   * Thank you for your feedback, we have received your issue, Please wait patiently for a reply.
   * In order for us to understand your request as soon as possible, please provide detailed information、version or pictures.
   * If you haven't received a reply for a long time, you can subscribe to the developer's email,Mail subscription steps reference https://dolphinscheduler.apache.org/zh-cn/community/development/subscribe.html ,Then write the issue URL in the email content and send question to dev@dolphinscheduler.apache.org.


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



[GitHub] [dolphinscheduler] kyoty commented on a change in pull request #5611: [Fix-5540][JSON Split] Fix some new tables and fields are missing in the sql upgrade script

Posted by GitBox <gi...@apache.org>.
kyoty commented on a change in pull request #5611:
URL: https://github.com/apache/dolphinscheduler/pull/5611#discussion_r649113722



##########
File path: sql/dolphinscheduler_postgre.sql
##########
@@ -303,7 +303,7 @@ CREATE TABLE t_ds_process_definition (
   tenant_id int DEFAULT '-1' ,
   create_time timestamp DEFAULT NULL ,
   update_time timestamp DEFAULT NULL ,
-  PRIMARY KEY (id) ,
+  PRIMARY KEY (id, code) ,

Review comment:
       Thanks for your review.
   I made this change by folllowing the same table schema in mysql:https://github.com/apache/dolphinscheduler/blob/5d3b75a0a32da02ad562386a8253727ab0dc6b75/sql/dolphinscheduler_mysql.sql#L411 .  I've also update the sql upgrade script.
   I'm not sure what's the best way to make the scheme's upgrade 😭 




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



[GitHub] [dolphinscheduler] wen-hemin commented on a change in pull request #5611: [Fix-5540][JSON Split] Fix some new tables and fields are missing in the sql upgrade script

Posted by GitBox <gi...@apache.org>.
wen-hemin commented on a change in pull request #5611:
URL: https://github.com/apache/dolphinscheduler/pull/5611#discussion_r649793831



##########
File path: sql/dolphinscheduler_postgre.sql
##########
@@ -303,7 +303,7 @@ CREATE TABLE t_ds_process_definition (
   tenant_id int DEFAULT '-1' ,
   create_time timestamp DEFAULT NULL ,
   update_time timestamp DEFAULT NULL ,
-  PRIMARY KEY (id) ,
+  PRIMARY KEY (id, code) ,

Review comment:
       It's the same as it is now.
   1.The primary key only keeps the ID.
   2.Add a unique index to "code", the purpose is to improve the query efficiency, and the uniqueness of the constraint "code"
   @kyoty 




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



[GitHub] [dolphinscheduler] wen-hemin commented on a change in pull request #5611: [Fix-5540][JSON Split] Fix some new tables and fields are missing in the sql upgrade script

Posted by GitBox <gi...@apache.org>.
wen-hemin commented on a change in pull request #5611:
URL: https://github.com/apache/dolphinscheduler/pull/5611#discussion_r651460861



##########
File path: sql/dolphinscheduler_postgre.sql
##########
@@ -303,7 +303,7 @@ CREATE TABLE t_ds_process_definition (
   tenant_id int DEFAULT '-1' ,
   create_time timestamp DEFAULT NULL ,
   update_time timestamp DEFAULT NULL ,
-  PRIMARY KEY (id) ,
+  PRIMARY KEY (id, code) ,

Review comment:
       Yes, no problem. Code adds a unique index.




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



[GitHub] [dolphinscheduler] kyoty commented on a change in pull request #5611: [Fix-5540][JSON Split] Fix some new tables and fields are missing in the sql upgrade script

Posted by GitBox <gi...@apache.org>.
kyoty commented on a change in pull request #5611:
URL: https://github.com/apache/dolphinscheduler/pull/5611#discussion_r649114170



##########
File path: sql/upgrade/1.4.0_schema/mysql/dolphinscheduler_ddl.sql
##########
@@ -168,6 +268,199 @@ delimiter ;
 CALL ct_dolphin_T_t_ds_process_definition_version;
 DROP PROCEDURE ct_dolphin_T_t_ds_process_definition_version;
 
+-- uc_dolphin_T_t_ds_project_instance_A_add_code
+drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_project_instance_A_add_code;
+delimiter d//
+CREATE PROCEDURE uc_dolphin_T_t_ds_project_instance_A_add_code()
+   BEGIN
+       IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS
+           WHERE TABLE_NAME='t_ds_project'
+           AND TABLE_SCHEMA=(SELECT DATABASE())
+           AND COLUMN_NAME ='code')
+   THEN
+         ALTER TABLE t_ds_project ADD `code` bigint(20) NOT NULL COMMENT 'encoding';
+       END IF;
+ END;
+
+d//
+
+delimiter ;
+CALL uc_dolphin_T_t_ds_project_instance_A_add_code();
+DROP PROCEDURE uc_dolphin_T_t_ds_project_instance_A_add_code;
+
+-- uc_dolphin_T_t_ds_process_definition_A_add_code
+drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_process_definition_A_add_code;
+delimiter d//
+CREATE PROCEDURE uc_dolphin_T_t_ds_process_definition_A_add_code()
+   BEGIN
+       IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS
+           WHERE TABLE_NAME='t_ds_process_definition'
+           AND TABLE_SCHEMA=(SELECT DATABASE())
+           AND COLUMN_NAME ='code')
+   THEN
+         ALTER TABLE t_ds_process_definition ADD `code` bigint(20) NOT NULL COMMENT 'encoding';
+       END IF;
+ END;
+
+d//
+
+delimiter ;
+CALL uc_dolphin_T_t_ds_process_definition_A_add_code();
+DROP PROCEDURE uc_dolphin_T_t_ds_process_definition_A_add_code;
+
+-- uc_dolphin_T_t_ds_process_definition_A_add_project_code
+drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_process_definition_A_add_project_code;

Review comment:
       Solved it!




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



[GitHub] [dolphinscheduler] wen-hemin merged pull request #5611: [Fix-5540][JSON Split] Fix some new tables and fields are missing in the sql upgrade script

Posted by GitBox <gi...@apache.org>.
wen-hemin merged pull request #5611:
URL: https://github.com/apache/dolphinscheduler/pull/5611


   


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



[GitHub] [dolphinscheduler] kyoty commented on pull request #5611: [Fix-5540][JSON Split] Fix some new tables and fields are missing in the sql upgrade script

Posted by GitBox <gi...@apache.org>.
kyoty commented on pull request #5611:
URL: https://github.com/apache/dolphinscheduler/pull/5611#issuecomment-858561097


   @JinyLeeChina @wen-hemin, thanks for your review, I have update the code, please review again, thanks!🤪


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



[GitHub] [dolphinscheduler] kyoty commented on a change in pull request #5611: [Fix-5540][JSON Split] Fix some new tables and fields are missing in the sql upgrade script

Posted by GitBox <gi...@apache.org>.
kyoty commented on a change in pull request #5611:
URL: https://github.com/apache/dolphinscheduler/pull/5611#discussion_r649115378



##########
File path: sql/upgrade/1.4.0_schema/mysql/dolphinscheduler_ddl.sql
##########
@@ -168,6 +268,199 @@ delimiter ;
 CALL ct_dolphin_T_t_ds_process_definition_version;
 DROP PROCEDURE ct_dolphin_T_t_ds_process_definition_version;
 
+-- uc_dolphin_T_t_ds_project_instance_A_add_code
+drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_project_instance_A_add_code;
+delimiter d//
+CREATE PROCEDURE uc_dolphin_T_t_ds_project_instance_A_add_code()
+   BEGIN
+       IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS
+           WHERE TABLE_NAME='t_ds_project'
+           AND TABLE_SCHEMA=(SELECT DATABASE())
+           AND COLUMN_NAME ='code')
+   THEN
+         ALTER TABLE t_ds_project ADD `code` bigint(20) NOT NULL COMMENT 'encoding';
+       END IF;
+ END;
+
+d//
+
+delimiter ;
+CALL uc_dolphin_T_t_ds_project_instance_A_add_code();
+DROP PROCEDURE uc_dolphin_T_t_ds_project_instance_A_add_code;
+
+-- uc_dolphin_T_t_ds_process_definition_A_add_code
+drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_process_definition_A_add_code;

Review comment:
       thanks @JinyLeeChina , solved it.




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



[GitHub] [dolphinscheduler] sonarcloud[bot] removed a comment on pull request #5611: [Fix-5540][JSON Split] Fix some new tables and fields are missing in the sql upgrade script

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] removed a comment on pull request #5611:
URL: https://github.com/apache/dolphinscheduler/pull/5611#issuecomment-859223630


   Kudos, SonarCloud Quality Gate passed!
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=BUG)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=VULNERABILITY)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=SECURITY_HOTSPOT) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=SECURITY_HOTSPOT)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=5611&resolved=false&types=CODE_SMELL)
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo.png' alt='No Coverage information' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=5611&metric=coverage&view=list) No Coverage information  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/NoDuplicationInfo.png' alt='No Duplication information' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=5611&metric=duplicated_lines_density&view=list) No Duplication information
   
   


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



[GitHub] [dolphinscheduler] github-actions[bot] commented on pull request #5611: [Fix-5540][JSON Split] Fix some new tables and fields are missing in the sql upgrade script

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #5611:
URL: https://github.com/apache/dolphinscheduler/pull/5611#issuecomment-859218767






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



[GitHub] [dolphinscheduler] kyoty commented on a change in pull request #5611: [Fix-5540][JSON Split] Fix some new tables and fields are missing in the sql upgrade script

Posted by GitBox <gi...@apache.org>.
kyoty commented on a change in pull request #5611:
URL: https://github.com/apache/dolphinscheduler/pull/5611#discussion_r649113722



##########
File path: sql/dolphinscheduler_postgre.sql
##########
@@ -303,7 +303,7 @@ CREATE TABLE t_ds_process_definition (
   tenant_id int DEFAULT '-1' ,
   create_time timestamp DEFAULT NULL ,
   update_time timestamp DEFAULT NULL ,
-  PRIMARY KEY (id) ,
+  PRIMARY KEY (id, code) ,

Review comment:
       Thanks for your review.
   I made this change by folllowing the same table schema in mysql:https://github.com/apache/dolphinscheduler/blob/5d3b75a0a32da02ad562386a8253727ab0dc6b75/sql/dolphinscheduler_mysql.sql#L411  I've also update the sql upgrade script.
   I'm not sure what's the best way to do? 😭 




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



[GitHub] [dolphinscheduler] kyoty commented on a change in pull request #5611: [Fix-5540][JSON Split] Fix some new tables and fields are missing in the sql upgrade script

Posted by GitBox <gi...@apache.org>.
kyoty commented on a change in pull request #5611:
URL: https://github.com/apache/dolphinscheduler/pull/5611#discussion_r649113722



##########
File path: sql/dolphinscheduler_postgre.sql
##########
@@ -303,7 +303,7 @@ CREATE TABLE t_ds_process_definition (
   tenant_id int DEFAULT '-1' ,
   create_time timestamp DEFAULT NULL ,
   update_time timestamp DEFAULT NULL ,
-  PRIMARY KEY (id) ,
+  PRIMARY KEY (id, code) ,

Review comment:
       Thanks for your review.
   I made this change by folllowing the same table schema in mysql:https://github.com/apache/dolphinscheduler/blob/5d3b75a0a32da02ad562386a8253727ab0dc6b75/sql/dolphinscheduler_mysql.sql#L411 .  I've also update the sql upgrade script.
   I'm not sure what's the best way to do? 😭 




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