Packages

  • package root

    Snowpark by itself is a powerful library, but still some utility functions can always help.

    Snowpark by itself is a powerful library, but still some utility functions can always help.

    snowpark-extensions

    Snowpark by itself is a powerful library, but still some utility functions can always help.

    The source code for this library is available here

    Installation

    With Maven you can add something like this to your POM:

    <dependency>
        <groupId>net.mobilize.snowpark-extensions</groupId>
        <artifactId>snowparkextensions</artifactId>
        <version>0.0.9</version>
    </dependency>
    

    or with sbt use

    libraryDependencies += "net.mobilize.snowpark-extensions" % "snowparkextensions" % "0.0.16"
    

    Usage

    just import it at the top of your file and it will automatically extend your snowpark package.

    For example:

    
    
    
    import com.snowflake.snowpark_extensions.Extensions._
    import com.snowflake.snowpark.Session
    
    val new_session = Session.builder.from_snowsql().appName("app1").create()
    

    Extensions

    See Session Extensions
    See Session Builder Extensions
    See DataFrame Extensions
    See Column Extensions
    See Function Extensions

    Definition Classes
    root
  • package com
    Definition Classes
    root
  • package snowflake
    Definition Classes
    com
  • package snowpark_extensions
    Definition Classes
    snowflake
  • package helpers
    Definition Classes
    snowpark_extensions
  • BuiltinOverrides
  • ColumnsSimplifier

object BuiltinOverrides

Object that contains override for Snowflake built-in functions that do not have the same behavior as Spark.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BuiltinOverrides
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def acos(columnName: String): Column

    Wrapper for Snowflake built-in acos function.

    Wrapper for Snowflake built-in acos function. Inverse cosine of e in radians.

    columnName

    Column name.

    returns

    Column object.

  5. def acos(e: Column): Column

    Wrapper for Snowflake built-in acos function.

    Wrapper for Snowflake built-in acos function. Inverse cosine of e in radians.

    e

    Column.

    returns

    Column object.

  6. def approx_count_distinct(columnName: String): Column

    Wrapper for Snowflake built-in approx_count_distinct function.

    Wrapper for Snowflake built-in approx_count_distinct function. Returns the approximate number of distinct items in a group.

    columnName

    Column name to get the count.

    returns

    Column object.

  7. def approx_count_distinct(c: Column): Column

    Wrapper for Snowflake built-in approx_count_distinct function.

    Wrapper for Snowflake built-in approx_count_distinct function. Returns the approximate number of distinct items in a group.

    c

    Column to get the count.

    returns

    Column object.

  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def atan2(yValue: Double, xName: String): Column

    Wrapper for Snowflake built-in atan2 function.

    Wrapper for Snowflake built-in atan2 function. Returns the theta component of the point (r, theta) in polar coordinates that corresponds to the point.

    yValue

    coordinate on y-axis.

    xName

    coordinate on x-axis

    returns

    Column object.

  10. def atan2(yValue: Double, x: Column): Column

    Wrapper for Snowflake built-in atan2 function.

    Wrapper for Snowflake built-in atan2 function. Returns the theta component of the point (r, theta) in polar coordinates that corresponds to the point.

    yValue

    coordinate on y-axis.

    x

    coordinate on x-axis

    returns

    Column object.

  11. def atan2(yName: String, xValue: Double): Column

    Wrapper for Snowflake built-in atan2 function.

    Wrapper for Snowflake built-in atan2 function. Returns the theta component of the point (r, theta) in polar coordinates that corresponds to the point.

    yName

    coordinate on y-axis.

    xValue

    coordinate on x-axis

    returns

    Column object.

  12. def atan2(y: Column, xValue: Double): Column

    Wrapper for Snowflake built-in atan2 function.

    Wrapper for Snowflake built-in atan2 function. Returns the theta component of the point (r, theta) in polar coordinates that corresponds to the point.

    y

    coordinate on y-axis.

    xValue

    coordinate on x-axis

    returns

    Column object.

  13. def atan2(yName: String, xName: String): Column

    Wrapper for Snowflake built-in atan2 function.

    Wrapper for Snowflake built-in atan2 function. Returns the theta component of the point (r, theta) in polar coordinates that corresponds to the point.

    yName

    coordinate on y-axis.

    xName

    coordinate on x-axis

    returns

    Column object.

  14. def atan2(y: Column, xName: String): Column

    Wrapper for Snowflake built-in atan2 function.

    Wrapper for Snowflake built-in atan2 function. Returns the theta component of the point (r, theta) in polar coordinates that corresponds to the point.

    y

    coordinate on y-axis.

    xName

    coordinate on x-axis

    returns

    Column object.

  15. def atan2(yName: String, x: Column): Column

    Wrapper for Snowflake built-in atan2 function.

    Wrapper for Snowflake built-in atan2 function. Returns the theta component of the point (r, theta) in polar coordinates that corresponds to the point.

    yName

    coordinate on y-axis.

    x

    coordinate on x-axis

    returns

    Column object.

  16. def atan2(y: Column, x: Column): Column

    Wrapper for Snowflake built-in atan2 function.

    Wrapper for Snowflake built-in atan2 function. Returns the theta component of the point (r, theta) in polar coordinates that corresponds to the point.

    y

    coordinate on y-axis.

    x

    coordinate on x-axis

    returns

    Column object.

  17. def avg(s: String): Column

    Wrapper for Snowflake built-in avg function.

    Wrapper for Snowflake built-in avg function. Returns the average of the values in a group.

    s

    Column name to get the average.

    returns

    Column object.

  18. def avg(c: Column): Column

    Wrapper for Snowflake built-in avg function.

    Wrapper for Snowflake built-in avg function. Returns the average of the values in a group.

    c

    Column to get the average.

    returns

    Column object.

  19. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  20. def concat(cols: Column*): Column

    Concatenates columns from the parameters.

    Concatenates columns from the parameters.

    cols

    sequence of column objects to concatenate.

    returns

    new column with concatenated values.

  21. def concat_ws(separator: Column, cols: Column*): Column

    Concatenates columns from the parameters using the specified character as a separator.

    Concatenates columns from the parameters using the specified character as a separator.

    separator

    column with which the column's values will be separated.

    cols

    sequence of column objects to concatenate.

    returns

    new column with concatenated values separated by the specified separator.

  22. def concat_ws(separator: String, cols: Column*): Column

    Concatenates columns from the parameters using the specified character as a separator.

    Concatenates columns from the parameters using the specified character as a separator.

    separator

    value with which the column's values will be separated.

    cols

    sequence of column objects to concatenate.

    returns

    new column with concatenated values separated by the specified separator.

  23. def degrees(columnName: String): Column

    Wrapper for Snowflake built-in degrees function.

    Wrapper for Snowflake built-in degrees function. Converts an angle measured in radians to an approximately equivalent angle measured in degrees.

    columnName

    Column name for convert to degrees.

    returns

    Column object.

  24. def degrees(c: Column): Column

    Wrapper for Snowflake built-in degrees function.

    Wrapper for Snowflake built-in degrees function. Converts an angle measured in radians to an approximately equivalent angle measured in degrees.

    c

    Column for convert to degrees.

    returns

    Column object.

  25. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  26. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  27. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  28. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  29. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  30. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  31. def lag(c: Column, offset: Int, defaultValue: Any): Column

    Wrapper for Snowflake built-in lag function.

    Wrapper for Snowflake built-in lag function. Returns the value that is offset rows before the current row.

    c

    Column to calculate offset.

    offset

    Column offset.

    defaultValue

    If there is less than offset rows before the current row.

    returns

    Column object.

  32. def lag(columnName: String, offset: Int, defaultValue: Any): Column

    Wrapper for Snowflake built-in lag function.

    Wrapper for Snowflake built-in lag function. Returns the value that is offset rows before the current row.

    columnName

    Column name.

    offset

    Column offset.

    defaultValue

    If there is less than offset rows before the current row.

    returns

    Column object.

  33. def lag(columnName: String, offset: Int): Column

    Wrapper for Snowflake built-in lag function.

    Wrapper for Snowflake built-in lag function. Returns the value that is offset rows before the current row.

    columnName

    Column name.

    offset

    Column offset.

    returns

    Column object.

  34. def lag(c: Column, offset: Int): Column

    Wrapper for Snowflake built-in lag function.

    Wrapper for Snowflake built-in lag function. Returns the value that is offset rows before the current row.

    c

    Column to calculate offset.

    offset

    Column offset.

    returns

    Column object.

  35. def lead(c: Column, offset: Int, defaultValue: Any): Column

    Wrapper for Snowflake built-in lead function.

    Wrapper for Snowflake built-in lead function. Returns the value that is offset rows after the current row.

    c

    Column to calculate offset.

    offset

    Column offset.

    defaultValue

    If there is less than offset rows after the current row.

    returns

    Column object.

  36. def lead(columnName: String, offset: Int, defaultValue: Any): Column

    Wrapper for Snowflake built-in lead function.

    Wrapper for Snowflake built-in lead function. Returns the value that is offset rows after the current row.

    columnName

    Column name.

    offset

    Column offset.

    defaultValue

    If there is less than offset rows after the current row.

    returns

    Column object.

  37. def lead(c: Column, offset: Int): Column

    Wrapper for Snowflake built-in lead function.

    Wrapper for Snowflake built-in lead function. Returns the value that is offset rows after the current row.

    c

    Column to calculate the offset.

    offset

    Column offset.

    returns

    Column object.

  38. def lead(columnName: String, offset: Int): Column

    Wrapper for Snowflake built-in lead function.

    Wrapper for Snowflake built-in lead function. Returns the value that is offset rows after the current row.

    columnName

    Column name.

    offset

    Column offset.

    returns

    Column object.

  39. def ltrim(column: Column): Column

    This is an overload of the trim method that uses the empty space as a replacement for the white spaces at the left string of characters.

    This is an overload of the trim method that uses the empty space as a replacement for the white spaces at the left string of characters.

    column

    Column for trimming the spaces from left.

    returns

    Column object.

  40. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  41. def next_day(date: Column, dayOfWeek: String): Column

    This is an overload of the next_day method.

    This is an overload of the next_day method. Returns the first date which is later than the value of the date column that is on the specified day of the week.

    date

    Column date to find the day.

    dayOfWeek

    String day of the week you do want to find.

    returns

    Column object.

  42. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  43. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  44. def ntile(n: Int): Column

    Wrapper for Snowflake built-in ntile function.

    Wrapper for Snowflake built-in ntile function. Returns the ntile group id (from 1 to n inclusive) in an ordered window partition.

    n

    ntile group.

    returns

    Column object.

  45. def radians(columnName: String): Column

    Wrapper for Snowflake built-in radians function.

    Wrapper for Snowflake built-in radians function. Converts an angle measured in degrees to an approximately equivalent angle measured in radians.

    columnName

    Column name for convert to radians.

    returns

    Column object.

  46. def radians(c: Column): Column

    Wrapper for Snowflake built-in radians function.

    Wrapper for Snowflake built-in radians function. Converts an angle measured in degrees to an approximately equivalent angle measured in radians.

    c

    Column for convert to radians.

    returns

    Column object.

  47. def regexp_split(column: Column, pattern: String, limit: Int = -1)(implicit session: Session): Column

    This is a method split that split a column with a regular expresion patter or common string.

    This is a method split that split a column with a regular expresion patter or common string.

    column

    Column for spliting.

    pattern

    String pattern for splitting..

    returns

    Column object.

  48. def repeat(column: Column, n: Int): Column

    This is an overload of the repeat method that repeats a string of characters n times and returns it as a new column.

    This is an overload of the repeat method that repeats a string of characters n times and returns it as a new column.

    column

    Column for repeat.

    n

    Int times for repeat.{

    returns

    Column object.

  49. def round(column: Column, scale: Int): Column

    This is an overload of the round method that rounds a value to a number with scala times of decimals .

    This is an overload of the round method that rounds a value to a number with scala times of decimals .

    column

    Column for round the value.

    scale

    Int scale decimal places.

    returns

    Column object.

  50. def rtrim(column: Column): Column

    This is an overload of the trim method that uses the empty space as a replacement for the white spaces at the right string of characters.

    This is an overload of the trim method that uses the empty space as a replacement for the white spaces at the right string of characters.

    column

    Column for trimming the spaces from right.

    returns

    Column object.

  51. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  52. def toString(): String
    Definition Classes
    AnyRef → Any
  53. def translate(column: Column, matchingString: String, replaceString: String): Column

    This is an overload of the translate method.

    This is an overload of the translate method. Translate any string of characters with a string of characters sources

    column

    Column for translate.

    matchingString

    String for mach.

    replaceString

    String for replacing.

    returns

    Column object.

  54. def trim(column: Column): Column

    This is an overload of the trim method that uses the empty space as a replacement for the white spaces at the beginning and end of the string of characters..

    This is an overload of the trim method that uses the empty space as a replacement for the white spaces at the beginning and end of the string of characters..

    column

    Column for trimming the spaces.

    returns

    Column object.

  55. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  56. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  57. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped