You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "maple525866 (via GitHub)" <gi...@apache.org> on 2025/10/19 08:26:29 UTC

[PR] optimize: add fastjson support for serialization and deserialization of PostgreSQL array types [incubator-seata]

maple525866 opened a new pull request, #7711:
URL: https://github.com/apache/incubator-seata/pull/7711

   <!--
       Licensed to the Apache Software Foundation (ASF) under one or more
       contributor license agreements.  See the NOTICE file distributed with
       this work for additional information regarding copyright ownership.
       The ASF licenses this file to You under the Apache License, Version 2.0
       (the "License"); you may not use this file except in compliance with
       the License.  You may obtain a copy of the License at
   
       http://www.apache.org/licenses/LICENSE-2.0
       
       Unless required by applicable law or agreed to in writing, software
       distributed under the License is distributed on an "AS IS" BASIS,
       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       See the License for the specific language governing permissions and
       limitations under the License.
   -->
   <!-- Please make sure you have read and understood the contributing guidelines -->
   
   - [ ] I have read the [CONTRIBUTING.md](https://github.com/apache/incubator-seata/blob/2.x/CONTRIBUTING.md) guidelines.
   - [ ] I have registered the PR [changes](https://github.com/apache/incubator-seata/tree/2.x/changes).
   
   ### Ⅰ. Describe what this PR did
   1. Implement a custom serializer (SerialArraySerializer)
   - Use SerializeWriter to directly construct the JSON structure, use the underlying writer directly to avoid additional object creation
   - Write baseType, baseTypeName, and elements separately
   
   2. Implement a custom deserializer (SerialArrayDeserializer)
   - Parse the JSONObject and reconstruct the SerialArray
   - Remove the `@type` type information to facilitate unit testing
   - Correctly handle Integer to Long type conversions
   
   3. Register a custom handler
   - Register the custom handler with fastjson during initialization for use
   
   4. Provide a unit test to verify the correct serialization and deserialization of PostgreSQL array types
   
   ### Ⅱ. Does this pull request fix one issue?
   <!-- If that, add "fixes #xxx" below in the next line, for example, fixes #97. -->
   fixes #7670 
   
   ### Ⅲ. Why don't you add test cases (unit test/integration test)? 
   
   
   ### Ⅳ. Describe how to verify it
   mvn clean test
   
   ### Ⅴ. Special notes for reviews
   Due to historical fastjson logic, the method name `deserialize` is correct instead of `deserialize`🤣
   After this PR is completed, work on fastjson2 will continue.


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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] optimize: add fastjson support for serialization and deserialization of PostgreSQL array types [incubator-seata]

Posted by "maple525866 (via GitHub)" <gi...@apache.org>.
maple525866 commented on PR #7711:
URL: https://github.com/apache/incubator-seata/pull/7711#issuecomment-3420740115

   @funky-eyes PTAL❤️


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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] optimize: add fastjson support for serialization and deserialization of PostgreSQL array types [incubator-seata]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #7711:
URL: https://github.com/apache/incubator-seata/pull/7711#issuecomment-3419416842

   ## [Codecov](https://app.codecov.io/gh/apache/incubator-seata/pull/7711?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `69.44444%` with `22 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 61.71%. Comparing base ([`57d170d`](https://app.codecov.io/gh/apache/incubator-seata/commit/57d170db06c4c6e572f3aca3de58eaa4eef4d5c6?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`d7ab530`](https://app.codecov.io/gh/apache/incubator-seata/commit/d7ab5307f064944b5d3b75f9c0a11f3330c00098?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/incubator-seata/pull/7711?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [.../datasource/undo/parser/FastjsonUndoLogParser.java](https://app.codecov.io/gh/apache/incubator-seata/pull/7711?src=pr&el=tree&filepath=rm-datasource%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Frm%2Fdatasource%2Fundo%2Fparser%2FFastjsonUndoLogParser.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cm0tZGF0YXNvdXJjZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2VhdGEvcm0vZGF0YXNvdXJjZS91bmRvL3BhcnNlci9GYXN0anNvblVuZG9Mb2dQYXJzZXIuamF2YQ==) | 69.44% | [14 Missing and 8 partials :warning: ](https://app.codecov.io/gh/apache/incubator-seata/pull/7711?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@            Coverage Diff            @@
   ##                2.x    #7711   +/-   ##
   =========================================
     Coverage     61.70%   61.71%           
     Complexity      684      684           
   =========================================
     Files          1324     1324           
     Lines         50046    50117   +71     
     Branches       5910     5923   +13     
   =========================================
   + Hits          30882    30930   +48     
   - Misses        16376    16391   +15     
   - Partials       2788     2796    +8     
   ```
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/incubator-seata/pull/7711?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [.../datasource/undo/parser/FastjsonUndoLogParser.java](https://app.codecov.io/gh/apache/incubator-seata/pull/7711?src=pr&el=tree&filepath=rm-datasource%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Frm%2Fdatasource%2Fundo%2Fparser%2FFastjsonUndoLogParser.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cm0tZGF0YXNvdXJjZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2VhdGEvcm0vZGF0YXNvdXJjZS91bmRvL3BhcnNlci9GYXN0anNvblVuZG9Mb2dQYXJzZXIuamF2YQ==) | `71.60% <69.44%> (-18.40%)` | :arrow_down: |
   
   ... and [5 files with indirect coverage changes](https://app.codecov.io/gh/apache/incubator-seata/pull/7711/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   [![Impacted file tree graph](https://app.codecov.io/gh/apache/incubator-seata/pull/7711/graphs/tree.svg?width=650&height=150&src=pr&token=tbmHt2ZfxO&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/incubator-seata/pull/7711?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   </details>
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] optimize: add fastjson support for serialization and deserialization of PostgreSQL array types [incubator-seata]

Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes merged PR #7711:
URL: https://github.com/apache/incubator-seata/pull/7711


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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org