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 2022/08/16 03:22:58 UTC

[GitHub] [dolphinscheduler] EricGao888 opened a new pull request, #11494: [Feature][Style] Configure Spotless to format SQL code in DS

EricGao888 opened a new pull request, #11494:
URL: https://github.com/apache/dolphinscheduler/pull/11494

   ## Purpose of the pull request
   
   * Configure Spotless to format SQL code in DS. 
   
   ## Brief change log
   
   * Configure Spotless to format SQL code in DS.
   * Refactor `dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql` as an example.
   * Since the number of SQL scripts in DS is not that big, if it looks good, I will fix the format of legacy sql scripts.
   
   ## Verify this pull request
   
   * Verified by manual tests.


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

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] EricGao888 commented on a diff in pull request #11494: [Feature][Style] Configure Spotless to format SQL code in DS

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on code in PR #11494:
URL: https://github.com/apache/dolphinscheduler/pull/11494#discussion_r947525935


##########
dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql:
##########
@@ -14,1955 +14,6933 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
 */
-
-SET FOREIGN_KEY_CHECKS=0;
+SET
+FOREIGN_KEY_CHECKS = 0;
 
 -- ----------------------------
 -- Table structure for QRTZ_BLOB_TRIGGERS
 -- ----------------------------
-DROP TABLE IF EXISTS `QRTZ_BLOB_TRIGGERS`;
-CREATE TABLE `QRTZ_BLOB_TRIGGERS` (
-  `SCHED_NAME` varchar(120) NOT NULL,
-  `TRIGGER_NAME` varchar(200) NOT NULL,
-  `TRIGGER_GROUP` varchar(200) NOT NULL,
-  `BLOB_DATA` blob,
-  PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
-  KEY `SCHED_NAME` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
-  CONSTRAINT `QRTZ_BLOB_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+DROP
+    TABLE
+        IF EXISTS ` QRTZ_BLOB_TRIGGERS `;
+
+CREATE
+    TABLE
+        ` QRTZ_BLOB_TRIGGERS `(
+            ` SCHED_NAME ` VARCHAR(120) NOT NULL,
+            ` TRIGGER_NAME ` VARCHAR(200) NOT NULL,
+            ` TRIGGER_GROUP ` VARCHAR(200) NOT NULL,
+            ` BLOB_DATA ` BLOB,
+            PRIMARY KEY(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            ),
+            KEY ` SCHED_NAME `(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            ),
+            CONSTRAINT ` QRTZ_BLOB_TRIGGERS_ibfk_1 ` FOREIGN KEY(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            ) REFERENCES ` QRTZ_TRIGGERS `(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            )
+        ) ENGINE = InnoDB DEFAULT CHARSET = utf8;
 
 -- ----------------------------
 -- Records of QRTZ_BLOB_TRIGGERS
 -- ----------------------------
-
 -- ----------------------------
 -- Table structure for QRTZ_CALENDARS
 -- ----------------------------
-DROP TABLE IF EXISTS `QRTZ_CALENDARS`;
-CREATE TABLE `QRTZ_CALENDARS` (
-  `SCHED_NAME` varchar(120) NOT NULL,
-  `CALENDAR_NAME` varchar(200) NOT NULL,
-  `CALENDAR` blob NOT NULL,
-  PRIMARY KEY (`SCHED_NAME`,`CALENDAR_NAME`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+DROP
+    TABLE
+        IF EXISTS ` QRTZ_CALENDARS `;
+
+CREATE
+    TABLE
+        ` QRTZ_CALENDARS `(
+            ` SCHED_NAME ` VARCHAR(120) NOT NULL,
+            ` CALENDAR_NAME ` VARCHAR(200) NOT NULL,
+            ` CALENDAR ` BLOB NOT NULL,
+            PRIMARY KEY(
+                ` SCHED_NAME `,
+                ` CALENDAR_NAME `
+            )
+        ) ENGINE = InnoDB DEFAULT CHARSET = utf8;

Review Comment:
   @SbloodyS @kezhenxu94 I've tested [prettier](https://github.com/diffplug/spotless/tree/main/plugin-maven#prettier) with `Spotless`, it seems there's some kind of bug to use `prettier-sql-plugin` with `Spotless`. Thus, `dbeaver` formatter is our only choice with `Spotless` for `SQL` formatting at this moment. We have to trade-off here. If consistency of formatting is more important, we will pick this `dbeaver formatter`. If you think the style is too ugly and prefer not to using it, we just leave those `SQL` scripts unformatted at present.



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

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] mergeable[bot] commented on pull request #11494: [Feature][Style] Configure Spotless to format SQL code in DS

Posted by GitBox <gi...@apache.org>.
mergeable[bot] commented on PR #11494:
URL: https://github.com/apache/dolphinscheduler/pull/11494#issuecomment-1216104565

   :warning: This PR do not change database DDL synchronize.
   


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

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11494: [Feature][Style] Configure Spotless to format SQL code in DS

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

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11494)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=CODE_SMELL)
   
   [![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11494&metric=coverage&view=list) No Coverage information  
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11494&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11494&metric=new_duplicated_lines_density&view=list)
   
   


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

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11494: [Feature][Style] Configure Spotless to format SQL code in DS

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

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11494)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=CODE_SMELL)
   
   [![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11494&metric=coverage&view=list) No Coverage information  
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11494&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11494&metric=new_duplicated_lines_density&view=list)
   
   


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

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] EricGao888 commented on pull request #11494: [Feature][Style] Configure Spotless to format SQL code in DS

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on PR #11494:
URL: https://github.com/apache/dolphinscheduler/pull/11494#issuecomment-1226715741

   If there are no more follow-ups, I will temporarily close this PR since some developers may not get used to this kind of SQL formatting. I will get back to this when `Spotless` support better SQL formatting functions, 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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] zhongjiajie commented on pull request #11494: [Feature][Style] Configure Spotless to format SQL code in DS

Posted by GitBox <gi...@apache.org>.
zhongjiajie commented on PR #11494:
URL: https://github.com/apache/dolphinscheduler/pull/11494#issuecomment-1226735779

   > If there are no more follow-ups, I will temporarily close this PR since some developers may not get used to this kind of SQL formatting. I will get back to this when `Spotless` support better SQL formatting functions, thanks.
   
   Yeah, I think this format is a little odd for me, maybe we should keep it in old, or find other formatting tools 


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

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] EricGao888 commented on pull request #11494: [Feature][Style] Configure Spotless to format SQL code in DS

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on PR #11494:
URL: https://github.com/apache/dolphinscheduler/pull/11494#issuecomment-1216111202

   > ⚠️ This PR do not change database DDL synchronize.
   
   Not sure what does this mean. I just changed the format, not content : )


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

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] mergeable[bot] commented on pull request #11494: [Feature][Style] Configure Spotless to format SQL code in DS

Posted by GitBox <gi...@apache.org>.
mergeable[bot] commented on PR #11494:
URL: https://github.com/apache/dolphinscheduler/pull/11494#issuecomment-1216098203

   :warning: This PR do not change database DDL synchronize.
   


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

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] EricGao888 commented on a diff in pull request #11494: [Feature][Style] Configure Spotless to format SQL code in DS

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on code in PR #11494:
URL: https://github.com/apache/dolphinscheduler/pull/11494#discussion_r947525935


##########
dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql:
##########
@@ -14,1955 +14,6933 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
 */
-
-SET FOREIGN_KEY_CHECKS=0;
+SET
+FOREIGN_KEY_CHECKS = 0;
 
 -- ----------------------------
 -- Table structure for QRTZ_BLOB_TRIGGERS
 -- ----------------------------
-DROP TABLE IF EXISTS `QRTZ_BLOB_TRIGGERS`;
-CREATE TABLE `QRTZ_BLOB_TRIGGERS` (
-  `SCHED_NAME` varchar(120) NOT NULL,
-  `TRIGGER_NAME` varchar(200) NOT NULL,
-  `TRIGGER_GROUP` varchar(200) NOT NULL,
-  `BLOB_DATA` blob,
-  PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
-  KEY `SCHED_NAME` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
-  CONSTRAINT `QRTZ_BLOB_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+DROP
+    TABLE
+        IF EXISTS ` QRTZ_BLOB_TRIGGERS `;
+
+CREATE
+    TABLE
+        ` QRTZ_BLOB_TRIGGERS `(
+            ` SCHED_NAME ` VARCHAR(120) NOT NULL,
+            ` TRIGGER_NAME ` VARCHAR(200) NOT NULL,
+            ` TRIGGER_GROUP ` VARCHAR(200) NOT NULL,
+            ` BLOB_DATA ` BLOB,
+            PRIMARY KEY(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            ),
+            KEY ` SCHED_NAME `(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            ),
+            CONSTRAINT ` QRTZ_BLOB_TRIGGERS_ibfk_1 ` FOREIGN KEY(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            ) REFERENCES ` QRTZ_TRIGGERS `(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            )
+        ) ENGINE = InnoDB DEFAULT CHARSET = utf8;
 
 -- ----------------------------
 -- Records of QRTZ_BLOB_TRIGGERS
 -- ----------------------------
-
 -- ----------------------------
 -- Table structure for QRTZ_CALENDARS
 -- ----------------------------
-DROP TABLE IF EXISTS `QRTZ_CALENDARS`;
-CREATE TABLE `QRTZ_CALENDARS` (
-  `SCHED_NAME` varchar(120) NOT NULL,
-  `CALENDAR_NAME` varchar(200) NOT NULL,
-  `CALENDAR` blob NOT NULL,
-  PRIMARY KEY (`SCHED_NAME`,`CALENDAR_NAME`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+DROP
+    TABLE
+        IF EXISTS ` QRTZ_CALENDARS `;
+
+CREATE
+    TABLE
+        ` QRTZ_CALENDARS `(
+            ` SCHED_NAME ` VARCHAR(120) NOT NULL,
+            ` CALENDAR_NAME ` VARCHAR(200) NOT NULL,
+            ` CALENDAR ` BLOB NOT NULL,
+            PRIMARY KEY(
+                ` SCHED_NAME `,
+                ` CALENDAR_NAME `
+            )
+        ) ENGINE = InnoDB DEFAULT CHARSET = utf8;

Review Comment:
   @SbloodyS @kezhenxu94 @caishunfeng  I've tested [prettier](https://github.com/diffplug/spotless/tree/main/plugin-maven#prettier) with `Spotless`, it seems there's some kind of bug to use `prettier-sql-plugin` with `Spotless`. Thus, `dbeaver` formatter is our only choice with `Spotless` for `SQL` formatting at this moment. We have to trade-off here. If consistency of formatting is more important, we will pick this `dbeaver formatter`. If you think the style is too ugly and prefer not to use it, we just leave those `SQL` scripts unformatted at present. WDYT?



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

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] EricGao888 closed pull request #11494: [Feature][Style] Configure Spotless to format SQL code in DS

Posted by GitBox <gi...@apache.org>.
EricGao888 closed pull request #11494: [Feature][Style] Configure Spotless to format SQL code in DS 
URL: https://github.com/apache/dolphinscheduler/pull/11494


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

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] kezhenxu94 commented on a diff in pull request #11494: [Feature][Style] Configure Spotless to format SQL code in DS

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on code in PR #11494:
URL: https://github.com/apache/dolphinscheduler/pull/11494#discussion_r947532968


##########
style/dbeaver.properties:
##########
@@ -0,0 +1,24 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# case of the keywords (UPPER, LOWER or ORIGINAL)
+sql.formatter.keyword.case=UPPER
+# Statement delimiter
+sql.formatter.statement.delimiter=;
+# Indentation style (space or tab)
+sql.formatter.indent.type=space
+# Number of identation characters
+sql.formatter.indent.size=4

Review Comment:
   Maybe change the indent size to 2?



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

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] SbloodyS commented on a diff in pull request #11494: [Feature][Style] Configure Spotless to format SQL code in DS

Posted by GitBox <gi...@apache.org>.
SbloodyS commented on code in PR #11494:
URL: https://github.com/apache/dolphinscheduler/pull/11494#discussion_r946379840


##########
dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql:
##########
@@ -14,1955 +14,6933 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
 */
-
-SET FOREIGN_KEY_CHECKS=0;
+SET
+FOREIGN_KEY_CHECKS = 0;
 
 -- ----------------------------
 -- Table structure for QRTZ_BLOB_TRIGGERS
 -- ----------------------------
-DROP TABLE IF EXISTS `QRTZ_BLOB_TRIGGERS`;
-CREATE TABLE `QRTZ_BLOB_TRIGGERS` (
-  `SCHED_NAME` varchar(120) NOT NULL,
-  `TRIGGER_NAME` varchar(200) NOT NULL,
-  `TRIGGER_GROUP` varchar(200) NOT NULL,
-  `BLOB_DATA` blob,
-  PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
-  KEY `SCHED_NAME` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
-  CONSTRAINT `QRTZ_BLOB_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+DROP
+    TABLE
+        IF EXISTS ` QRTZ_BLOB_TRIGGERS `;
+
+CREATE
+    TABLE
+        ` QRTZ_BLOB_TRIGGERS `(
+            ` SCHED_NAME ` VARCHAR(120) NOT NULL,
+            ` TRIGGER_NAME ` VARCHAR(200) NOT NULL,
+            ` TRIGGER_GROUP ` VARCHAR(200) NOT NULL,
+            ` BLOB_DATA ` BLOB,
+            PRIMARY KEY(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            ),
+            KEY ` SCHED_NAME `(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            ),
+            CONSTRAINT ` QRTZ_BLOB_TRIGGERS_ibfk_1 ` FOREIGN KEY(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            ) REFERENCES ` QRTZ_TRIGGERS `(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            )
+        ) ENGINE = InnoDB DEFAULT CHARSET = utf8;
 
 -- ----------------------------
 -- Records of QRTZ_BLOB_TRIGGERS
 -- ----------------------------
-
 -- ----------------------------
 -- Table structure for QRTZ_CALENDARS
 -- ----------------------------
-DROP TABLE IF EXISTS `QRTZ_CALENDARS`;
-CREATE TABLE `QRTZ_CALENDARS` (
-  `SCHED_NAME` varchar(120) NOT NULL,
-  `CALENDAR_NAME` varchar(200) NOT NULL,
-  `CALENDAR` blob NOT NULL,
-  PRIMARY KEY (`SCHED_NAME`,`CALENDAR_NAME`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+DROP
+    TABLE
+        IF EXISTS ` QRTZ_CALENDARS `;
+
+CREATE
+    TABLE
+        ` QRTZ_CALENDARS `(
+            ` SCHED_NAME ` VARCHAR(120) NOT NULL,
+            ` CALENDAR_NAME ` VARCHAR(200) NOT NULL,
+            ` CALENDAR ` BLOB NOT NULL,
+            PRIMARY KEY(
+                ` SCHED_NAME `,
+                ` CALENDAR_NAME `
+            )
+        ) ENGINE = InnoDB DEFAULT CHARSET = utf8;

Review Comment:
   This format is really ugly...



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

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] mergeable[bot] commented on pull request #11494: [Feature][Style] Configure Spotless to format SQL code in DS

Posted by GitBox <gi...@apache.org>.
mergeable[bot] commented on PR #11494:
URL: https://github.com/apache/dolphinscheduler/pull/11494#issuecomment-1217661531

   :warning: This PR do not change database DDL synchronize.
   


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

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] EricGao888 commented on a diff in pull request #11494: [Feature][Style] Configure Spotless to format SQL code in DS

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on code in PR #11494:
URL: https://github.com/apache/dolphinscheduler/pull/11494#discussion_r947552367


##########
style/dbeaver.properties:
##########
@@ -0,0 +1,24 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# case of the keywords (UPPER, LOWER or ORIGINAL)
+sql.formatter.keyword.case=UPPER
+# Statement delimiter
+sql.formatter.statement.delimiter=;
+# Indentation style (space or tab)
+sql.formatter.indent.type=space
+# Number of identation characters
+sql.formatter.indent.size=4

Review Comment:
   @kezhenxu94 Done, it looks better to me.



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

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] SbloodyS commented on a diff in pull request #11494: [Feature][Style] Configure Spotless to format SQL code in DS

Posted by GitBox <gi...@apache.org>.
SbloodyS commented on code in PR #11494:
URL: https://github.com/apache/dolphinscheduler/pull/11494#discussion_r946496680


##########
dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql:
##########
@@ -14,1955 +14,6933 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
 */
-
-SET FOREIGN_KEY_CHECKS=0;
+SET
+FOREIGN_KEY_CHECKS = 0;
 
 -- ----------------------------
 -- Table structure for QRTZ_BLOB_TRIGGERS
 -- ----------------------------
-DROP TABLE IF EXISTS `QRTZ_BLOB_TRIGGERS`;
-CREATE TABLE `QRTZ_BLOB_TRIGGERS` (
-  `SCHED_NAME` varchar(120) NOT NULL,
-  `TRIGGER_NAME` varchar(200) NOT NULL,
-  `TRIGGER_GROUP` varchar(200) NOT NULL,
-  `BLOB_DATA` blob,
-  PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
-  KEY `SCHED_NAME` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
-  CONSTRAINT `QRTZ_BLOB_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+DROP
+    TABLE
+        IF EXISTS ` QRTZ_BLOB_TRIGGERS `;
+
+CREATE
+    TABLE
+        ` QRTZ_BLOB_TRIGGERS `(
+            ` SCHED_NAME ` VARCHAR(120) NOT NULL,
+            ` TRIGGER_NAME ` VARCHAR(200) NOT NULL,
+            ` TRIGGER_GROUP ` VARCHAR(200) NOT NULL,
+            ` BLOB_DATA ` BLOB,
+            PRIMARY KEY(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            ),
+            KEY ` SCHED_NAME `(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            ),
+            CONSTRAINT ` QRTZ_BLOB_TRIGGERS_ibfk_1 ` FOREIGN KEY(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            ) REFERENCES ` QRTZ_TRIGGERS `(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            )
+        ) ENGINE = InnoDB DEFAULT CHARSET = utf8;
 
 -- ----------------------------
 -- Records of QRTZ_BLOB_TRIGGERS
 -- ----------------------------
-
 -- ----------------------------
 -- Table structure for QRTZ_CALENDARS
 -- ----------------------------
-DROP TABLE IF EXISTS `QRTZ_CALENDARS`;
-CREATE TABLE `QRTZ_CALENDARS` (
-  `SCHED_NAME` varchar(120) NOT NULL,
-  `CALENDAR_NAME` varchar(200) NOT NULL,
-  `CALENDAR` blob NOT NULL,
-  PRIMARY KEY (`SCHED_NAME`,`CALENDAR_NAME`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+DROP
+    TABLE
+        IF EXISTS ` QRTZ_CALENDARS `;
+
+CREATE
+    TABLE
+        ` QRTZ_CALENDARS `(
+            ` SCHED_NAME ` VARCHAR(120) NOT NULL,
+            ` CALENDAR_NAME ` VARCHAR(200) NOT NULL,
+            ` CALENDAR ` BLOB NOT NULL,
+            PRIMARY KEY(
+                ` SCHED_NAME `,
+                ` CALENDAR_NAME `
+            )
+        ) ENGINE = InnoDB DEFAULT CHARSET = utf8;

Review Comment:
   I still think this is not as good as 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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] EricGao888 commented on pull request #11494: [Feature][Style] Configure Spotless to format SQL code in DS

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on PR #11494:
URL: https://github.com/apache/dolphinscheduler/pull/11494#issuecomment-1226738872

   This tool is under development. Once it is completed, we might use it with `Spotless`. https://www.npmjs.com/package/prettier-plugin-sql


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

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11494: [Feature][Style] Configure Spotless to format SQL code in DS

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

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11494)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=CODE_SMELL)
   
   [![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11494&metric=coverage&view=list) No Coverage information  
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11494&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11494&metric=new_duplicated_lines_density&view=list)
   
   


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

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] EricGao888 commented on pull request #11494: [Feature][Style] Configure Spotless to format SQL code in DS

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on PR #11494:
URL: https://github.com/apache/dolphinscheduler/pull/11494#issuecomment-1216197360

   @kezhenxu94 @caishunfeng @SbloodyS Could u plz take a look when available? 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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] EricGao888 commented on a diff in pull request #11494: [Feature][Style] Configure Spotless to format SQL code in DS

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on code in PR #11494:
URL: https://github.com/apache/dolphinscheduler/pull/11494#discussion_r946500396


##########
dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql:
##########
@@ -14,1955 +14,6933 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
 */
-
-SET FOREIGN_KEY_CHECKS=0;
+SET
+FOREIGN_KEY_CHECKS = 0;
 
 -- ----------------------------
 -- Table structure for QRTZ_BLOB_TRIGGERS
 -- ----------------------------
-DROP TABLE IF EXISTS `QRTZ_BLOB_TRIGGERS`;
-CREATE TABLE `QRTZ_BLOB_TRIGGERS` (
-  `SCHED_NAME` varchar(120) NOT NULL,
-  `TRIGGER_NAME` varchar(200) NOT NULL,
-  `TRIGGER_GROUP` varchar(200) NOT NULL,
-  `BLOB_DATA` blob,
-  PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
-  KEY `SCHED_NAME` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
-  CONSTRAINT `QRTZ_BLOB_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+DROP
+    TABLE
+        IF EXISTS ` QRTZ_BLOB_TRIGGERS `;
+
+CREATE
+    TABLE
+        ` QRTZ_BLOB_TRIGGERS `(
+            ` SCHED_NAME ` VARCHAR(120) NOT NULL,
+            ` TRIGGER_NAME ` VARCHAR(200) NOT NULL,
+            ` TRIGGER_GROUP ` VARCHAR(200) NOT NULL,
+            ` BLOB_DATA ` BLOB,
+            PRIMARY KEY(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            ),
+            KEY ` SCHED_NAME `(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            ),
+            CONSTRAINT ` QRTZ_BLOB_TRIGGERS_ibfk_1 ` FOREIGN KEY(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            ) REFERENCES ` QRTZ_TRIGGERS `(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            )
+        ) ENGINE = InnoDB DEFAULT CHARSET = utf8;
 
 -- ----------------------------
 -- Records of QRTZ_BLOB_TRIGGERS
 -- ----------------------------
-
 -- ----------------------------
 -- Table structure for QRTZ_CALENDARS
 -- ----------------------------
-DROP TABLE IF EXISTS `QRTZ_CALENDARS`;
-CREATE TABLE `QRTZ_CALENDARS` (
-  `SCHED_NAME` varchar(120) NOT NULL,
-  `CALENDAR_NAME` varchar(200) NOT NULL,
-  `CALENDAR` blob NOT NULL,
-  PRIMARY KEY (`SCHED_NAME`,`CALENDAR_NAME`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+DROP
+    TABLE
+        IF EXISTS ` QRTZ_CALENDARS `;
+
+CREATE
+    TABLE
+        ` QRTZ_CALENDARS `(
+            ` SCHED_NAME ` VARCHAR(120) NOT NULL,
+            ` CALENDAR_NAME ` VARCHAR(200) NOT NULL,
+            ` CALENDAR ` BLOB NOT NULL,
+            PRIMARY KEY(
+                ` SCHED_NAME `,
+                ` CALENDAR_NAME `
+            )
+        ) ENGINE = InnoDB DEFAULT CHARSET = utf8;

Review Comment:
   > I still think this is not as good as before.
   
   LOL I'm looking into `prettier` to see if we could have a better one. But at least it unifies the sql formatting...



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

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] EricGao888 commented on a diff in pull request #11494: [Feature][Style] Configure Spotless to format SQL code in DS

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on code in PR #11494:
URL: https://github.com/apache/dolphinscheduler/pull/11494#discussion_r946500396


##########
dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql:
##########
@@ -14,1955 +14,6933 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
 */
-
-SET FOREIGN_KEY_CHECKS=0;
+SET
+FOREIGN_KEY_CHECKS = 0;
 
 -- ----------------------------
 -- Table structure for QRTZ_BLOB_TRIGGERS
 -- ----------------------------
-DROP TABLE IF EXISTS `QRTZ_BLOB_TRIGGERS`;
-CREATE TABLE `QRTZ_BLOB_TRIGGERS` (
-  `SCHED_NAME` varchar(120) NOT NULL,
-  `TRIGGER_NAME` varchar(200) NOT NULL,
-  `TRIGGER_GROUP` varchar(200) NOT NULL,
-  `BLOB_DATA` blob,
-  PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
-  KEY `SCHED_NAME` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
-  CONSTRAINT `QRTZ_BLOB_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+DROP
+    TABLE
+        IF EXISTS ` QRTZ_BLOB_TRIGGERS `;
+
+CREATE
+    TABLE
+        ` QRTZ_BLOB_TRIGGERS `(
+            ` SCHED_NAME ` VARCHAR(120) NOT NULL,
+            ` TRIGGER_NAME ` VARCHAR(200) NOT NULL,
+            ` TRIGGER_GROUP ` VARCHAR(200) NOT NULL,
+            ` BLOB_DATA ` BLOB,
+            PRIMARY KEY(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            ),
+            KEY ` SCHED_NAME `(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            ),
+            CONSTRAINT ` QRTZ_BLOB_TRIGGERS_ibfk_1 ` FOREIGN KEY(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            ) REFERENCES ` QRTZ_TRIGGERS `(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            )
+        ) ENGINE = InnoDB DEFAULT CHARSET = utf8;
 
 -- ----------------------------
 -- Records of QRTZ_BLOB_TRIGGERS
 -- ----------------------------
-
 -- ----------------------------
 -- Table structure for QRTZ_CALENDARS
 -- ----------------------------
-DROP TABLE IF EXISTS `QRTZ_CALENDARS`;
-CREATE TABLE `QRTZ_CALENDARS` (
-  `SCHED_NAME` varchar(120) NOT NULL,
-  `CALENDAR_NAME` varchar(200) NOT NULL,
-  `CALENDAR` blob NOT NULL,
-  PRIMARY KEY (`SCHED_NAME`,`CALENDAR_NAME`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+DROP
+    TABLE
+        IF EXISTS ` QRTZ_CALENDARS `;
+
+CREATE
+    TABLE
+        ` QRTZ_CALENDARS `(
+            ` SCHED_NAME ` VARCHAR(120) NOT NULL,
+            ` CALENDAR_NAME ` VARCHAR(200) NOT NULL,
+            ` CALENDAR ` BLOB NOT NULL,
+            PRIMARY KEY(
+                ` SCHED_NAME `,
+                ` CALENDAR_NAME `
+            )
+        ) ENGINE = InnoDB DEFAULT CHARSET = utf8;

Review Comment:
   > I still think this is not as good as before.
   
   LOL I'm looking into prettier to see if we could have a better one.



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

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] codecov-commenter commented on pull request #11494: [Feature][Style] Configure Spotless to format SQL code in DS

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

   # [Codecov](https://codecov.io/gh/apache/dolphinscheduler/pull/11494?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 [#11494](https://codecov.io/gh/apache/dolphinscheduler/pull/11494?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7b8f5e8) into [dev](https://codecov.io/gh/apache/dolphinscheduler/commit/68316f68fa9b90560846c3a12274edec2bf5d960?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (68316f6) will **decrease** coverage by `0.02%`.
   > The diff coverage is `n/a`.
   
   ```diff
   @@             Coverage Diff              @@
   ##                dev   #11494      +/-   ##
   ============================================
   - Coverage     39.37%   39.34%   -0.03%     
   + Complexity     4631     4628       -3     
   ============================================
     Files           987      987              
     Lines         37566    37548      -18     
     Branches       4184     4178       -6     
   ============================================
   - Hits          14790    14774      -16     
     Misses        21226    21226              
   + Partials       1550     1548       -2     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dolphinscheduler/pull/11494?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...erver/master/processor/queue/TaskEventService.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11494/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-ZG9scGhpbnNjaGVkdWxlci1tYXN0ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvc2VydmVyL21hc3Rlci9wcm9jZXNzb3IvcXVldWUvVGFza0V2ZW50U2VydmljZS5qYXZh) | `69.64% <0.00%> (-10.72%)` | :arrow_down: |
   | [...org/apache/dolphinscheduler/remote/utils/Host.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11494/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-ZG9scGhpbnNjaGVkdWxlci1yZW1vdGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvcmVtb3RlL3V0aWxzL0hvc3QuamF2YQ==) | `42.55% <0.00%> (-2.13%)` | :arrow_down: |
   | [...e/dolphinscheduler/remote/NettyRemotingClient.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11494/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-ZG9scGhpbnNjaGVkdWxlci1yZW1vdGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvcmVtb3RlL05ldHR5UmVtb3RpbmdDbGllbnQuamF2YQ==) | `51.38% <0.00%> (-1.39%)` | :arrow_down: |
   | [...r/plugin/task/sqoop/parameter/SqoopParameters.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11494/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-ZG9scGhpbnNjaGVkdWxlci10YXNrLXBsdWdpbi9kb2xwaGluc2NoZWR1bGVyLXRhc2stc3Fvb3Avc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvcGx1Z2luL3Rhc2svc3Fvb3AvcGFyYW1ldGVyL1Nxb29wUGFyYW1ldGVycy5qYXZh) | `55.12% <0.00%> (-1.29%)` | :arrow_down: |
   | [...che/dolphinscheduler/common/utils/HadoopUtils.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11494/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-ZG9scGhpbnNjaGVkdWxlci1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvY29tbW9uL3V0aWxzL0hhZG9vcFV0aWxzLmphdmE=) | `15.86% <0.00%> (-0.73%)` | :arrow_down: |
   | [...uler/api/service/impl/DataAnalysisServiceImpl.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11494/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-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL3NlcnZpY2UvaW1wbC9EYXRhQW5hbHlzaXNTZXJ2aWNlSW1wbC5qYXZh) | `81.51% <0.00%> (-0.31%)` | :arrow_down: |
   | [...pache/dolphinscheduler/common/utils/DateUtils.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11494/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-ZG9scGhpbnNjaGVkdWxlci1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvY29tbW9uL3V0aWxzL0RhdGVVdGlscy5qYXZh) | `74.84% <0.00%> (-0.16%)` | :arrow_down: |
   | [...api/service/impl/ProcessDefinitionServiceImpl.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11494/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-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL3NlcnZpY2UvaW1wbC9Qcm9jZXNzRGVmaW5pdGlvblNlcnZpY2VJbXBsLmphdmE=) | `32.27% <0.00%> (-0.01%)` | :arrow_down: |
   | [...e/dolphinscheduler/server/master/MasterServer.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11494/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-ZG9scGhpbnNjaGVkdWxlci1tYXN0ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvc2VydmVyL21hc3Rlci9NYXN0ZXJTZXJ2ZXIuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...e/dolphinscheduler/server/worker/WorkerServer.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11494/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-ZG9scGhpbnNjaGVkdWxlci13b3JrZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvc2VydmVyL3dvcmtlci9Xb3JrZXJTZXJ2ZXIuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | ... and [5 more](https://codecov.io/gh/apache/dolphinscheduler/pull/11494/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] EricGao888 commented on a diff in pull request #11494: [Feature][Style] Configure Spotless to format SQL code in DS

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on code in PR #11494:
URL: https://github.com/apache/dolphinscheduler/pull/11494#discussion_r946384884


##########
dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql:
##########
@@ -14,1955 +14,6933 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
 */
-
-SET FOREIGN_KEY_CHECKS=0;
+SET
+FOREIGN_KEY_CHECKS = 0;
 
 -- ----------------------------
 -- Table structure for QRTZ_BLOB_TRIGGERS
 -- ----------------------------
-DROP TABLE IF EXISTS `QRTZ_BLOB_TRIGGERS`;
-CREATE TABLE `QRTZ_BLOB_TRIGGERS` (
-  `SCHED_NAME` varchar(120) NOT NULL,
-  `TRIGGER_NAME` varchar(200) NOT NULL,
-  `TRIGGER_GROUP` varchar(200) NOT NULL,
-  `BLOB_DATA` blob,
-  PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
-  KEY `SCHED_NAME` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
-  CONSTRAINT `QRTZ_BLOB_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+DROP
+    TABLE
+        IF EXISTS ` QRTZ_BLOB_TRIGGERS `;
+
+CREATE
+    TABLE
+        ` QRTZ_BLOB_TRIGGERS `(
+            ` SCHED_NAME ` VARCHAR(120) NOT NULL,
+            ` TRIGGER_NAME ` VARCHAR(200) NOT NULL,
+            ` TRIGGER_GROUP ` VARCHAR(200) NOT NULL,
+            ` BLOB_DATA ` BLOB,
+            PRIMARY KEY(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            ),
+            KEY ` SCHED_NAME `(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            ),
+            CONSTRAINT ` QRTZ_BLOB_TRIGGERS_ibfk_1 ` FOREIGN KEY(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            ) REFERENCES ` QRTZ_TRIGGERS `(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            )
+        ) ENGINE = InnoDB DEFAULT CHARSET = utf8;
 
 -- ----------------------------
 -- Records of QRTZ_BLOB_TRIGGERS
 -- ----------------------------
-
 -- ----------------------------
 -- Table structure for QRTZ_CALENDARS
 -- ----------------------------
-DROP TABLE IF EXISTS `QRTZ_CALENDARS`;
-CREATE TABLE `QRTZ_CALENDARS` (
-  `SCHED_NAME` varchar(120) NOT NULL,
-  `CALENDAR_NAME` varchar(200) NOT NULL,
-  `CALENDAR` blob NOT NULL,
-  PRIMARY KEY (`SCHED_NAME`,`CALENDAR_NAME`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+DROP
+    TABLE
+        IF EXISTS ` QRTZ_CALENDARS `;
+
+CREATE
+    TABLE
+        ` QRTZ_CALENDARS `(
+            ` SCHED_NAME ` VARCHAR(120) NOT NULL,
+            ` CALENDAR_NAME ` VARCHAR(200) NOT NULL,
+            ` CALENDAR ` BLOB NOT NULL,
+            PRIMARY KEY(
+                ` SCHED_NAME `,
+                ` CALENDAR_NAME `
+            )
+        ) ENGINE = InnoDB DEFAULT CHARSET = utf8;

Review Comment:
   LOL. This is formatted by [dbeaver](https://github.com/diffplug/spotless/tree/main/plugin-maven#dbeaver), we may choose other formatting options, or switch to use [prettier](https://github.com/diffplug/spotless/tree/main/plugin-maven#prettier)... 🤣 



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

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] EricGao888 commented on a diff in pull request #11494: [Feature][Style] Configure Spotless to format SQL code in DS

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on code in PR #11494:
URL: https://github.com/apache/dolphinscheduler/pull/11494#discussion_r946391019


##########
dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql:
##########
@@ -14,1955 +14,6933 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
 */
-
-SET FOREIGN_KEY_CHECKS=0;
+SET
+FOREIGN_KEY_CHECKS = 0;
 
 -- ----------------------------
 -- Table structure for QRTZ_BLOB_TRIGGERS
 -- ----------------------------
-DROP TABLE IF EXISTS `QRTZ_BLOB_TRIGGERS`;
-CREATE TABLE `QRTZ_BLOB_TRIGGERS` (
-  `SCHED_NAME` varchar(120) NOT NULL,
-  `TRIGGER_NAME` varchar(200) NOT NULL,
-  `TRIGGER_GROUP` varchar(200) NOT NULL,
-  `BLOB_DATA` blob,
-  PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
-  KEY `SCHED_NAME` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
-  CONSTRAINT `QRTZ_BLOB_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+DROP
+    TABLE
+        IF EXISTS ` QRTZ_BLOB_TRIGGERS `;
+
+CREATE
+    TABLE
+        ` QRTZ_BLOB_TRIGGERS `(
+            ` SCHED_NAME ` VARCHAR(120) NOT NULL,
+            ` TRIGGER_NAME ` VARCHAR(200) NOT NULL,
+            ` TRIGGER_GROUP ` VARCHAR(200) NOT NULL,
+            ` BLOB_DATA ` BLOB,
+            PRIMARY KEY(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            ),
+            KEY ` SCHED_NAME `(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            ),
+            CONSTRAINT ` QRTZ_BLOB_TRIGGERS_ibfk_1 ` FOREIGN KEY(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            ) REFERENCES ` QRTZ_TRIGGERS `(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            )
+        ) ENGINE = InnoDB DEFAULT CHARSET = utf8;
 
 -- ----------------------------
 -- Records of QRTZ_BLOB_TRIGGERS
 -- ----------------------------
-
 -- ----------------------------
 -- Table structure for QRTZ_CALENDARS
 -- ----------------------------
-DROP TABLE IF EXISTS `QRTZ_CALENDARS`;
-CREATE TABLE `QRTZ_CALENDARS` (
-  `SCHED_NAME` varchar(120) NOT NULL,
-  `CALENDAR_NAME` varchar(200) NOT NULL,
-  `CALENDAR` blob NOT NULL,
-  PRIMARY KEY (`SCHED_NAME`,`CALENDAR_NAME`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+DROP
+    TABLE
+        IF EXISTS ` QRTZ_CALENDARS `;
+
+CREATE
+    TABLE
+        ` QRTZ_CALENDARS `(
+            ` SCHED_NAME ` VARCHAR(120) NOT NULL,
+            ` CALENDAR_NAME ` VARCHAR(200) NOT NULL,
+            ` CALENDAR ` BLOB NOT NULL,
+            PRIMARY KEY(
+                ` SCHED_NAME `,
+                ` CALENDAR_NAME `
+            )
+        ) ENGINE = InnoDB DEFAULT CHARSET = utf8;

Review Comment:
   Although it looks a bit strange, it helps the SQL code more readable once you get used to 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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11494: [Feature][Style] Configure Spotless to format SQL code in DS

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

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11494)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11494&resolved=false&types=CODE_SMELL)
   
   [![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11494&metric=coverage&view=list) No Coverage information  
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11494&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11494&metric=new_duplicated_lines_density&view=list)
   
   


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

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] EricGao888 commented on a diff in pull request #11494: [Feature][Style] Configure Spotless to format SQL code in DS

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on code in PR #11494:
URL: https://github.com/apache/dolphinscheduler/pull/11494#discussion_r947525935


##########
dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql:
##########
@@ -14,1955 +14,6933 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
 */
-
-SET FOREIGN_KEY_CHECKS=0;
+SET
+FOREIGN_KEY_CHECKS = 0;
 
 -- ----------------------------
 -- Table structure for QRTZ_BLOB_TRIGGERS
 -- ----------------------------
-DROP TABLE IF EXISTS `QRTZ_BLOB_TRIGGERS`;
-CREATE TABLE `QRTZ_BLOB_TRIGGERS` (
-  `SCHED_NAME` varchar(120) NOT NULL,
-  `TRIGGER_NAME` varchar(200) NOT NULL,
-  `TRIGGER_GROUP` varchar(200) NOT NULL,
-  `BLOB_DATA` blob,
-  PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
-  KEY `SCHED_NAME` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
-  CONSTRAINT `QRTZ_BLOB_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+DROP
+    TABLE
+        IF EXISTS ` QRTZ_BLOB_TRIGGERS `;
+
+CREATE
+    TABLE
+        ` QRTZ_BLOB_TRIGGERS `(
+            ` SCHED_NAME ` VARCHAR(120) NOT NULL,
+            ` TRIGGER_NAME ` VARCHAR(200) NOT NULL,
+            ` TRIGGER_GROUP ` VARCHAR(200) NOT NULL,
+            ` BLOB_DATA ` BLOB,
+            PRIMARY KEY(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            ),
+            KEY ` SCHED_NAME `(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            ),
+            CONSTRAINT ` QRTZ_BLOB_TRIGGERS_ibfk_1 ` FOREIGN KEY(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            ) REFERENCES ` QRTZ_TRIGGERS `(
+                ` SCHED_NAME `,
+                ` TRIGGER_NAME `,
+                ` TRIGGER_GROUP `
+            )
+        ) ENGINE = InnoDB DEFAULT CHARSET = utf8;
 
 -- ----------------------------
 -- Records of QRTZ_BLOB_TRIGGERS
 -- ----------------------------
-
 -- ----------------------------
 -- Table structure for QRTZ_CALENDARS
 -- ----------------------------
-DROP TABLE IF EXISTS `QRTZ_CALENDARS`;
-CREATE TABLE `QRTZ_CALENDARS` (
-  `SCHED_NAME` varchar(120) NOT NULL,
-  `CALENDAR_NAME` varchar(200) NOT NULL,
-  `CALENDAR` blob NOT NULL,
-  PRIMARY KEY (`SCHED_NAME`,`CALENDAR_NAME`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+DROP
+    TABLE
+        IF EXISTS ` QRTZ_CALENDARS `;
+
+CREATE
+    TABLE
+        ` QRTZ_CALENDARS `(
+            ` SCHED_NAME ` VARCHAR(120) NOT NULL,
+            ` CALENDAR_NAME ` VARCHAR(200) NOT NULL,
+            ` CALENDAR ` BLOB NOT NULL,
+            PRIMARY KEY(
+                ` SCHED_NAME `,
+                ` CALENDAR_NAME `
+            )
+        ) ENGINE = InnoDB DEFAULT CHARSET = utf8;

Review Comment:
   @SbloodyS @kezhenxu94 @caishunfeng  I've tested [prettier](https://github.com/diffplug/spotless/tree/main/plugin-maven#prettier) with `Spotless`, it seems there's some kind of bug to use `prettier-sql-plugin` with `Spotless`. Thus, `dbeaver` formatter is our only choice with `Spotless` for `SQL` formatting at this moment. We have to trade-off here. If consistency of formatting is more important, we will pick this `dbeaver formatter`. If you think the style is too ugly and prefer not to using it, we just leave those `SQL` scripts unformatted at present. WDYT?



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

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] mergeable[bot] commented on pull request #11494: [Feature][Style] Configure Spotless to format SQL code in DS

Posted by GitBox <gi...@apache.org>.
mergeable[bot] commented on PR #11494:
URL: https://github.com/apache/dolphinscheduler/pull/11494#issuecomment-1217578932

   :warning: This PR do not change database DDL synchronize.
   


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

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org