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/12/09 06:08:31 UTC

[GitHub] [shardingsphere] bobbyz007 opened a new issue, #22762: how to config shadow to support batch insert.

bobbyz007 opened a new issue, #22762:
URL: https://github.com/apache/shardingsphere/issues/22762

   I configured shadow algorithm according to the example:
   ```
   spring.shardingsphere.rules.shadow.shadow-algorithms.user-id-insert-match-algorithm.type=VALUE_MATCH
   spring.shardingsphere.rules.shadow.shadow-algorithms.user-id-insert-match-algorithm.props.operation=insert
   spring.shardingsphere.rules.shadow.shadow-algorithms.user-id-insert-match-algorithm.props.column=user_type
   spring.shardingsphere.rules.shadow.shadow-algorithms.user-id-insert-match-algorithm.props.value=1
   ```
   but it does not have any effect on batch insert clause like:
   ```sql
   insert into t_user (user_id, user_type, username, pwd)
       values
       <foreach collection="list" item="item" index="index" separator=",">
         (#{item.userId,jdbcType=INTEGER}, #{item.userType,jdbcType=INTEGER}, #{item.userName,jdbcType=VARCHAR},
         #{item.pwd,jdbcType=VARCHAR})
       </foreach>
   ```
   so does the shadow feature not support batch insert originally or am i missing something.


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

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


[GitHub] [shardingsphere] sandynz commented on issue #22762: how to config shadow to support batch insert.

Posted by GitBox <gi...@apache.org>.
sandynz commented on issue #22762:
URL: https://github.com/apache/shardingsphere/issues/22762#issuecomment-1345234129

   Hi @bobbyz007 , which version are you running? Suggest to submit issue with template.
   
   I had a check at https://shardingsphere.apache.org/document/5.2.1/cn/features/shadow/limitations/ , looks `INSERT INTO table (column,…) VALUES (value,…),(value,…),…` is supported.
   
   Another way is to try hint mode.
   


-- 
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] bobbyz007 commented on issue #22762: how to config shadow to support batch insert.

Posted by GitBox <gi...@apache.org>.
bobbyz007 commented on issue #22762:
URL: https://github.com/apache/shardingsphere/issues/22762#issuecomment-1369477692

   @sandynz the shardingsphere version is 5.2.1, the mybatis and druid version refer as follows:
   ```
   <properties>
           <java.version>11</java.version>
           <mybatis-spring-boot>2.3.0</mybatis-spring-boot>
           <druid>1.2.15</druid>
           <snakeyaml>1.33</snakeyaml>
           <shardingsphere>5.2.1</shardingsphere>
   
           <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
           <skipTests>true</skipTests>
       </properties>
   ```


-- 
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] bobbyz007 commented on issue #22762: how to config shadow to support batch insert.

Posted by GitBox <gi...@apache.org>.
bobbyz007 commented on issue #22762:
URL: https://github.com/apache/shardingsphere/issues/22762#issuecomment-1369486711

   @sandynz Please see my demo project: [shadow-value-match-sample](https://github.com/bobbyz007/shardingsphere-samples/tree/main/shadow-value-match)


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