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:

<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

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


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