Object/Trait

org.apache.spark.sql.catalyst

ScalaReflection

Related Docs: trait ScalaReflection | package catalyst

Permalink

object ScalaReflection extends ScalaReflection

A default version of ScalaReflection that uses the runtime universe.

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

Type Members

  1. case class Schema(dataType: DataType, nullable: Boolean) extends Product with Serializable

    Permalink

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 attributesFor[T](implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): Seq[Attribute]

    Permalink

    Returns a Sequence of attributes for the given case class type.

  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def constructParams(tpe: scala.reflect.api.JavaUniverse.Type): Seq[scala.reflect.api.JavaUniverse.Symbol]

    Permalink
    Attributes
    protected
    Definition Classes
    ScalaReflection
  8. def dataTypeFor[T](implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): DataType

    Permalink

    Returns the Spark SQL DataType for a given scala type.

    Returns the Spark SQL DataType for a given scala type. Where this is not an exact mapping to a native type, an ObjectType is returned. Special handling is also used for Arrays including those that hold primitive types.

    Unlike schemaFor, this function doesn't do any massaging of types into the Spark SQL type system. As a result, ObjectType will be returned for things like boxed Integers

  9. def deserializerFor[T](implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): Expression

    Permalink

    Returns an expression that can be used to deserialize an input row to an object of type T with a compatible schema.

    Returns an expression that can be used to deserialize an input row to an object of type T with a compatible schema. Fields of the row will be extracted using UnresolvedAttributes of the same name as the constructor arguments. Nested classes will have their fields accessed using UnresolvedExtractValue.

    When used on a primitive type, the constructor will instead default to extracting the value from ordinal 0 (since there are no names to map to). The actual location can be moved by calling resolve/bind with a new schema.

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

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  14. def getClassFromType(tpe: scala.reflect.api.JavaUniverse.Type): Class[_]

    Permalink
  15. def getClassNameFromType(tpe: scala.reflect.api.JavaUniverse.Type): String

    Permalink

    Returns the full class name for a type.

    Returns the full class name for a type. The returned name is the canonical Scala name, where each component is separated by a period. It is NOT the Java-equivalent runtime name (no dollar signs).

    In simple cases, both the Scala and Java names are the same, however when Scala generates constructs that do not map to a Java equivalent, such as singleton objects or nested classes in package objects, it uses the dollar sign ($) to create synthetic classes, emulating behaviour in Java bytecode.

    Definition Classes
    ScalaReflection
  16. def getConstructorParameterNames(cls: Class[_]): Seq[String]

    Permalink

    Returns the parameter names for the primary constructor of this class.

    Returns the parameter names for the primary constructor of this class.

    Logically we should call getConstructorParameters and throw away the parameter types to get parameter names, however there are some weird scala reflection problems and this method is a workaround to avoid getting parameter types.

  17. def getConstructorParameterValues(obj: DefinedByConstructorParams): Seq[AnyRef]

    Permalink

    Returns the parameter values for the primary constructor of this class.

  18. def getConstructorParameters(cls: Class[_]): Seq[(String, scala.reflect.api.JavaUniverse.Type)]

    Permalink

    Returns the parameter names and types for the primary constructor of this class.

    Returns the parameter names and types for the primary constructor of this class.

    Note that it only works for scala classes with primary constructor, and currently doesn't support inner class.

  19. def getConstructorParameters(tpe: scala.reflect.api.JavaUniverse.Type): Seq[(String, scala.reflect.api.JavaUniverse.Type)]

    Permalink

    Returns the parameter names and types for the primary constructor of this type.

    Returns the parameter names and types for the primary constructor of this type.

    Note that it only works for scala classes with primary constructor, and currently doesn't support inner class.

    Definition Classes
    ScalaReflection
  20. def getParameterTypes(func: AnyRef): Seq[Class[_]]

    Permalink

    Returns classes of input parameters of scala function object.

    Returns classes of input parameters of scala function object.

    Definition Classes
    ScalaReflection
  21. def hashCode(): Int

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

    Permalink
    Definition Classes
    Any
  23. def isNativeType(dt: DataType): Boolean

    Permalink

    Returns true if the value of this data type is same between internal and external.

  24. def localTypeOf[T](implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): scala.reflect.api.JavaUniverse.Type

    Permalink

    Return the Scala Type for T in the current classloader mirror.

    Return the Scala Type for T in the current classloader mirror.

    Use this method instead of the convenience method universe.typeOf, which assumes that all types can be found in the classloader that loaded scala-reflect classes. That's not necessarily the case when running using Eclipse launchers or even Sbt console or test (without fork := true).

    Definition Classes
    ScalaReflection
    See also

    SPARK-5281

  25. def mirror: Mirror

    Permalink

    The mirror used to access types in the universe

    The mirror used to access types in the universe

    Definition Classes
    ScalaReflectionScalaReflection
  26. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  29. def schemaFor(tpe: scala.reflect.api.JavaUniverse.Type): Schema

    Permalink

    Returns a catalyst DataType and its nullability for the given Scala Type using reflection.

  30. def schemaFor[T](implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): Schema

    Permalink

    Returns a catalyst DataType and its nullability for the given Scala Type using reflection.

  31. def serializerFor[T](inputObject: Expression)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): CreateNamedStruct

    Permalink

    Returns an expression for serializing an object of type T to an internal row.

    Returns an expression for serializing an object of type T to an internal row.

    If the given type is not supported, i.e. there is no encoder can be built for this type, an UnsupportedOperationException will be thrown with detailed error message to explain the type path walked so far and which class we are not supporting. There are 4 kinds of type path: * the root type: root class: "abc.xyz.MyClass" * the value type of Option: option value class: "abc.xyz.MyClass" * the element type of Array or Seq: array element class: "abc.xyz.MyClass" * the field of Product: field (class: "abc.xyz.MyClass", name: "myField")

  32. def silentSchemaFor(tpe: scala.reflect.api.JavaUniverse.Type): Schema

    Permalink

    Returns a catalyst DataType and its nullability for the given Scala Type using reflection.

    Returns a catalyst DataType and its nullability for the given Scala Type using reflection.

    Unlike schemaFor, this method won't throw exception for un-supported type, it will return NullType silently instead.

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

    Permalink
    Definition Classes
    AnyRef
  34. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  35. val universe: scala.reflect.runtime.universe.type

    Permalink

    The universe we work in (runtime or macro)

    The universe we work in (runtime or macro)

    Definition Classes
    ScalaReflectionScalaReflection
  36. final def wait(): Unit

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

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

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

Inherited from ScalaReflection

Inherited from AnyRef

Inherited from Any

Ungrouped