Skip to content

Commit

Permalink
handle non-alpha prefix variable name in parquet
Browse files Browse the repository at this point in the history
  • Loading branch information
xitongsys committed Apr 24, 2020
1 parent 9e62192 commit a7314a1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,13 @@ func HeadToUpper(str string) string {
if ln <= 0 {
return str
}
return strings.ToUpper(str[0:1]) + str[1:]

c := str[0]
if (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') {
return strings.ToUpper(str[0:1]) + str[1:]
}
//handle non-alpha prefix such as "_"
return "P_" + str
}

//Get the number of bits needed by the num; 0 needs 0, 1 need 1, 2 need 2, 3 need 2 ....
Expand Down

0 comments on commit a7314a1

Please sign in to comment.