Skip to content

Commit

Permalink
Fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
xinlifoobar committed Aug 11, 2024
1 parent 8a3083c commit 72c40dd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion datafusion/functions/src/string/initcap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,9 @@ fn initcap_utf8view(args: &[ArrayRef]) -> Result<ArrayRef> {
}

fn initcap_string(string: Option<&str>) -> Option<String> {
let mut char_vector = Vec::<char>::new();
string.map(|string: &str| {
let mut char_vector = Vec::<char>::new();
char_vector.clear();
let mut previous_character_letter_or_number = false;
for c in string.chars() {
if previous_character_letter_or_number {
Expand Down
18 changes: 9 additions & 9 deletions datafusion/sqllogictest/test_files/string_view.slt
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,15 @@ logical_plan

### Initcap

query TT
EXPLAIN SELECT
INITCAP(column1_utf8view) as c
FROM test;
----
logical_plan
01)Projection: initcap(test.column1_utf8view) AS c
02)--TableScan: test projection=[column1_utf8view]

# Create a table with lowercase strings
statement ok
CREATE TABLE test_lowercase AS SELECT
Expand Down Expand Up @@ -621,15 +630,6 @@ logical_plan
02)--Projection: CAST(test.column2_utf8view AS Utf8) AS __common_expr_1, test.column1_utf8view
03)----TableScan: test projection=[column1_utf8view, column2_utf8view]

query TT
EXPLAIN SELECT
INITCAP(column1_utf8view) as c
FROM test;
----
logical_plan
01)Projection: initcap(test.column1_utf8view) AS c
02)--TableScan: test projection=[column1_utf8view]

## Ensure no casts for LEVENSHTEIN
## TODO https://github.com/apache/datafusion/issues/11854
query TT
Expand Down

0 comments on commit 72c40dd

Please sign in to comment.