Skip to content

Commit

Permalink
[INLONG-10883][SDK] Transform SQL support InitCap function
Browse files Browse the repository at this point in the history
fix bug in InitCapFunction parse
  • Loading branch information
MOONSakura0614 committed Sep 3, 2024
1 parent d24df0b commit 173aad1
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
@TransformFunction(names = {"initcap, init_cap"})
public class InitCapFunction implements ValueParser {

private final ValueParser stringParser;
private ValueParser stringParser;

public InitCapFunction(Function expr) {
List<Expression> expressions = expr.getParameters().getExpressions();
Expand All @@ -44,7 +44,8 @@ public InitCapFunction(Function expr) {

@Override
public Object parse(SourceData sourceData, int rowIndex, Context context) {
String str = OperatorTools.parseString(stringParser.parse(sourceData, rowIndex, context));
Object strObject = stringParser.parse(sourceData, rowIndex, context).toString();
String str = OperatorTools.parseString(strObject);
if (str == null) {
return null;
}
Expand Down

0 comments on commit 173aad1

Please sign in to comment.