You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/07/22 02:17:39 UTC

[GitHub] [shardingsphere] azexcy opened a new pull request, #19456: Clean unused code in AbstractDataSourcePreparer

azexcy opened a new pull request, #19456:
URL: https://github.com/apache/shardingsphere/pull/19456

   Fixes #19430.
   
   Changes proposed in this pull request:
   - Clean unused code in AbstractDataSourcePreparer
   - Improve opengauss create table
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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


[GitHub] [shardingsphere] codecov-commenter commented on pull request #19456: Clean unused code in AbstractDataSourcePreparer and fix ci

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

   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/19456?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 [#19456](https://codecov.io/gh/apache/shardingsphere/pull/19456?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (0f1534e) into [master](https://codecov.io/gh/apache/shardingsphere/commit/23fae80b23ce1188b3d890a3e2b3aefc8ce36ad3?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (23fae80) will **increase** coverage by `0.03%`.
   > The diff coverage is `50.00%`.
   
   > :exclamation: Current head 0f1534e differs from pull request most recent head 0ea01ae. Consider uploading reports for the commit 0ea01ae to get more accurate results
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #19456      +/-   ##
   ============================================
   + Coverage     59.82%   59.86%   +0.03%     
     Complexity     2383     2383              
   ============================================
     Files          3822     3822              
     Lines         54480    54447      -33     
     Branches       7648     7642       -6     
   ============================================
   - Hits          32594    32593       -1     
   + Misses        19087    19056      -31     
   + Partials       2799     2798       -1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/19456?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [.../core/metadata/generator/PipelineDDLGenerator.java](https://codecov.io/gh/apache/shardingsphere/pull/19456/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-c2hhcmRpbmdzcGhlcmUta2VybmVsL3NoYXJkaW5nc3BoZXJlLWRhdGEtcGlwZWxpbmUvc2hhcmRpbmdzcGhlcmUtZGF0YS1waXBlbGluZS1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9kYXRhL3BpcGVsaW5lL2NvcmUvbWV0YWRhdGEvZ2VuZXJhdG9yL1BpcGVsaW5lRERMR2VuZXJhdG9yLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...prepare/datasource/AbstractDataSourcePreparer.java](https://codecov.io/gh/apache/shardingsphere/pull/19456/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-c2hhcmRpbmdzcGhlcmUta2VybmVsL3NoYXJkaW5nc3BoZXJlLWRhdGEtcGlwZWxpbmUvc2hhcmRpbmdzcGhlcmUtZGF0YS1waXBlbGluZS1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9kYXRhL3BpcGVsaW5lL2NvcmUvcHJlcGFyZS9kYXRhc291cmNlL0Fic3RyYWN0RGF0YVNvdXJjZVByZXBhcmVyLmphdmE=) | `0.00% <ø> (ø)` | |
   | [...repare/datasource/OpenGaussDataSourcePreparer.java](https://codecov.io/gh/apache/shardingsphere/pull/19456/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-c2hhcmRpbmdzcGhlcmUta2VybmVsL3NoYXJkaW5nc3BoZXJlLWRhdGEtcGlwZWxpbmUvc2hhcmRpbmdzcGhlcmUtZGF0YS1waXBlbGluZS1kaWFsZWN0L3NoYXJkaW5nc3BoZXJlLWRhdGEtcGlwZWxpbmUtb3BlbmdhdXNzL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9kYXRhL3BpcGVsaW5lL29wZW5nYXVzcy9wcmVwYXJlL2RhdGFzb3VyY2UvT3BlbkdhdXNzRGF0YVNvdXJjZVByZXBhcmVyLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...text/distsql/ral/advanced/ParseDistSQLHandler.java](https://codecov.io/gh/apache/shardingsphere/pull/19456/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-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC90ZXh0L2Rpc3RzcWwvcmFsL2FkdmFuY2VkL1BhcnNlRGlzdFNRTEhhbmRsZXIuamF2YQ==) | `100.00% <100.00%> (+16.66%)` | :arrow_up: |
   
   Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?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: notifications-unsubscribe@shardingsphere.apache.org

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


[GitHub] [shardingsphere] sandynz commented on a diff in pull request #19456: Clean unused code in AbstractDataSourcePreparer and fix ci

Posted by GitBox <gi...@apache.org>.
sandynz commented on code in PR #19456:
URL: https://github.com/apache/shardingsphere/pull/19456#discussion_r927251086


##########
shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/prepare/datasource/AbstractDataSourcePreparerTest.java:
##########
@@ -39,36 +38,18 @@ public void prepareTargetTables(final PrepareTargetTablesParameter parameter) {
         }
     };
     
-    @Test
-    public void assertGetTableDefinitionSQLType() {
-        assertThat(preparer.getTableDefinitionSQLType("SET search_path = public"), is(TableDefinitionSQLType.UNKNOWN));
-        assertThat(preparer.getTableDefinitionSQLType("CREATE TABLE t1_0 (id int NOT NULL)"), is(TableDefinitionSQLType.CREATE_TABLE));
-        assertThat(preparer.getTableDefinitionSQLType("ALTER TABLE t1_0 ADD CONSTRAINT t1_0_pkey PRIMARY KEY (id)"), is(TableDefinitionSQLType.ALTER_TABLE));
-    }
-    
     @Test
     public void assertAddIfNotExistsForCreateTableSQL() {
         Collection<String> createTableSQLs = Arrays.asList("CREATE TABLE IF NOT EXISTS t (id int)", "CREATE TABLE t (id int)",
-                "CREATE  TABLE IF \nNOT \tEXISTS t (id int)", "CREATE \tTABLE t (id int)");
+                "CREATE  TABLE IF \nNOT \tEXISTS t (id int)", "CREATE \tTABLE t (id int)", "CREATE TABLE \tt_order (id bigint) WITH (orientation=row, compression=no);");
         for (String each : createTableSQLs) {
-            String sql = preparer.addIfNotExistsForCreateTableSQL(each);
-            assertTrue(PATTERN_CREATE_TABLE_IF_NOT_EXISTS.matcher(sql).find());
+            String actual = preparer.addIfNotExistsForCreateTableSQL(each);
+            assertTrue(PATTERN_CREATE_TABLE_IF_NOT_EXISTS.matcher(actual).find());
+        }
+        Collection<String> mismatchedSQLs = Arrays.asList("SET search_path = public", "UPDATE t_order SET id = 1");
+        for (String each : mismatchedSQLs) {
+            String actual = preparer.addIfNotExistsForCreateTableSQL(each);
+            assertThat(actual, is(actual));
         }

Review Comment:
   `assertThat(actual, is(actual))`, it's strange, the second `acual` might be `each`.
   



-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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


[GitHub] [shardingsphere] azexcy commented on a diff in pull request #19456: Clean unused code in AbstractDataSourcePreparer and fix ci

Posted by GitBox <gi...@apache.org>.
azexcy commented on code in PR #19456:
URL: https://github.com/apache/shardingsphere/pull/19456#discussion_r927252343


##########
shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/prepare/datasource/AbstractDataSourcePreparerTest.java:
##########
@@ -39,36 +38,18 @@ public void prepareTargetTables(final PrepareTargetTablesParameter parameter) {
         }
     };
     
-    @Test
-    public void assertGetTableDefinitionSQLType() {
-        assertThat(preparer.getTableDefinitionSQLType("SET search_path = public"), is(TableDefinitionSQLType.UNKNOWN));
-        assertThat(preparer.getTableDefinitionSQLType("CREATE TABLE t1_0 (id int NOT NULL)"), is(TableDefinitionSQLType.CREATE_TABLE));
-        assertThat(preparer.getTableDefinitionSQLType("ALTER TABLE t1_0 ADD CONSTRAINT t1_0_pkey PRIMARY KEY (id)"), is(TableDefinitionSQLType.ALTER_TABLE));
-    }
-    
     @Test
     public void assertAddIfNotExistsForCreateTableSQL() {
         Collection<String> createTableSQLs = Arrays.asList("CREATE TABLE IF NOT EXISTS t (id int)", "CREATE TABLE t (id int)",
-                "CREATE  TABLE IF \nNOT \tEXISTS t (id int)", "CREATE \tTABLE t (id int)");
+                "CREATE  TABLE IF \nNOT \tEXISTS t (id int)", "CREATE \tTABLE t (id int)", "CREATE TABLE \tt_order (id bigint) WITH (orientation=row, compression=no);");
         for (String each : createTableSQLs) {
-            String sql = preparer.addIfNotExistsForCreateTableSQL(each);
-            assertTrue(PATTERN_CREATE_TABLE_IF_NOT_EXISTS.matcher(sql).find());
+            String actual = preparer.addIfNotExistsForCreateTableSQL(each);
+            assertTrue(PATTERN_CREATE_TABLE_IF_NOT_EXISTS.matcher(actual).find());
+        }
+        Collection<String> mismatchedSQLs = Arrays.asList("SET search_path = public", "UPDATE t_order SET id = 1");
+        for (String each : mismatchedSQLs) {
+            String actual = preparer.addIfNotExistsForCreateTableSQL(each);
+            assertThat(actual, is(actual));
         }

Review Comment:
   This is a mistake. I will fixed



-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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


[GitHub] [shardingsphere] sandynz merged pull request #19456: Clean unused code in AbstractDataSourcePreparer and fix ci

Posted by GitBox <gi...@apache.org>.
sandynz merged PR #19456:
URL: https://github.com/apache/shardingsphere/pull/19456


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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