Packages

case class StructType(fields: Array[StructField]) extends DataType with Seq[StructField] with Product with Serializable

A StructType object can be constructed by

StructType(fields: Seq[StructField])

For a StructType object, one or multiple StructFields can be extracted by names. If multiple StructFields are extracted, a StructType object will be returned. If a provided name does not have a matching field, it will be ignored. For the case of extracting a single StructField, a null will be returned.

Scala Example:

import org.apache.spark.sql._
import org.apache.spark.sql.types._

val struct =
  StructType(
    StructField("a", IntegerType, true) ::
    StructField("b", LongType, false) ::
    StructField("c", BooleanType, false) :: Nil)

// Extract a single StructField.
val singleField = struct("b")
// singleField: StructField = StructField(b,LongType,false)

// If this struct does not have a field called "d", it throws an exception.
struct("d")
// java.lang.IllegalArgumentException: d does not exist.
//   ...

// Extract multiple StructFields. Field names are provided in a set.
// A StructType object will be returned.
val twoFields = struct(Set("b", "c"))
// twoFields: StructType =
//   StructType(StructField(b,LongType,false), StructField(c,BooleanType,false))

// Any names without matching fields will throw an exception.
// For the case shown below, an exception is thrown due to "d".
struct(Set("b", "c", "d"))
// java.lang.IllegalArgumentException: d does not exist.
//    ...

A org.apache.spark.sql.Row object is used as a value of the StructType.

Scala Example:

import org.apache.spark.sql._
import org.apache.spark.sql.types._

val innerStruct =
  StructType(
    StructField("f1", IntegerType, true) ::
    StructField("f2", LongType, false) ::
    StructField("f3", BooleanType, false) :: Nil)

val struct = StructType(
  StructField("a", innerStruct, true) :: Nil)

// Create a Row with the schema defined by struct
val row = Row(Row(1, 2, true))
Annotations
@Stable()
Source
StructType.scala
Since

1.3.0

Linear Supertypes
Serializable, Product, Seq[StructField], SeqOps[StructField, Seq, Seq[StructField]], Seq[StructField], Equals, SeqOps[StructField, [_]Seq[_], Seq[StructField]], PartialFunction[Int, StructField], (Int) => StructField, Iterable[StructField], Iterable[StructField], IterableFactoryDefaults[StructField, [x]Seq[x]], IterableOps[StructField, [_]Seq[_], Seq[StructField]], IterableOnceOps[StructField, [_]Seq[_], Seq[StructField]], IterableOnce[StructField], DataType, AbstractDataType, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. StructType
  2. Serializable
  3. Product
  4. Seq
  5. SeqOps
  6. Seq
  7. Equals
  8. SeqOps
  9. PartialFunction
  10. Function1
  11. Iterable
  12. Iterable
  13. IterableFactoryDefaults
  14. IterableOps
  15. IterableOnceOps
  16. IterableOnce
  17. DataType
  18. AbstractDataType
  19. AnyRef
  20. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new StructType()

    No-arg constructor for kryo.

  2. new StructType(fields: Array[StructField])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ++[B >: StructField](suffix: IterableOnce[B]): Seq[B]
    Definition Classes
    IterableOps
    Annotations
    @inline()
  4. final def ++:[B >: StructField](prefix: IterableOnce[B]): Seq[B]
    Definition Classes
    SeqOps → IterableOps
    Annotations
    @inline()
  5. final def +:[B >: StructField](elem: B): Seq[B]
    Definition Classes
    SeqOps
    Annotations
    @inline()
  6. final def :+[B >: StructField](elem: B): Seq[B]
    Definition Classes
    SeqOps
    Annotations
    @inline()
  7. final def :++[B >: StructField](suffix: IterableOnce[B]): Seq[B]
    Definition Classes
    SeqOps
    Annotations
    @inline()
  8. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. def add(name: String, dataType: String, nullable: Boolean, comment: String): StructType

    Creates a new StructType by adding a new field and specifying metadata where the dataType is specified as a String.

    Creates a new StructType by adding a new field and specifying metadata where the dataType is specified as a String.

    val struct = (new StructType)
      .add("a", "int", true, "comment1")
      .add("b", "long", false, "comment2")
      .add("c", "string", true, "comment3")
  10. def add(name: String, dataType: String, nullable: Boolean, metadata: Metadata): StructType

    Creates a new StructType by adding a new field and specifying metadata where the dataType is specified as a String.

    Creates a new StructType by adding a new field and specifying metadata where the dataType is specified as a String.

    val struct = (new StructType)
      .add("a", "int", true, Metadata.empty)
      .add("b", "long", false, Metadata.empty)
      .add("c", "string", true, Metadata.empty)
  11. def add(name: String, dataType: String, nullable: Boolean): StructType

    Creates a new StructType by adding a new field with no metadata where the dataType is specified as a String.

    Creates a new StructType by adding a new field with no metadata where the dataType is specified as a String.

    val struct = (new StructType)
      .add("a", "int", true)
      .add("b", "long", false)
      .add("c", "string", true)
  12. def add(name: String, dataType: String): StructType

    Creates a new StructType by adding a new nullable field with no metadata where the dataType is specified as a String.

    Creates a new StructType by adding a new nullable field with no metadata where the dataType is specified as a String.

    val struct = (new StructType)
      .add("a", "int")
      .add("b", "long")
      .add("c", "string")
  13. def add(name: String, dataType: DataType, nullable: Boolean, comment: String): StructType

    Creates a new StructType by adding a new field and specifying metadata.

    Creates a new StructType by adding a new field and specifying metadata.

    val struct = (new StructType)
      .add("a", IntegerType, true, "comment1")
      .add("b", LongType, false, "comment2")
      .add("c", StringType, true, "comment3")
  14. def add(name: String, dataType: DataType, nullable: Boolean, metadata: Metadata): StructType

    Creates a new StructType by adding a new field and specifying metadata.

    Creates a new StructType by adding a new field and specifying metadata.

    val struct = (new StructType)
      .add("a", IntegerType, true, Metadata.empty)
      .add("b", LongType, false, Metadata.empty)
      .add("c", StringType, true, Metadata.empty)
  15. def add(name: String, dataType: DataType, nullable: Boolean): StructType

    Creates a new StructType by adding a new field with no metadata.

    Creates a new StructType by adding a new field with no metadata.

    val struct = (new StructType) .add("a", IntegerType, true) .add("b", LongType, false) .add("c", StringType, true)

  16. def add(name: String, dataType: DataType): StructType

    Creates a new StructType by adding a new nullable field with no metadata.

    Creates a new StructType by adding a new nullable field with no metadata.

    val struct = (new StructType) .add("a", IntegerType) .add("b", LongType) .add("c", StringType)

  17. def add(field: StructField): StructType

    Creates a new StructType by adding a new field.

    Creates a new StructType by adding a new field.

    val struct = (new StructType)
      .add(StructField("a", IntegerType, true))
      .add(StructField("b", LongType, false))
      .add(StructField("c", StringType, true))
  18. final def addString(b: StringBuilder): b.type
    Definition Classes
    IterableOnceOps
    Annotations
    @inline()
  19. final def addString(b: StringBuilder, sep: String): b.type
    Definition Classes
    IterableOnceOps
    Annotations
    @inline()
  20. def addString(b: StringBuilder, start: String, sep: String, end: String): b.type
    Definition Classes
    IterableOnceOps
  21. def andThen[C](k: PartialFunction[StructField, C]): PartialFunction[Int, C]
    Definition Classes
    PartialFunction
  22. def andThen[C](k: (StructField) => C): PartialFunction[Int, C]
    Definition Classes
    PartialFunction → Function1
  23. def appended[B >: StructField](elem: B): Seq[B]
    Definition Classes
    SeqOps
  24. def appendedAll[B >: StructField](suffix: IterableOnce[B]): Seq[B]
    Definition Classes
    SeqOps
  25. def apply(fieldIndex: Int): StructField
    Definition Classes
    StructType → SeqOps → Function1
  26. def apply(names: Set[String]): StructType

    Returns a StructType containing StructFields of the given names, preserving the original order of fields.

    Returns a StructType containing StructFields of the given names, preserving the original order of fields.

    Exceptions thrown

    IllegalArgumentException if at least one given field name does not exist

  27. def apply(name: String): StructField

    Extracts the StructField with the given name.

    Extracts the StructField with the given name.

    Exceptions thrown

    IllegalArgumentException if a field with the given name does not exist

  28. def applyOrElse[A1 <: Int, B1 >: StructField](x: A1, default: (A1) => B1): B1
    Definition Classes
    PartialFunction
  29. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  30. def canEqual(that: Any): Boolean
    Definition Classes
    Seq → Equals
  31. def catalogString: String

    String representation for the type saved in external catalogs.

    String representation for the type saved in external catalogs.

    Definition Classes
    StructTypeDataType
  32. def className: String
    Attributes
    protected[this]
    Definition Classes
    Iterable
  33. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  34. final def coll: StructType.this.type
    Attributes
    protected
    Definition Classes
    Iterable → IterableOps
  35. def collect[B](pf: PartialFunction[StructField, B]): Seq[B]
    Definition Classes
    IterableOps → IterableOnceOps
  36. def collectFirst[B](pf: PartialFunction[StructField, B]): Option[B]
    Definition Classes
    IterableOnceOps
  37. def combinations(n: Int): Iterator[Seq[StructField]]
    Definition Classes
    SeqOps
  38. def compose[R](k: PartialFunction[R, Int]): PartialFunction[R, StructField]
    Definition Classes
    PartialFunction
  39. def compose[A](g: (A) => Int): (A) => StructField
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  40. final def concat[B >: StructField](suffix: IterableOnce[B]): Seq[B]
    Definition Classes
    SeqOps → IterableOps
    Annotations
    @inline()
  41. def contains[A1 >: StructField](elem: A1): Boolean
    Definition Classes
    SeqOps
  42. def containsSlice[B >: StructField](that: Seq[B]): Boolean
    Definition Classes
    SeqOps
  43. def copyToArray[B >: StructField](xs: Array[B], start: Int, len: Int): Int
    Definition Classes
    IterableOnceOps
  44. def copyToArray[B >: StructField](xs: Array[B], start: Int): Int
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecatedOverriding()
  45. def copyToArray[B >: StructField](xs: Array[B]): Int
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecatedOverriding()
  46. def corresponds[B](that: Seq[B])(p: (StructField, B) => Boolean): Boolean
    Definition Classes
    SeqOps
  47. def corresponds[B](that: IterableOnce[B])(p: (StructField, B) => Boolean): Boolean
    Definition Classes
    IterableOnceOps
  48. def count(p: (StructField) => Boolean): Int
    Definition Classes
    IterableOnceOps
  49. def defaultSize: Int

    The default size of a value of the StructType is the total default sizes of all field types.

    The default size of a value of the StructType is the total default sizes of all field types.

    Definition Classes
    StructTypeDataType
  50. def diff[B >: StructField](that: Seq[B]): Seq[StructField]
    Definition Classes
    SeqOps
  51. def distinct: Seq[StructField]
    Definition Classes
    SeqOps
  52. def distinctBy[B](f: (StructField) => B): Seq[StructField]
    Definition Classes
    SeqOps
  53. def drop(n: Int): Seq[StructField]
    Definition Classes
    IterableOps → IterableOnceOps
  54. def dropRight(n: Int): Seq[StructField]
    Definition Classes
    IterableOps
  55. def dropWhile(p: (StructField) => Boolean): Seq[StructField]
    Definition Classes
    IterableOps → IterableOnceOps
  56. def elementWise: ElementWiseExtractor[Int, StructField]
    Definition Classes
    PartialFunction
  57. def empty: Seq[StructField]
    Definition Classes
    IterableFactoryDefaults → IterableOps
  58. def endsWith[B >: StructField](that: Iterable[B]): Boolean
    Definition Classes
    SeqOps
  59. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  60. def equals(that: Any): Boolean
    Definition Classes
    StructType → Seq → Equals → AnyRef → Any
  61. def exists(p: (StructField) => Boolean): Boolean
    Definition Classes
    IterableOnceOps
  62. def fieldIndex(name: String): Int

    Returns the index of a given field.

    Returns the index of a given field.

    Exceptions thrown

    IllegalArgumentException if a field with the given name does not exist

  63. def fieldNames: Array[String]

    Returns all field names in an array.

  64. val fields: Array[StructField]
  65. def filter(pred: (StructField) => Boolean): Seq[StructField]
    Definition Classes
    IterableOps → IterableOnceOps
  66. def filterNot(pred: (StructField) => Boolean): Seq[StructField]
    Definition Classes
    IterableOps → IterableOnceOps
  67. def find(p: (StructField) => Boolean): Option[StructField]
    Definition Classes
    IterableOnceOps
  68. def findLast(p: (StructField) => Boolean): Option[StructField]
    Definition Classes
    SeqOps
  69. def flatMap[B](f: (StructField) => IterableOnce[B]): Seq[B]
    Definition Classes
    IterableOps → IterableOnceOps
  70. def flatten[B](implicit asIterable: (StructField) => IterableOnce[B]): Seq[B]
    Definition Classes
    IterableOps → IterableOnceOps
  71. def fold[A1 >: StructField](z: A1)(op: (A1, A1) => A1): A1
    Definition Classes
    IterableOnceOps
  72. def foldLeft[B](z: B)(op: (B, StructField) => B): B
    Definition Classes
    IterableOnceOps
  73. def foldRight[B](z: B)(op: (StructField, B) => B): B
    Definition Classes
    IterableOnceOps
  74. def forall(p: (StructField) => Boolean): Boolean
    Definition Classes
    IterableOnceOps
  75. def foreach[U](f: (StructField) => U): Unit
    Definition Classes
    IterableOnceOps
  76. def fromSpecific(coll: IterableOnce[StructField]): Seq[StructField]
    Attributes
    protected
    Definition Classes
    IterableFactoryDefaults → IterableOps
  77. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  78. def groupBy[K](f: (StructField) => K): Map[K, Seq[StructField]]
    Definition Classes
    IterableOps
  79. def groupMap[K, B](key: (StructField) => K)(f: (StructField) => B): Map[K, Seq[B]]
    Definition Classes
    IterableOps
  80. def groupMapReduce[K, B](key: (StructField) => K)(f: (StructField) => B)(reduce: (B, B) => B): Map[K, B]
    Definition Classes
    IterableOps
  81. def grouped(size: Int): Iterator[Seq[StructField]]
    Definition Classes
    IterableOps
  82. def hashCode(): Int
    Definition Classes
    StructType → Seq → AnyRef → Any
  83. def head: StructField
    Definition Classes
    IterableOps
  84. def headOption: Option[StructField]
    Definition Classes
    IterableOps
  85. def indexOf[B >: StructField](elem: B): Int
    Definition Classes
    SeqOps
    Annotations
    @deprecatedOverriding()
  86. def indexOf[B >: StructField](elem: B, from: Int): Int
    Definition Classes
    SeqOps
  87. def indexOfSlice[B >: StructField](that: Seq[B]): Int
    Definition Classes
    SeqOps
    Annotations
    @deprecatedOverriding()
  88. def indexOfSlice[B >: StructField](that: Seq[B], from: Int): Int
    Definition Classes
    SeqOps
  89. def indexWhere(p: (StructField) => Boolean): Int
    Definition Classes
    SeqOps
    Annotations
    @deprecatedOverriding()
  90. def indexWhere(p: (StructField) => Boolean, from: Int): Int
    Definition Classes
    SeqOps
  91. def indices: Range
    Definition Classes
    SeqOps
  92. def init: Seq[StructField]
    Definition Classes
    IterableOps
  93. def inits: Iterator[Seq[StructField]]
    Definition Classes
    IterableOps
  94. def intersect[B >: StructField](that: Seq[B]): Seq[StructField]
    Definition Classes
    SeqOps
  95. def isDefinedAt(idx: Int): Boolean
    Definition Classes
    SeqOps
  96. def isEmpty: Boolean
    Definition Classes
    SeqOps → IterableOnceOps
  97. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  98. def isTraversableAgain: Boolean
    Definition Classes
    IterableOps → IterableOnceOps
  99. def iterableFactory: SeqFactory[Seq]
    Definition Classes
    Seq → Seq → Iterable → Iterable → IterableOps
  100. def iterator: Iterator[StructField]
    Definition Classes
    StructType → IterableOnce
  101. def json: String

    The compact JSON representation of this data type.

    The compact JSON representation of this data type.

    Definition Classes
    DataType
  102. def knownSize: Int
    Definition Classes
    IterableOnce
  103. def last: StructField
    Definition Classes
    IterableOps
  104. def lastIndexOf[B >: StructField](elem: B, end: Int): Int
    Definition Classes
    SeqOps
  105. def lastIndexOfSlice[B >: StructField](that: Seq[B]): Int
    Definition Classes
    SeqOps
    Annotations
    @deprecatedOverriding()
  106. def lastIndexOfSlice[B >: StructField](that: Seq[B], end: Int): Int
    Definition Classes
    SeqOps
  107. def lastIndexWhere(p: (StructField) => Boolean): Int
    Definition Classes
    SeqOps
    Annotations
    @deprecatedOverriding()
  108. def lastIndexWhere(p: (StructField) => Boolean, end: Int): Int
    Definition Classes
    SeqOps
  109. def lastOption: Option[StructField]
    Definition Classes
    IterableOps
  110. def lazyZip[B](that: Iterable[B]): LazyZip2[StructField, B, StructType.this.type]
    Definition Classes
    Iterable
  111. def length: Int
    Definition Classes
    StructType → SeqOps
  112. def lengthCompare(that: Iterable[_]): Int
    Definition Classes
    SeqOps
  113. def lengthCompare(len: Int): Int
    Definition Classes
    SeqOps
  114. final def lengthIs: SizeCompareOps
    Definition Classes
    SeqOps
    Annotations
    @inline()
  115. def lift: (Int) => Option[StructField]
    Definition Classes
    PartialFunction
  116. def map[B](f: (StructField) => B): Seq[B]
    Definition Classes
    IterableOps → IterableOnceOps
  117. def max[B >: StructField](implicit ord: Ordering[B]): StructField
    Definition Classes
    IterableOnceOps
  118. def maxBy[B](f: (StructField) => B)(implicit ord: Ordering[B]): StructField
    Definition Classes
    IterableOnceOps
  119. def maxByOption[B](f: (StructField) => B)(implicit ord: Ordering[B]): Option[StructField]
    Definition Classes
    IterableOnceOps
  120. def maxOption[B >: StructField](implicit ord: Ordering[B]): Option[StructField]
    Definition Classes
    IterableOnceOps
  121. def min[B >: StructField](implicit ord: Ordering[B]): StructField
    Definition Classes
    IterableOnceOps
  122. def minBy[B](f: (StructField) => B)(implicit ord: Ordering[B]): StructField
    Definition Classes
    IterableOnceOps
  123. def minByOption[B](f: (StructField) => B)(implicit ord: Ordering[B]): Option[StructField]
    Definition Classes
    IterableOnceOps
  124. def minOption[B >: StructField](implicit ord: Ordering[B]): Option[StructField]
    Definition Classes
    IterableOnceOps
  125. final def mkString: String
    Definition Classes
    IterableOnceOps
    Annotations
    @inline()
  126. final def mkString(sep: String): String
    Definition Classes
    IterableOnceOps
    Annotations
    @inline()
  127. final def mkString(start: String, sep: String, end: String): String
    Definition Classes
    IterableOnceOps
  128. def names: Array[String]

    Returns all field names in an array.

    Returns all field names in an array. This is an alias of fieldNames.

    Since

    2.4.0

  129. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  130. def newSpecificBuilder: Builder[StructField, Seq[StructField]]
    Attributes
    protected
    Definition Classes
    IterableFactoryDefaults → IterableOps
  131. def nonEmpty: Boolean
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecatedOverriding()
  132. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  133. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  134. def occCounts[B](sq: Seq[B]): Map[B, Int]
    Attributes
    protected[collection]
    Definition Classes
    SeqOps
  135. def orElse[A1 <: Int, B1 >: StructField](that: PartialFunction[A1, B1]): PartialFunction[A1, B1]
    Definition Classes
    PartialFunction
  136. def padTo[B >: StructField](len: Int, elem: B): Seq[B]
    Definition Classes
    SeqOps
  137. def partition(p: (StructField) => Boolean): (Seq[StructField], Seq[StructField])
    Definition Classes
    IterableOps
  138. def partitionMap[A1, A2](f: (StructField) => Either[A1, A2]): (Seq[A1], Seq[A2])
    Definition Classes
    IterableOps
  139. def patch[B >: StructField](from: Int, other: IterableOnce[B], replaced: Int): Seq[B]
    Definition Classes
    SeqOps
  140. def permutations: Iterator[Seq[StructField]]
    Definition Classes
    SeqOps
  141. def prepended[B >: StructField](elem: B): Seq[B]
    Definition Classes
    SeqOps
  142. def prependedAll[B >: StructField](prefix: IterableOnce[B]): Seq[B]
    Definition Classes
    SeqOps
  143. def prettyJson: String

    The pretty (i.e.

    The pretty (i.e. indented) JSON representation of this data type.

    Definition Classes
    DataType
  144. def printTreeString(): Unit
  145. def product[B >: StructField](implicit num: Numeric[B]): B
    Definition Classes
    IterableOnceOps
  146. def productElementNames: Iterator[String]
    Definition Classes
    Product
  147. def reduce[B >: StructField](op: (B, B) => B): B
    Definition Classes
    IterableOnceOps
  148. def reduceLeft[B >: StructField](op: (B, StructField) => B): B
    Definition Classes
    IterableOnceOps
  149. def reduceLeftOption[B >: StructField](op: (B, StructField) => B): Option[B]
    Definition Classes
    IterableOnceOps
  150. def reduceOption[B >: StructField](op: (B, B) => B): Option[B]
    Definition Classes
    IterableOnceOps
  151. def reduceRight[B >: StructField](op: (StructField, B) => B): B
    Definition Classes
    IterableOnceOps
  152. def reduceRightOption[B >: StructField](op: (StructField, B) => B): Option[B]
    Definition Classes
    IterableOnceOps
  153. def reverse: Seq[StructField]
    Definition Classes
    SeqOps
  154. def reverseIterator: Iterator[StructField]
    Definition Classes
    SeqOps
  155. def reversed: Iterable[StructField]
    Attributes
    protected
    Definition Classes
    IterableOnceOps
  156. def runWith[U](action: (StructField) => U): (Int) => Boolean
    Definition Classes
    PartialFunction
  157. def sameElements[B >: StructField](that: IterableOnce[B]): Boolean
    Definition Classes
    SeqOps
  158. def scan[B >: StructField](z: B)(op: (B, B) => B): Seq[B]
    Definition Classes
    IterableOps
  159. def scanLeft[B](z: B)(op: (B, StructField) => B): Seq[B]
    Definition Classes
    IterableOps → IterableOnceOps
  160. def scanRight[B](z: B)(op: (StructField, B) => B): Seq[B]
    Definition Classes
    IterableOps
  161. def search[B >: StructField](elem: B, from: Int, to: Int)(implicit ord: Ordering[B]): SearchResult
    Definition Classes
    SeqOps
  162. def search[B >: StructField](elem: B)(implicit ord: Ordering[B]): SearchResult
    Definition Classes
    SeqOps
  163. def segmentLength(p: (StructField) => Boolean, from: Int): Int
    Definition Classes
    SeqOps
  164. final def segmentLength(p: (StructField) => Boolean): Int
    Definition Classes
    SeqOps
  165. def simpleString: String

    Readable string representation for the type.

    Readable string representation for the type.

    Definition Classes
    StructTypeDataType → AbstractDataType
  166. final def size: Int
    Definition Classes
    SeqOps → IterableOnceOps
  167. final def sizeCompare(that: Iterable[_]): Int
    Definition Classes
    SeqOps → IterableOps
  168. final def sizeCompare(otherSize: Int): Int
    Definition Classes
    SeqOps → IterableOps
  169. final def sizeIs: SizeCompareOps
    Definition Classes
    IterableOps
    Annotations
    @inline()
  170. def slice(from: Int, until: Int): Seq[StructField]
    Definition Classes
    IterableOps → IterableOnceOps
  171. def sliding(size: Int, step: Int): Iterator[Seq[StructField]]
    Definition Classes
    IterableOps
  172. def sliding(size: Int): Iterator[Seq[StructField]]
    Definition Classes
    IterableOps
  173. def sortBy[B](f: (StructField) => B)(implicit ord: Ordering[B]): Seq[StructField]
    Definition Classes
    SeqOps
  174. def sortWith(lt: (StructField, StructField) => Boolean): Seq[StructField]
    Definition Classes
    SeqOps
  175. def sorted[B >: StructField](implicit ord: Ordering[B]): Seq[StructField]
    Definition Classes
    SeqOps
  176. def span(p: (StructField) => Boolean): (Seq[StructField], Seq[StructField])
    Definition Classes
    IterableOps → IterableOnceOps
  177. def splitAt(n: Int): (Seq[StructField], Seq[StructField])
    Definition Classes
    IterableOps → IterableOnceOps
  178. def sql: String
    Definition Classes
    StructTypeDataType
  179. def startsWith[B >: StructField](that: IterableOnce[B], offset: Int): Boolean
    Definition Classes
    SeqOps
  180. def stepper[S <: Stepper[_]](implicit shape: StepperShape[StructField, S]): S
    Definition Classes
    IterableOnce
  181. def stringPrefix: String
    Attributes
    protected[this]
    Definition Classes
    Seq → Iterable
  182. def sum[B >: StructField](implicit num: Numeric[B]): B
    Definition Classes
    IterableOnceOps
  183. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  184. def tail: Seq[StructField]
    Definition Classes
    IterableOps
  185. def tails: Iterator[Seq[StructField]]
    Definition Classes
    IterableOps
  186. def take(n: Int): Seq[StructField]
    Definition Classes
    IterableOps → IterableOnceOps
  187. def takeRight(n: Int): Seq[StructField]
    Definition Classes
    IterableOps
  188. def takeWhile(p: (StructField) => Boolean): Seq[StructField]
    Definition Classes
    IterableOps → IterableOnceOps
  189. def tapEach[U](f: (StructField) => U): Seq[StructField]
    Definition Classes
    IterableOps → IterableOnceOps
  190. def to[C1](factory: Factory[StructField, C1]): C1
    Definition Classes
    IterableOnceOps
  191. def toArray[B >: StructField](implicit arg0: ClassTag[B]): Array[B]
    Definition Classes
    IterableOnceOps
  192. final def toBuffer[B >: StructField]: Buffer[B]
    Definition Classes
    IterableOnceOps
    Annotations
    @inline()
  193. def toDDL: String

    Returns a string containing a schema in DDL format.

    Returns a string containing a schema in DDL format. For example, the following value: StructType(Seq(StructField("eventId", IntegerType), StructField("s", StringType))) will be converted to eventId INT, s STRING. The returned DDL schema can be used in a table creation.

    Since

    2.4.0

  194. def toIndexedSeq: IndexedSeq[StructField]
    Definition Classes
    IterableOnceOps
  195. def toList: List[StructField]
    Definition Classes
    IterableOnceOps
  196. def toMap[K, V](implicit ev: <:<[StructField, (K, V)]): Map[K, V]
    Definition Classes
    IterableOnceOps
  197. def toNullable: StructType

    Returns the same data type but set all nullability fields are true (StructField.nullable, ArrayType.containsNull, and MapType.valueContainsNull).

    Returns the same data type but set all nullability fields are true (StructField.nullable, ArrayType.containsNull, and MapType.valueContainsNull).

    Since

    4.0.0

  198. final def toSeq: StructType.this.type
    Definition Classes
    Seq → IterableOnceOps
  199. def toSet[B >: StructField]: Set[B]
    Definition Classes
    IterableOnceOps
  200. def toString(): String
    Definition Classes
    StructType → Seq → Function1 → Iterable → AnyRef → Any
  201. def toVector: Vector[StructField]
    Definition Classes
    IterableOnceOps
  202. def transpose[B](implicit asIterable: (StructField) => Iterable[B]): Seq[Seq[B]]
    Definition Classes
    IterableOps
  203. def treeString(maxDepth: Int): String
  204. def treeString: String
  205. def typeName: String

    Name of the type used in JSON serialization.

    Name of the type used in JSON serialization.

    Definition Classes
    DataType
  206. def unapply(a: Int): Option[StructField]
    Definition Classes
    PartialFunction
  207. def unzip[A1, A2](implicit asPair: (StructField) => (A1, A2)): (Seq[A1], Seq[A2])
    Definition Classes
    IterableOps
  208. def unzip3[A1, A2, A3](implicit asTriple: (StructField) => (A1, A2, A3)): (Seq[A1], Seq[A2], Seq[A3])
    Definition Classes
    IterableOps
  209. def updated[B >: StructField](index: Int, elem: B): Seq[B]
    Definition Classes
    SeqOps
  210. def view: SeqView[StructField]
    Definition Classes
    SeqOps → IterableOps
  211. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  212. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  213. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  214. def withFilter(p: (StructField) => Boolean): WithFilter[StructField, [_]Seq[_]]
    Definition Classes
    IterableOps
  215. def zip[B](that: IterableOnce[B]): Seq[(StructField, B)]
    Definition Classes
    IterableOps
  216. def zipAll[A1 >: StructField, B](that: Iterable[B], thisElem: A1, thatElem: B): Seq[(A1, B)]
    Definition Classes
    IterableOps
  217. def zipWithIndex: Seq[(StructField, Int)]
    Definition Classes
    IterableOps → IterableOnceOps

Deprecated Value Members

  1. final def /:[B](z: B)(op: (B, StructField) => B): B
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) Use foldLeft instead of /:

  2. final def :\[B](z: B)(op: (StructField, B) => B): B
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) Use foldRight instead of :\

  3. def aggregate[B](z: => B)(seqop: (B, StructField) => B, combop: (B, B) => B): B
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) For sequential collections, prefer foldLeft(z)(seqop). For parallel collections, use ParIterableLike#aggregate.

  4. def companion: IterableFactory[[_]Seq[_]]
    Definition Classes
    IterableOps
    Annotations
    @deprecated @deprecatedOverriding() @inline()
    Deprecated

    (Since version 2.13.0) Use iterableFactory instead

  5. final def copyToBuffer[B >: StructField](dest: Buffer[B]): Unit
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) Use dest ++= coll instead

  6. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

  7. def hasDefiniteSize: Boolean
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Check .knownSize instead of .hasDefiniteSize for more actionable information (see scaladoc for details)

  8. final def prefixLength(p: (StructField) => Boolean): Int
    Definition Classes
    SeqOps
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) Use segmentLength instead of prefixLength

  9. final def repr: Seq[StructField]
    Definition Classes
    IterableOps
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use coll instead of repr in a collection implementation, use the collection value itself from the outside

  10. def reverseMap[B](f: (StructField) => B): Seq[B]
    Definition Classes
    SeqOps
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use .reverseIterator.map(f).to(...) instead of .reverseMap(f)

  11. def seq: StructType.this.type
    Definition Classes
    Iterable
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Iterable.seq always returns the iterable itself

  12. final def toIterable: StructType.this.type
    Definition Classes
    Iterable → IterableOps
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.7) toIterable is internal and will be made protected; its name is similar to toList or toSeq, but it doesn't copy non-immutable collections

  13. final def toIterator: Iterator[StructField]
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) Use .iterator instead of .toIterator

  14. final def toStream: Stream[StructField]
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) Use .to(LazyList) instead of .toStream

  15. final def toTraversable: Traversable[StructField]
    Definition Classes
    IterableOps
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) toTraversable is internal and will be made protected; its name is similar to toList or toSeq, but it doesn't copy non-immutable collections

  16. final def union[B >: StructField](that: Seq[B]): Seq[B]
    Definition Classes
    SeqOps
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) Use concat instead

  17. def view(from: Int, until: Int): View[StructField]
    Definition Classes
    IterableOps
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use .view.slice(from, until) instead of .view(from, until)

Inherited from Serializable

Inherited from Product

Inherited from Seq[StructField]

Inherited from SeqOps[StructField, Seq, Seq[StructField]]

Inherited from Seq[StructField]

Inherited from Equals

Inherited from SeqOps[StructField, [_]Seq[_], Seq[StructField]]

Inherited from PartialFunction[Int, StructField]

Inherited from (Int) => StructField

Inherited from Iterable[StructField]

Inherited from Iterable[StructField]

Inherited from IterableFactoryDefaults[StructField, [x]Seq[x]]

Inherited from IterableOps[StructField, [_]Seq[_], Seq[StructField]]

Inherited from IterableOnceOps[StructField, [_]Seq[_], Seq[StructField]]

Inherited from IterableOnce[StructField]

Inherited from DataType

Inherited from AbstractDataType

Inherited from AnyRef

Inherited from Any

Ungrouped