Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functions for MySQL #948

Open
grieve54706 opened this issue Nov 26, 2024 · 1 comment
Open

Add functions for MySQL #948

grieve54706 opened this issue Nov 26, 2024 · 1 comment

Comments

@grieve54706
Copy link
Contributor

We added a test case for all functions. But don't have time to fix all. So we move out some functions that need to be revised and submit this issue to add them back.

function_type,name,return_type,param_names,param_types,description
scalar,trim,varchar,,"varchar","Removes leading and trailing spaces from a string"
scalar,ifnull,any,,"any,any","Returns the first argument if it is not NULL, otherwise returns the second argument"
scalar,case,any,,"array<boolean>,array<any>","Makes conditional statements like if-then-else"
scalar,cast,any,,"any,varchar","Converts a value from one data type to another"
scalar,md5,varchar,,"varchar","Calculates an MD5 hash value"
scalar,make_set,varchar,,"int,array<varchar>","Returns set of comma-separated strings that have corresponding bit set"
scalar,substring_index,varchar,,"varchar,varchar,int","Returns substring from string before specified number of delimiter occurs"
scalar,time_format,varchar,,"time,varchar","Formats time according to format specification"
scalar,time_to_sec,int,,"time","Converts time value to seconds"
scalar,unix_timestamp,int,,,,"Returns Unix timestamp"
scalar,date_add,datetime,,"datetime,interval","Adds time/date interval to date"
scalar,date_sub,datetime,,"datetime,interval","Subtracts time/date interval from date"
aggregate,avg,decimal,,"any","Returns the average of values in a group"
aggregate,count_distinct,int,,"any","Returns count of distinct values in group"
window,row_number,int,,,,"Returns the sequential number of a row within a partition"
window,rank,int,,,,"Returns the rank of current row within a partition, with gaps"
window,dense_rank,int,,,,"Returns the rank of current row within a partition, without gaps"
window,lag,any,,"any,int","Returns the value from a previous row in the partition"
window,lead,any,,"any,int","Returns the value from a following row in the partition"
window,first_value,any,,"any","Returns the first value in the window frame"
window,last_value,any,,"any","Returns the last value in the window frame"
window,nth_value,any,,"any,int","Returns value from the nth row of the window frame"
window,ntile,int,,"int","Divides partition into specified number of groups"
window,percent_rank,decimal,,,,"Returns relative rank of current row (rank-1)/(total rows-1)"
window,cume_dist,decimal,,,,"Returns cumulative distribution of current row"
@goldmedal
Copy link
Contributor

instr is disabled by #962

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants