You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "ccxxxyy (via GitHub)" <gi...@apache.org> on 2025/12/18 13:44:17 UTC

[PR] Support for the SHOW TRANSACTION statement and the L2_DISTANCE function [shardingsphere]

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

   for https://github.com/apache/shardingsphere/issues/31505
   
   Changes proposed in this pull request:
     -
   
   ---
   
   Before committing this PR, I'm sure that I have checked the following options:
   - [x] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
   - [x] I have self-reviewed the commit code.
   - [ ] I have (or in comment I request) added corresponding labels for the pull request.
   - [x] I have passed maven check locally : `./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`.
   - [ ] I have made corresponding changes to the documentation.
   - [ ] I have added corresponding unit tests for my changes.
   - [ ] I have updated the Release Notes of the current development version. For more details, see [Update Release Note](https://shardingsphere.apache.org/community/en/involved/contribute/contributor/)
   


-- 
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: [PR] Support for the SHOW TRANSACTION statement and the L2_DISTANCE function [shardingsphere]

Posted by "ccxxxyy (via GitHub)" <gi...@apache.org>.
ccxxxyy commented on PR #37429:
URL: https://github.com/apache/shardingsphere/pull/37429#issuecomment-3677341650

   @terrymanu Hi, I have made the modifications as required. Hope you can review them when you have a moment. 
   Regarding the third point of the modification suggestion, I hope you can take a look at my thoughts: Based on the official Doris [documentation](https://doris.apache.org/zh-CN/docs/4.x/sql-manual/sql-statements/transaction/SHOW-TRANSACTION) , the concern about "array literal → ListExpression" is mainly theoretical. The WHERE clause of SHOW TRANSACTION only supports simple equality comparisons, and the right side of the WHERE clause is just a simple literal (LiteralExpressionSegment). According to the Doris official [documentation ](https://doris.apache.org/zh-CN/docs/4.x/sql-manual/sql-statements/transaction/SHOW-TRANSACTION)and our implementation: The WHERE clause must use the form of id = <value> or label = <value>; it does not support complex expressions such as IN, ANY, or array literals; the parser correctly parses the WHERE clause as a simple binary comparison. Existing tests have fully verified the behavior of SHOW TRANSACTION: 
   -- ✅ Supported syntax (binary equality comparison) 
   SHOW TRANSACTION WHERE id = 4005
   SHOW TRANSACTION WHERE label = 'test_label'
   SHOW TRANSACTION FROM db WHERE id = 4005
   -- ❌ Unsupported syntax
   SHOW TRANSACTION WHERE id IN (4005, 4006, 4007)  -- IN clause not supported
   SHOW TRANSACTION WHERE id = ANY [4005, 4006]     -- Arrays not supported
   SHOW TRANSACTION WHERE (id, label) = (4005, 'x') -- Tuple comparison not supported


-- 
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: [PR] Support for the SHOW TRANSACTION statement and the L2_DISTANCE function [shardingsphere]

Posted by "ccxxxyy (via GitHub)" <gi...@apache.org>.
ccxxxyy commented on PR #37429:
URL: https://github.com/apache/shardingsphere/pull/37429#issuecomment-3678435443

   @terrymanu Hi, I hope my revision can meet the requirements. Hope you can review them when you have time.


-- 
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: [PR] Support for the SHOW TRANSACTION statement and the L2_DISTANCE function [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu commented on PR #37429:
URL: https://github.com/apache/shardingsphere/pull/37429#issuecomment-3677916926

   Here’s a consolidated note to help land the next revision:
   
     - The implementation still stops at “parse succeeds / returns empty set”; it doesn’t address the core need of returning real SHOW TRANSACTION data—executor ignores FROM/WHERE and isn’t wired to any transaction/load-job source.
     - The returned columns don’t match the Doris protocol (missing Coordinator, LoadJobSourceType, PrepareTime/CommitTime, etc.), so clients may break.
     - Tests only cover empty data and metadata shape; they don’t cover real data, filter hit/miss, or column name/type assertions—so the bugs stay hidden.
   
     Next steps:
   
     1. Wire to real data (or explicitly raise “not supported” instead of a silent empty set) and honor FROM/WHERE filters.
     2. Align column definitions (order and types) with Doris SHOW TRANSACTION.
     3. Add tests for a data row, ID/label filter hit/miss, and column name/type assertions.


-- 
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: [PR] Support for the SHOW TRANSACTION statement and the L2_DISTANCE function [shardingsphere]

Posted by "ccxxxyy (via GitHub)" <gi...@apache.org>.
ccxxxyy commented on PR #37429:
URL: https://github.com/apache/shardingsphere/pull/37429#issuecomment-3681098520

   @terrymanu Hi! I hope my revisions can meet the requirements. Thank you for your patient guidance. Hope you could take a look when you have a moment


-- 
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: [PR] Support for the SHOW TRANSACTION statement and the L2_DISTANCE function [shardingsphere]

Posted by "ccxxxyy (via GitHub)" <gi...@apache.org>.
ccxxxyy commented on PR #37429:
URL: https://github.com/apache/shardingsphere/pull/37429#issuecomment-3674126973

   @terrymanu Hi, I have made the revisions as required. Hope you can review them when you have time.


-- 
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: [PR] Support for the SHOW TRANSACTION statement and the L2_DISTANCE function [shardingsphere]

Posted by "ccxxxyy (via GitHub)" <gi...@apache.org>.
ccxxxyy commented on PR #37429:
URL: https://github.com/apache/shardingsphere/pull/37429#issuecomment-3678647815

   @terrymanu Hi, Thank you very much for your patient guidance. Upon thorough analysis and deliberation, I have implemented further revisions with the aim of providing a correct solution. I sincerely appreciate your comments and corrections and have made every effort to ensure the modifications comply with the requirements. Should any issues persist, I kindly request your understanding and further instructions. I would like to express my gratitude once again for your feedback and support.  
   Regarding the specification of "Column=Literal only," I consider this to be a potentially reasonable design. The syntax structure provided in the official [documentation](https://doris.apache.org/zh-CN/docs/4.x/sql-manual/sql-statements/transaction/SHOW-TRANSACTION) is:  `WHERE  [id = <transaction_id> | label = <label_name>];`


-- 
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: [PR] Support for the SHOW TRANSACTION statement and the L2_DISTANCE function [shardingsphere]

Posted by "ccxxxyy (via GitHub)" <gi...@apache.org>.
ccxxxyy commented on PR #37429:
URL: https://github.com/apache/shardingsphere/pull/37429#issuecomment-3685796293

   @terrymanu Hi! Hope you can take a look at my latest commit when you have time. Thank you for your time. I hope the latest revision meets the requirements.


-- 
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: [PR] Support for the SHOW TRANSACTION statement and the L2_DISTANCE function [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu commented on PR #37429:
URL: https://github.com/apache/shardingsphere/pull/37429#issuecomment-3680560162

   Documentation does require Column=Literal (id/label), which is reasonable, but the implementation still lacks data retrieval and strict semantic validation, so that alone doesn’t complete the fix.


-- 
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: [PR] Support for the SHOW TRANSACTION statement and the L2_DISTANCE function [shardingsphere]

Posted by "ccxxxyy (via GitHub)" <gi...@apache.org>.
ccxxxyy commented on PR #37429:
URL: https://github.com/apache/shardingsphere/pull/37429#issuecomment-3688645619

   Your guidance is very meaningful. I think I need some time at present to carefully consider the design of the solution for this part instead of starting to code immediately. When I'm confident, I'll raise a pull request again. Thank you once more for your reply.


-- 
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: [PR] Support for the SHOW TRANSACTION statement and the L2_DISTANCE function [shardingsphere]

Posted by "ccxxxyy (via GitHub)" <gi...@apache.org>.
ccxxxyy closed pull request #37429: Support for the SHOW TRANSACTION statement and the L2_DISTANCE function
URL: https://github.com/apache/shardingsphere/pull/37429


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