We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a3760c2 commit 914ed06Copy full SHA for 914ed06
crates/df-builtins/src/rtrimmed_length.rs
@@ -57,7 +57,7 @@ impl ScalarUDFImpl for RTrimmedLengthFunc {
57
58
let new_array = strs
59
.iter()
60
- .map(|array_elem| array_elem.map(|value| value.trim_end().len() as u64))
+ .map(|array_elem| array_elem.map(|value| value.trim_end_matches(' ').len() as u64))
61
.collect::<UInt64Array>();
62
63
Ok(ColumnarValue::Array(Arc::new(new_array)))
@@ -89,6 +89,8 @@ mod tests {
89
(' '),
90
(''),
91
('ABC'),
92
+ (E'ABCDEFGH \t'),
93
+ (E'ABCDEFGH \n'),
94
(NULL);
95
";
96
ctx.sql(insert).await?.collect().await?;
@@ -107,6 +109,8 @@ mod tests {
107
109
"| 0 |",
108
110
111
"| 3 |",
112
+ "| 11 |",
113
114
"| |",
115
"+---------------------------------+",
116
],
0 commit comments