You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "corgy-w (via GitHub)" <gi...@apache.org> on 2024/04/25 11:30:21 UTC

[I] Ask about batch update support [shardingsphere]

corgy-w opened a new issue, #31012:
URL: https://github.com/apache/shardingsphere/issues/31012

   Does sharding support updatebatch now
   
   ex:
   `   xml
    <update id="batchUpdateByPrimaryKeySelective" parameterType="java.util.List">
           <foreach collection="list" item="item" separator=";">
               UPDATE users SET
               tenant_id = #{item.tenantId},
               phone = #{item.phone},
               phone_cipher = #{item.phoneCipher},
               email = #{item.email},
               email_cipher = #{item.emailCipher},
               ssn = #{item.ssn},
               ssn_cipher = #{item.ssnCipher},
               is_deleted = 'N',
               creator = 'seatunnel',
               modifier = 'seatunnel',
               gmt_created = #{item.gmtCreated},
               gmt_modified = #{item.gmtModified}
               WHERE tenant_id = #{item.tenantId} AND id = #{item.id}
           </foreach>
       </update>
   `


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


Re: [I] Ask about batch update support [shardingsphere]

Posted by "corgy-w (via GitHub)" <gi...@apache.org>.
corgy-w closed issue #31012: Ask about batch update support
URL: https://github.com/apache/shardingsphere/issues/31012


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


Re: [I] Ask about batch update support [shardingsphere]

Posted by "zzyReal666 (via GitHub)" <gi...@apache.org>.
zzyReal666 commented on issue #31012:
URL: https://github.com/apache/shardingsphere/issues/31012#issuecomment-2078414863

   - I have tested SQLServe using JDBC and it supports batch processing.
   - AS for your ORM framework,you can do a simple test.
   - Here are my test results:
   ![image](https://github.com/apache/shardingsphere/assets/34822229/fb0b5498-ae7a-4749-b574-72de2bd17878)
   <img width="1261" alt="image" src="https://github.com/apache/shardingsphere/assets/34822229/f5c036d8-03a5-449c-bf90-113c825cc35c">
   


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


Re: [I] Ask about batch update support [shardingsphere]

Posted by "zzyReal666 (via GitHub)" <gi...@apache.org>.
zzyReal666 commented on issue #31012:
URL: https://github.com/apache/shardingsphere/issues/31012#issuecomment-2081265361

   - Multiple SQL statements are not supported.
   - Please use JDBC batch.
   
   


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


Re: [I] Ask about batch update support [shardingsphere]

Posted by "corgy-w (via GitHub)" <gi...@apache.org>.
corgy-w commented on issue #31012:
URL: https://github.com/apache/shardingsphere/issues/31012#issuecomment-2078518381

   > * I have tested SQLServe using JDBC and it supports batch processing.
   > * AS for your ORM framework,you can do a simple test.
   
   ``` sql
   UPDATE users SET
               tenant_id = ?,
               phone = ?,
               phone_cipher = ?,
               email = ?,
               email_cipher = ?,
               ssn = ?,
               ssn_cipher = ?,
               is_deleted = 'N',
               creator = 'seatunnel',
               modifier = 'seatunnel',
               gmt_created = ?,
               gmt_modified = ?
               WHERE tenant_id = ? AND id = ?; 
               UPDATE users SET
               tenant_id = ?,
               phone = ?,
               phone_cipher = ?,
               email = ?,
               email_cipher = ?,
               ssn = ?,
               ssn_cipher = ?,
               is_deleted = 'N',
               creator = 'seatunnel',
               modifier = 'seatunnel',
               gmt_created = ?,
               gmt_modified = ?
               WHERE tenant_id = ? AND id = ? 
   ```
   I have tested update batch and it not support . shariding version :5.2.1.
   Example statement above
   
   Error as follows
   ![image](https://github.com/apache/shardingsphere/assets/73771213/0ffcc74c-11ce-47cb-9f45-42307db7dfb3)
   
   


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


Re: [I] Ask about batch update support [shardingsphere]

Posted by "zzyReal666 (via GitHub)" <gi...@apache.org>.
zzyReal666 commented on issue #31012:
URL: https://github.com/apache/shardingsphere/issues/31012#issuecomment-2078544102

   > > * I have tested SQLServe using JDBC and it supports batch processing.
   > > * AS for your ORM framework,you can do a simple test.
   > 
   > ```sql
   > UPDATE users SET
   >             tenant_id = ?,
   >             phone = ?,
   >             phone_cipher = ?,
   >             email = ?,
   >             email_cipher = ?,
   >             ssn = ?,
   >             ssn_cipher = ?,
   >             is_deleted = 'N',
   >             creator = 'seatunnel',
   >             modifier = 'seatunnel',
   >             gmt_created = ?,
   >             gmt_modified = ?
   >             WHERE tenant_id = ? AND id = ?; 
   >             UPDATE users SET
   >             tenant_id = ?,
   >             phone = ?,
   >             phone_cipher = ?,
   >             email = ?,
   >             email_cipher = ?,
   >             ssn = ?,
   >             ssn_cipher = ?,
   >             is_deleted = 'N',
   >             creator = 'seatunnel',
   >             modifier = 'seatunnel',
   >             gmt_created = ?,
   >             gmt_modified = ?
   >             WHERE tenant_id = ? AND id = ? 
   > ```
   > 
   > I have tested update batch and it not support . shariding version :5.2.1. Example statement above
   > 
   > Error as follows ![image](https://private-user-images.githubusercontent.com/73771213/325829368-0ffcc74c-11ce-47cb-9f45-42307db7dfb3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTQwOTk2ODgsIm5iZiI6MTcxNDA5OTM4OCwicGF0aCI6Ii83Mzc3MTIxMy8zMjU4MjkzNjgtMGZmY2M3NGMtMTFjZS00N2NiLTlmNDUtNDIzMDdkYjdkZmIzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA0MjYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNDI2VDAyNDMwOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTZiYzM4Yjc3MWMzYmQ2NWQyN2UwNmIyODMyYjQ2NDdmZGE0Mzg2YjJkNWQyNDk5OTY5ODA0MWFiMDc3YzllMzgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.iHPCA2SAAc5_K2pyb0p7YduMDlbrwSrn_naB79sMHMQ)
   
   - Based on the current logs, the problem is with the sql format rather than the batch support;
   - Please provide detailed logs, especially for logical and actual SQL;
   - There are my test reults,use version master:
   ![image](https://github.com/apache/shardingsphere/assets/34822229/4889eafd-2873-40cd-b4f8-a467c8701d38)
   ![image](https://github.com/apache/shardingsphere/assets/34822229/c111d0f0-188c-4878-b2e6-886919340806)
   


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