Skip to content

Commit

Permalink
[INLONG-10942][SDK] Add official function names for all Transform fun…
Browse files Browse the repository at this point in the history
…ctions (apache#10943)
  • Loading branch information
Zkplo authored Sep 2, 2024
1 parent 5c44cde commit 4de972e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,23 @@ public WeekExtractFunction(Function expr) {
}
}

@TransformFunction(names = {"day_of_year"})
@TransformFunction(names = {"day_of_year", "dayofyear"})
public static class DayOfYearExtractFunction extends DateExtractFunction {

public DayOfYearExtractFunction(Function expr) {
super(DateExtractFunctionType.DAY_OF_YEAR, expr);
}
}

@TransformFunction(names = {"day_of_month"})
@TransformFunction(names = {"day_of_month", "dayofmonth"})
public static class DayOfMonthExtractFunction extends DateExtractFunction {

public DayOfMonthExtractFunction(Function expr) {
super(DateExtractFunctionType.DAY_OF_MONTH, expr);
}
}

@TransformFunction(names = {"day_of_week"})
@TransformFunction(names = {"day_of_week", "dayofweek"})
public static class DayOfWeekExtractFunction extends DateExtractFunction {

public DayOfWeekExtractFunction(Function expr) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* format(default is ‘yyyy-MM-dd HH:mm:ss’). numeric is an internal timestamp value representing seconds
* since ‘1970-01-01 00:00:00’ UTC, such as produced by the UNIX_TIMESTAMP() function.
*/
@TransformFunction(names = {"from_unix_time"})
@TransformFunction(names = {"from_unix_time", "form_unixtime"})
public class FromUnixTimeFunction implements ValueParser {

private ValueParser numericParser;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* description: substring(string FROM INT1 [ FOR INT2 ])--returns a substring of STRING starting from position INT1 with
* length INT2 (to the end by default)
*/
@TransformFunction(names = {"substring"})
@TransformFunction(names = {"substring", "substr"})
public class SubstringFunction implements ValueParser {

private ValueParser stringParser;
Expand All @@ -41,6 +41,7 @@ public class SubstringFunction implements ValueParser {

/**
* Constructor
*
* @param expr
*/
public SubstringFunction(Function expr) {
Expand All @@ -55,6 +56,7 @@ public SubstringFunction(Function expr) {

/**
* parse
*
* @param sourceData
* @param rowIndex
* @return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* The unit of the time interval is specified by the unit parameter, which should be one of the following values:
* FRAC_SECOND, SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER, or YEAR.
*/
@TransformFunction(names = {"timestamp_add"})
@TransformFunction(names = {"timestamp_add", "timestampadd"})
public class TimestampAddFunction implements ValueParser {

private ValueParser intervalParser;
Expand Down

0 comments on commit 4de972e

Please sign in to comment.