mixql / mixql-core

combinator for lot of sql langs
Apache License 2.0
3 stars 3 forks source link

Add support to string functions #8

Open wiikviz opened 2 years ago

wiikviz commented 2 years ago

https://sparkbyexamples.com/spark/usage-of-spark-sql-string-functions/

wiikviz commented 2 years ago

Arguments expr: An expression that evaluates to a numeric. scale: An INTEGER expression greater or equal to 0. fmt: A STRING expression specifying a format.

SELECT format_number(12332.123456, 4); 12,332.1235 SELECT format_number(12332.123456, '#.###'); 12332.123 SELECT format_number(12332.123456, 'EUR ,###.-'); EUR 12,332.- https://learn.microsoft.com/en-us/azure/databricks/spark/latest/spark-sql/language-manual/functions/format_number

mihan1235 commented 1 year ago

Were added new functions

  1. startsWith(string,string) --> bool
  2. endsWith(string, string) --> bool
  3. isEmpty(string) --> bool
  4. nonEmpty(string) --> bool
  5. findFirstIn(string, regex) --> null || string
  6. findAllIn(string,regex) --> array of strings
  7. replaceAllIn(string, regex, string) --> string
  8. replaceFirstIn(string, regex, string) --> string
  9. split(string, regex) --> array of strings
  10. toLowerCase(string) --> string
  11. toUpperCase(string) --> string
  12. trim(string) --> string