Skip to content

Commit

Permalink
feat(Rust): add meta string encoding algorithm in Rust (#1712)
Browse files Browse the repository at this point in the history
## What does this PR do?
Implementing meta string encoding algorithm in Rust and has passed all
13 tests. The code is in `rust/fury/src/meta/*` and
`rust/tests/tests/test_meta.rs`

![Snipaste_2024-06-29_17-07-41](https://github.com/pandalee99/fury/assets/61675635/e00dce79-5763-4bdd-9a23-5f190199ed5c)
I am not familiar with Rust, I implemented this feature by referring to
the Java implementation and utilizing TONGYI Lingma. Therefore, there
might be some problems.

Please don't review it immediately. As this version is essentially the
same as the Java version, I have a question for `But note that the meta
string encoding algorithm is used for encode field name only, so the
special charater can't be . or $, thus the implementation will be
simpler`. Does this imply I should remove the checks in the Rust version
for whether a character is equal to `.` or `$`? In that case, I also
need to modify the test cases.


## Related issues

[#1544](#1544)


## Does this PR introduce any user-facing change?

- [ ] Does this PR introduce any public API change?
- [ ] Does this PR introduce any binary protocol compatibility change?


## 本改动借助了通义灵码进行辅助编程

![image](https://github.com/pandalee99/fury/assets/61675635/7fb84046-80b5-4c44-b1d1-4bc7665224b1)
  • Loading branch information
urlyy authored Jul 17, 2024
1 parent a5fc142 commit 219cdc7
Show file tree
Hide file tree
Showing 4 changed files with 699 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rust/fury/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@
mod buffer;
mod deserializer;
mod error;
mod meta;
mod row;
mod serializer;
mod types;

pub use deserializer::from_buffer;
pub use error::Error;
pub use fury_derive::*;
pub use meta::{Encoding, MetaStringDecoder, MetaStringEncoder};
pub use row::{from_row, to_row};
pub use serializer::to_buffer;

Expand Down
Loading

0 comments on commit 219cdc7

Please sign in to comment.