-
Notifications
You must be signed in to change notification settings - Fork 590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(types): doc & refine ToBinary/Text #17697
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
@@ -149,7 +149,7 @@ mod tests { | |||
use mysql_async::Row as MySqlRow; | |||
use risingwave_common::catalog::{Field, Schema}; | |||
use risingwave_common::row::Row; | |||
use risingwave_common::types::{DataType, ToText}; | |||
use risingwave_common::types::DataType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change was made during browsing all references of ToText
. Don't think it's worth exposing it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks!
@@ -30,14 +33,15 @@ pub enum ToBinaryError { | |||
|
|||
pub type Result<T> = std::result::Result<T, ToBinaryError>; | |||
|
|||
// Used to convert ScalarRef to text format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦
src/common/src/types/to_text.rs
Outdated
@@ -18,7 +18,14 @@ use std::num::FpCategory; | |||
use super::{DataType, DatumRef, ScalarRefImpl}; | |||
use crate::dispatch_scalar_ref_variants; | |||
|
|||
// Used to convert ScalarRef to text format | |||
/// Converts `ScalarRef` to text format. | |||
/// This is the implementation for casting to varchar, and pgwire "TEXT" format. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the implementation for casting to varchar
This is not true for a few cases. The TEXT format for boolean is t
/ f
while they cast to varchar true
/ false
.
https://github.com/postgres/postgres/blob/REL_16_3/src/include/catalog/pg_cast.dat#L438-L439
a31225a
to
45df1da
Compare
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.