Object

com.mongodb.spark.sql.helpers

UDF

Related Doc: package helpers

Permalink

object UDF

The udf package provides User Defined Functions that can be used to support querying unsupported Bson Types in Spark.

The unsupported types follow the MongoDB Extended Json format.

Since

1.1.0

See also

the StructFields helpers which convert unsupported bson types into StructTypes so that they can be queried

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. UDF
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def binary(base64: String): Binary

    Permalink

    This method can be used as a user defined function to aid the querying binary values.

    This method can be used as a user defined function to aid the querying binary values.

    Usage example:

    sqlContext.udf.register("Binary", udf.binary _)
    df.filter(s"binary = Binary('$base64')")
    base64

    the base 64 string that represents a binary value

    returns

    a fieldType that can be used to query against

  6. def binaryWithSubType(subType: Byte, base64: String): Binary

    Permalink

    This method can be used as a user defined function to aid the querying of binary values that contain a sub type.

    This method can be used as a user defined function to aid the querying of binary values that contain a sub type.

    Usage example:

    sqlContext.udf.register("BinaryWithSubType", udf.binaryWithSubType _)
    df.filter(s"binaryWithSubType = BinaryWithSubType($subType, '$base64')")
    subType

    the binary sub type

    base64

    the base 64 string that represents a binary value

    returns

    a fieldType that can be used to query against

  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def dbPointer(ref: String, oid: String): DbPointer

    Permalink

    This method can be used as a user defined function to aid the querying of DbPointer values.

    This method can be used as a user defined function to aid the querying of DbPointer values.

    Usage example:

    sqlContext.udf.register("DbPointer", udf.dbPointer _)
    df.filter(s"dbPointer = DbPointer('$ref', '$oid')")
    ref

    the namespace string

    oid

    the ObjectId string

    returns

    a fieldType that can be used to query against

  9. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  13. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  14. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  15. def javaScript(code: String): JavaScript

    Permalink

    This method can be used as a user defined function to aid the querying of JavaScript values.

    This method can be used as a user defined function to aid the querying of JavaScript values.

    Usage example:

    sqlContext.udf.register("JavaScript", udf.javaScript _)
    df.filter(s"code = JavaScript('$code')")
    code

    the JavaScript code

    returns

    a fieldType that can be used to query against

  16. def javaScriptWithScope(code: String, scope: String): JavaScriptWithScope

    Permalink

    This method can be used as a user defined function to aid the querying of JavaScript with scope values.

    This method can be used as a user defined function to aid the querying of JavaScript with scope values.

    Usage example:

    sqlContext.udf.register("JavaScript", udf.javaScriptWithScope _)
    df.filter(s"codeWithScope = JavaScript('$code', '$scope')")
    code

    the JavaScript code

    scope

    the Json representation of the scope

    returns

    a fieldType that can be used to query against

  17. def maxKey(): MaxKey

    Permalink

    This method can be used as a user defined function to aid the querying of maxKey values.

    This method can be used as a user defined function to aid the querying of maxKey values.

    Usage example:

    sqlContext.udf.register("maxKey", udf.maxKey _)
    df.filter(s"maxKey = maxKey()")
    returns

    a fieldType that can be used to query against

  18. def minKey(): MinKey

    Permalink

    This method can be used as a user defined function to aid the querying of minKey values.

    This method can be used as a user defined function to aid the querying of minKey values.

    Usage example:

    sqlContext.udf.register("minKey", udf.minKey _)
    df.filter(s"minKey = minKey()")
    returns

    a fieldType that can be used to query against

  19. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. def objectId(oid: String): ObjectId

    Permalink

    This method can be used as a user defined function to aid the querying of ObjectId values.

    This method can be used as a user defined function to aid the querying of ObjectId values.

    Usage example:

    sqlContext.udf.register("ObjectId", udf.objectId _)
    df.filter(s"objectId = ObjectId('$oid')")
    oid

    the ObjectId string

    returns

    a fieldType that can be used to query against

  23. def regularExpression(regex: String): RegularExpression

    Permalink

    This method can be used as a user defined function to aid the querying of regular expression values.

    This method can be used as a user defined function to aid the querying of regular expression values.

    Usage example:

    sqlContext.udf.register("Regex", udf.regularExpression _)
    df.filter(s"regex = Regex('$regex')")
    regex

    the regular expression string

    returns

    a fieldType that can be used to query against

  24. def regularExpressionWithOptions(regex: String, options: String): RegularExpression

    Permalink

    This method can be used as a user defined function to aid the querying of regular expression values with options.

    This method can be used as a user defined function to aid the querying of regular expression values with options.

    Usage example:

    sqlContext.udf.register("Regex", udf.regularExpressionWithOptions _)
    df.filter(s"regexWithOptions = Regex('$regex', '$options')")
    regex

    the regular expression string

    options

    the options

    returns

    a fieldType that can be used to query against

  25. def symbol(symbol: String): Symbol

    Permalink

    This method can be used as a user defined function to aid the querying of Symbol values.

    This method can be used as a user defined function to aid the querying of Symbol values.

    Usage example:

    sqlContext.udf.register("Symbol", udf.symbol _)
    df.filter(s"symbol = Symbol('$symbol')")
    symbol

    the symbol

    returns

    a fieldType that can be used to query against

  26. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  27. def timestamp(time: Int, inc: Int): Timestamp

    Permalink

    This method can be used as a user defined function to aid the querying of Timestamp values.

    This method can be used as a user defined function to aid the querying of Timestamp values.

    Usage example:

    sqlContext.udf.register("Timestamp", udf.timestamp _)
    df.filter(s"timestamp = Timestamp($time, $inc)")
    time

    the time in seconds since epoch

    inc

    an incrementing ordinal for operations within a given second

    returns

    a fieldType that can be used to query against

  28. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  29. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped