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 2021/06/16 00:54:41 UTC

[GitHub] [shardingsphere] strongduanmu commented on a change in pull request #10816: support postgresql create index without index name

strongduanmu commented on a change in pull request #10816:
URL: https://github.com/apache/shardingsphere/pull/10816#discussion_r652270016



##########
File path: shardingsphere-infra/shardingsphere-infra-binder/src/main/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateIndexStatementContext.java
##########
@@ -49,6 +56,10 @@ public CreateIndexStatementContext(final CreateIndexStatement sqlStatement) {
     
     @Override
     public Collection<IndexSegment> getIndexes() {
-        return null == getSqlStatement().getIndex() ? Collections.emptyList() : Collections.singletonList(getSqlStatement().getIndex());
+        Optional<Integer> startIndex = CreateIndexStatementHandler.getGeneratedIndexStartIndex(getSqlStatement());
+        String generatedLogicIndexName = IndexMetaDataUtil.getGeneratedLogicIndexName(getSqlStatement().getColumns());
+        Collection<IndexSegment> generatedIndexSegments = startIndex.map(index -> Collections.singletonList(new IndexSegment(index, index, 

Review comment:
       > if (null != getSqlStatement().getIndex()) {
   > return
   > }
   > Collection generatedIndexSegments =xxx;
   > return?
   
   @tristaZero Thanks for your suggestion, I have optimized 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