Skip to content

Commit

Permalink
Feature/show relation (#46)
Browse files Browse the repository at this point in the history
* ShowRelation to print out the relation expression

* docs

* split not array_sort

* missed ignoreNulls parameter - defaults to false
  • Loading branch information
GoEddie authored Dec 3, 2024
1 parent cfc248b commit b63f65a
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1257,24 +1257,24 @@ public static Column DateTrunc(string format, string timestamp)
return new Column(CreateExpression("date_trunc", false, Lit(format), Col(timestamp)));
}

public static Column First(string col)
public static Column First(string col, bool ignoreNulls = false)
{
return new Column(CreateExpression("first", false, Col(col)));
return new Column(CreateExpression("first", false, Col(col), Lit(ignoreNulls)));
}

public static Column First(Column col)
public static Column First(Column col, bool ignoreNulls = false)
{
return new Column(CreateExpression("first", false, col));
return new Column(CreateExpression("first", false, col, Lit(ignoreNulls)));
}

public static Column Last(Column col)
public static Column Last(Column col, bool ignoreNulls = false)
{
return new Column(CreateExpression("last", false, col));
return new Column(CreateExpression("last", false, col, Lit(ignoreNulls)));
}

public static Column Last(string col)
public static Column Last(string col, bool ignoreNulls = false)
{
return new Column(CreateExpression("last", false, Col(col)));
return new Column(CreateExpression("last", false, Col(col), Lit(ignoreNulls)));
}

public static Column FormatString(string format, params Column[] cols)
Expand Down Expand Up @@ -2169,7 +2169,7 @@ public static Column Split(Column str, string pattern, int? limit = null)
return new Column(CreateExpression("split", false, str, Lit(pattern), Lit(limit.Value)));
}

return new Column(CreateExpression("sort_array", false, str, Lit(pattern)));
return new Column(CreateExpression("split", false, str, Lit(pattern)));
}

public static Column Split(string str, string pattern, int? limit = null)
Expand Down

0 comments on commit b63f65a

Please sign in to comment.