@InterfaceStability.Stable public class StructType extends DataType implements scala.collection.Seq<StructField>, scala.Product, scala.Serializable
StructType
object can be constructed by
StructType(fields: Seq[StructField])
For a StructType
object, one or multiple StructField
s can be extracted by names.
If multiple StructField
s 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: Field "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: Field "d" does not exist.
// ...
A 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))
scala.PartialFunction.AndThen<A,B,C>, scala.PartialFunction.Lifted<A,B>, scala.PartialFunction.OrElse<A,B>, scala.PartialFunction.Unlifted<A,B>
scala.collection.SeqLike.CombinationsItr, scala.collection.SeqLike.PermutationsItr
scala.collection.TraversableLike.WithFilter
scala.collection.TraversableOnce.BufferedCanBuildFrom<A,CC extends scala.collection.TraversableOnce<Object>>, scala.collection.TraversableOnce.FlattenOps<A>, scala.collection.TraversableOnce.ForceImplicitAmbiguity, scala.collection.TraversableOnce.MonadOps<A>, scala.collection.TraversableOnce.OnceCanBuildFrom<A>
Constructor and Description |
---|
StructType()
No-arg constructor for kryo.
|
StructType(StructField[] fields) |
Modifier and Type | Method and Description |
---|---|
static <B> B |
$colon$bslash(B z,
scala.Function2<A,B,B> op) |
static <B,That> That |
$colon$plus(B elem,
scala.collection.generic.CanBuildFrom<Repr,B,That> bf) |
static <B> B |
$div$colon(B z,
scala.Function2<B,A,B> op) |
static <B,That> That |
$plus$colon(B elem,
scala.collection.generic.CanBuildFrom<Repr,B,That> bf) |
static <B,That> That |
$plus$plus(scala.collection.GenTraversableOnce<B> that,
scala.collection.generic.CanBuildFrom<Repr,B,That> bf) |
static <B,That> That |
$plus$plus$colon(scala.collection.Traversable<B> that,
scala.collection.generic.CanBuildFrom<Repr,B,That> bf) |
static <B,That> That |
$plus$plus$colon(scala.collection.TraversableOnce<B> that,
scala.collection.generic.CanBuildFrom<Repr,B,That> bf) |
StructType |
add(String name,
DataType dataType)
Creates a new
StructType by adding a new nullable field with no metadata. |
StructType |
add(String name,
DataType dataType,
boolean nullable)
Creates a new
StructType by adding a new field with no metadata. |
StructType |
add(String name,
DataType dataType,
boolean nullable,
Metadata metadata)
Creates a new
StructType by adding a new field and specifying metadata. |
StructType |
add(String name,
DataType dataType,
boolean nullable,
String comment)
Creates a new
StructType by adding a new field and specifying metadata. |
StructType |
add(String name,
String dataType)
Creates a new
StructType by adding a new nullable field with no metadata where the
dataType is specified as a String. |
StructType |
add(String name,
String dataType,
boolean nullable)
Creates a new
StructType by adding a new field with no metadata where the
dataType is specified as a String. |
StructType |
add(String name,
String dataType,
boolean nullable,
Metadata metadata)
Creates a new
StructType by adding a new field and specifying metadata where the
dataType is specified as a String. |
StructType |
add(String name,
String dataType,
boolean nullable,
String comment)
Creates a new
StructType by adding a new field and specifying metadata where the
dataType is specified as a String. |
StructType |
add(StructField field)
Creates a new
StructType by adding a new field. |
static scala.collection.mutable.StringBuilder |
addString(scala.collection.mutable.StringBuilder b) |
static scala.collection.mutable.StringBuilder |
addString(scala.collection.mutable.StringBuilder b,
String sep) |
static scala.collection.mutable.StringBuilder |
addString(scala.collection.mutable.StringBuilder b,
String start,
String sep,
String end) |
static <B> B |
aggregate(scala.Function0<B> z,
scala.Function2<B,A,B> seqop,
scala.Function2<B,B,B> combop) |
static <C> scala.PartialFunction<A,C> |
andThen(scala.Function1<B,C> k) |
StructField |
apply(int fieldIndex) |
StructType |
apply(scala.collection.immutable.Set<String> names)
Returns a
StructType containing StructField s of the given names, preserving the
original order of fields. |
StructField |
apply(String name)
Extracts the
StructField with the given name. |
static <A1 extends A,B1> |
applyOrElse(A1 x,
scala.Function1<A1,B1> default_) |
static boolean |
canEqual(Object that) |
String |
catalogString()
String representation for the type saved in external catalogs.
|
static <B,That> That |
collect(scala.PartialFunction<A,B> pf,
scala.collection.generic.CanBuildFrom<Repr,B,That> bf) |
static <B> scala.Option<B> |
collectFirst(scala.PartialFunction<A,B> pf) |
static scala.collection.Iterator<Repr> |
combinations(int n) |
static scala.collection.generic.GenericCompanion<scala.collection.Seq> |
companion() |
static <A> scala.Function1<A,R> |
compose(scala.Function1<A,T1> g) |
static <A1> boolean |
contains(A1 elem) |
static <B> boolean |
containsSlice(scala.collection.GenSeq<B> that) |
static <B> void |
copyToArray(Object xs) |
static <B> void |
copyToArray(Object xs,
int start) |
static <B> void |
copyToArray(Object xs,
int start,
int len) |
static <B> void |
copyToBuffer(scala.collection.mutable.Buffer<B> dest) |
static <B> boolean |
corresponds(scala.collection.GenSeq<B> that,
scala.Function2<A,B,Object> p) |
static int |
count(scala.Function1<A,Object> p) |
int |
defaultSize()
The default size of a value of the StructType is the total default sizes of all field types.
|
static <B> Repr |
diff(scala.collection.GenSeq<B> that) |
static Repr |
distinct() |
static Repr |
drop(int n) |
static Repr |
dropRight(int n) |
static Repr |
dropWhile(scala.Function1<A,Object> p) |
static <B> boolean |
endsWith(scala.collection.GenSeq<B> that) |
boolean |
equals(Object that) |
static boolean |
exists(scala.Function1<A,Object> p) |
int |
fieldIndex(String name)
Returns the index of a given field.
|
String[] |
fieldNames()
Returns all field names in an array.
|
StructField[] |
fields() |
static Repr |
filter(scala.Function1<A,Object> p) |
static Repr |
filterNot(scala.Function1<A,Object> p) |
static scala.Option<A> |
find(scala.Function1<A,Object> p) |
static <B,That> That |
flatMap(scala.Function1<A,scala.collection.GenTraversableOnce<B>> f,
scala.collection.generic.CanBuildFrom<Repr,B,That> bf) |
static <B> CC |
flatten(scala.Function1<A,scala.collection.GenTraversableOnce<B>> asTraversable) |
static <A1> A1 |
fold(A1 z,
scala.Function2<A1,A1,A1> op) |
static <B> B |
foldLeft(B z,
scala.Function2<B,A,B> op) |
static <B> B |
foldRight(B z,
scala.Function2<A,B,B> op) |
static boolean |
forall(scala.Function1<A,Object> p) |
abstract static <U> void |
foreach(scala.Function1<A,U> f) |
static <U> void |
foreach(scala.Function1<A,U> f) |
static StructType |
fromDDL(String ddl)
Creates StructType for a given DDL-formatted string, which is a comma separated list of field
definitions, e.g., a INT, b STRING.
|
static <B> scala.collection.mutable.Builder<B,CC> |
genericBuilder() |
static <K> scala.collection.immutable.Map<K,Repr> |
groupBy(scala.Function1<A,K> f) |
static scala.collection.Iterator<Repr> |
grouped(int size) |
static boolean |
hasDefiniteSize() |
int |
hashCode() |
abstract static A |
head() |
static A |
head() |
static scala.Option<A> |
headOption() |
static <B> int |
indexOf(B elem) |
static <B> int |
indexOf(B elem,
int from) |
static <B> int |
indexOfSlice(scala.collection.GenSeq<B> that) |
static <B> int |
indexOfSlice(scala.collection.GenSeq<B> that,
int from) |
static int |
indexWhere(scala.Function1<A,Object> p) |
static int |
indexWhere(scala.Function1<A,Object> p,
int from) |
static scala.collection.immutable.Range |
indices() |
static Repr |
init() |
static scala.collection.Iterator<Repr> |
inits() |
static <B> Repr |
intersect(scala.collection.GenSeq<B> that) |
abstract static boolean |
isDefinedAt(A x) |
abstract static boolean |
isEmpty() |
static boolean |
isTraversableAgain() |
scala.collection.Iterator<StructField> |
iterator() |
static String |
json() |
static A |
last() |
static <B> int |
lastIndexOf(B elem) |
static <B> int |
lastIndexOf(B elem,
int end) |
static <B> int |
lastIndexOfSlice(scala.collection.GenSeq<B> that) |
static <B> int |
lastIndexOfSlice(scala.collection.GenSeq<B> that,
int end) |
static int |
lastIndexWhere(scala.Function1<A,Object> p) |
static int |
lastIndexWhere(scala.Function1<A,Object> p,
int end) |
static scala.Option<A> |
lastOption() |
int |
length() |
static int |
lengthCompare(int len) |
static scala.Function1<A,scala.Option<B>> |
lift() |
static <B,That> That |
map(scala.Function1<A,B> f,
scala.collection.generic.CanBuildFrom<Repr,B,That> bf) |
static <B> A |
max(scala.math.Ordering<B> cmp) |
static <B> A |
maxBy(scala.Function1<A,B> f,
scala.math.Ordering<B> cmp) |
static <B> A |
min(scala.math.Ordering<B> cmp) |
static <B> A |
minBy(scala.Function1<A,B> f,
scala.math.Ordering<B> cmp) |
static String |
mkString() |
static String |
mkString(String sep) |
static String |
mkString(String start,
String sep,
String end) |
static boolean |
nonEmpty() |
static <A1 extends A,B1> |
orElse(scala.PartialFunction<A1,B1> that) |
static <B,That> That |
padTo(int len,
B elem,
scala.collection.generic.CanBuildFrom<Repr,B,That> bf) |
static ParRepr |
par() |
static scala.Tuple2<Repr,Repr> |
partition(scala.Function1<A,Object> p) |
static <B,That> That |
patch(int from,
scala.collection.GenSeq<B> patch,
int replaced,
scala.collection.generic.CanBuildFrom<Repr,B,That> bf) |
static scala.collection.Iterator<Repr> |
permutations() |
static int |
prefixLength(scala.Function1<A,Object> p) |
static String |
prettyJson() |
void |
printTreeString() |
static <B> B |
product(scala.math.Numeric<B> num) |
abstract static int |
productArity() |
abstract static Object |
productElement(int n) |
static scala.collection.Iterator<Object> |
productIterator() |
static String |
productPrefix() |
static <A1> A1 |
reduce(scala.Function2<A1,A1,A1> op) |
static <B> B |
reduceLeft(scala.Function2<B,A,B> op) |
static <B> scala.Option<B> |
reduceLeftOption(scala.Function2<B,A,B> op) |
static <A1> scala.Option<A1> |
reduceOption(scala.Function2<A1,A1,A1> op) |
static <B> B |
reduceRight(scala.Function2<A,B,B> op) |
static <B> scala.Option<B> |
reduceRightOption(scala.Function2<A,B,B> op) |
static Repr |
repr() |
static Repr |
reverse() |
static scala.collection.Iterator<A> |
reverseIterator() |
static <B,That> That |
reverseMap(scala.Function1<A,B> f,
scala.collection.generic.CanBuildFrom<Repr,B,That> bf) |
static <U> scala.Function1<A,Object> |
runWith(scala.Function1<B,U> action) |
static <B> boolean |
sameElements(scala.collection.GenIterable<B> that) |
static <B,That> That |
scan(B z,
scala.Function2<B,B,B> op,
scala.collection.generic.CanBuildFrom<Repr,B,That> cbf) |
static <B,That> That |
scanLeft(B z,
scala.Function2<B,A,B> op,
scala.collection.generic.CanBuildFrom<Repr,B,That> bf) |
static <B,That> That |
scanRight(B z,
scala.Function2<A,B,B> op,
scala.collection.generic.CanBuildFrom<Repr,B,That> bf) |
static int |
segmentLength(scala.Function1<A,Object> p,
int from) |
static scala.collection.Seq<A> |
seq() |
String |
simpleString()
Readable string representation for the type.
|
static int |
size() |
static Repr |
slice(int from,
int until) |
static scala.collection.Iterator<Repr> |
sliding(int size) |
static scala.collection.Iterator<Repr> |
sliding(int size,
int step) |
static <B> Repr |
sortBy(scala.Function1<A,B> f,
scala.math.Ordering<B> ord) |
static <B> Repr |
sorted(scala.math.Ordering<B> ord) |
static Repr |
sortWith(scala.Function2<A,A,Object> lt) |
static scala.Tuple2<Repr,Repr> |
span(scala.Function1<A,Object> p) |
static scala.Tuple2<Repr,Repr> |
splitAt(int n) |
String |
sql() |
static <B> boolean |
startsWith(scala.collection.GenSeq<B> that) |
static <B> boolean |
startsWith(scala.collection.GenSeq<B> that,
int offset) |
static String |
stringPrefix() |
static <B> B |
sum(scala.math.Numeric<B> num) |
static Repr |
tail() |
static scala.collection.Iterator<Repr> |
tails() |
static Repr |
take(int n) |
static Repr |
takeRight(int n) |
static Repr |
takeWhile(scala.Function1<A,Object> p) |
static <Col> Col |
to(scala.collection.generic.CanBuildFrom<scala.runtime.Nothing$,A,Col> cbf) |
static <B> Object |
toArray(scala.reflect.ClassTag<B> evidence$1) |
static <B> scala.collection.mutable.Buffer<B> |
toBuffer() |
static scala.collection.immutable.IndexedSeq<A> |
toIndexedSeq() |
static scala.collection.Iterable<A> |
toIterable() |
static scala.collection.Iterator<A> |
toIterator() |
static scala.collection.immutable.List<A> |
toList() |
static <T,U> scala.collection.immutable.Map<T,U> |
toMap(scala.Predef.$less$colon$less<A,scala.Tuple2<T,U>> ev) |
static scala.collection.Seq<A> |
toSeq() |
static <B> scala.collection.immutable.Set<B> |
toSet() |
static scala.collection.immutable.Stream<A> |
toStream() |
static String |
toString() |
static scala.collection.Traversable<A> |
toTraversable() |
static scala.collection.immutable.Vector<A> |
toVector() |
static <B> CC |
transpose(scala.Function1<A,scala.collection.GenTraversableOnce<B>> asTraversable) |
String |
treeString() |
static String |
typeName() |
static <B,That> That |
union(scala.collection.GenSeq<B> that,
scala.collection.generic.CanBuildFrom<Repr,B,That> bf) |
static <A1,A2> scala.Tuple2<CC,CC> |
unzip(scala.Function1<A,scala.Tuple2<A1,A2>> asPair) |
static <A1,A2,A3> scala.Tuple3<CC,CC,CC> |
unzip3(scala.Function1<A,scala.Tuple3<A1,A2,A3>> asTriple) |
static <B,That> That |
updated(int index,
B elem,
scala.collection.generic.CanBuildFrom<Repr,B,That> bf) |
static Object |
view() |
static scala.collection.SeqView<A,Repr> |
view(int from,
int until) |
static scala.collection.generic.FilterMonadic<A,Repr> |
withFilter(scala.Function1<A,Object> p) |
static <A1,B,That> |
zip(scala.collection.GenIterable<B> that,
scala.collection.generic.CanBuildFrom<Repr,scala.Tuple2<A1,B>,That> bf) |
static <B,A1,That> |
zipAll(scala.collection.GenIterable<B> that,
A1 thisElem,
B thatElem,
scala.collection.generic.CanBuildFrom<Repr,scala.Tuple2<A1,B>,That> bf) |
static <A1,That> That |
zipWithIndex(scala.collection.generic.CanBuildFrom<Repr,scala.Tuple2<A1,Object>,That> bf) |
equalsStructurally, fromJson, json, prettyJson, typeName
andThen, applyOrElse, isDefinedAt, lift, orElse, runWith
apply, apply$mcDD$sp, apply$mcDF$sp, apply$mcDI$sp, apply$mcDJ$sp, apply$mcFD$sp, apply$mcFF$sp, apply$mcFI$sp, apply$mcFJ$sp, apply$mcID$sp, apply$mcIF$sp, apply$mcII$sp, apply$mcIJ$sp, apply$mcJD$sp, apply$mcJF$sp, apply$mcJI$sp, apply$mcJJ$sp, apply$mcVD$sp, apply$mcVF$sp, apply$mcVI$sp, apply$mcVJ$sp, apply$mcZD$sp, apply$mcZF$sp, apply$mcZI$sp, apply$mcZJ$sp, compose, toString
flatten, foreach, genericBuilder, head, isEmpty, transpose, unzip, unzip3
$colon$plus, $plus$colon, combinations, contains, containsSlice, corresponds, diff, distinct, endsWith, indexOfSlice, indexOfSlice, indexWhere, indices, intersect, isEmpty, lastIndexOfSlice, lastIndexOfSlice, lastIndexWhere, lengthCompare, padTo, parCombiner, patch, permutations, reverse, reverseIterator, reverseMap, segmentLength, size, sortBy, sorted, sortWith, startsWith, thisCollection, toCollection, toSeq, toString, union, updated, view, view
canEqual, copyToArray, drop, dropRight, exists, find, foldRight, forall, foreach, grouped, head, reduceRight, sameElements, slice, sliding, sliding, take, takeRight, takeWhile, toIterable, toIterator, toStream, zip, zipAll, zipWithIndex
$plus$plus, $plus$plus$colon, $plus$plus$colon, collect, dropWhile, filter, filterNot, flatMap, groupBy, hasDefiniteSize, headOption, init, inits, isTraversableAgain, last, lastOption, map, newBuilder, partition, repr, scan, scanLeft, scanRight, sliceWithKnownBound, sliceWithKnownDelta, span, splitAt, stringPrefix, tail, tails, to, toTraversable, withFilter
$colon$bslash, $div$colon, addString, addString, addString, aggregate, collectFirst, copyToArray, copyToArray, copyToBuffer, count, fold, foldLeft, max, maxBy, min, minBy, mkString, mkString, mkString, nonEmpty, product, reduce, reduceLeft, reduceLeftOption, reduceOption, reduceRightOption, reversed, sum, toArray, toBuffer, toIndexedSeq, toList, toMap, toSet, toVector
public StructType(StructField[] fields)
public StructType()
public static StructType fromDDL(String ddl)
ddl
- (undocumented)public static String typeName()
public static String json()
public static String prettyJson()
public static <A> scala.Function1<A,R> compose(scala.Function1<A,T1> g)
public static String toString()
public abstract static boolean isDefinedAt(A x)
public static <A1 extends A,B1> scala.PartialFunction<A1,B1> orElse(scala.PartialFunction<A1,B1> that)
public static <C> scala.PartialFunction<A,C> andThen(scala.Function1<B,C> k)
public static scala.Function1<A,scala.Option<B>> lift()
public static <A1 extends A,B1> B1 applyOrElse(A1 x, scala.Function1<A1,B1> default_)
public static <U> scala.Function1<A,Object> runWith(scala.Function1<B,U> action)
public static boolean nonEmpty()
public static int count(scala.Function1<A,Object> p)
public static <B> scala.Option<B> collectFirst(scala.PartialFunction<A,B> pf)
public static <B> B $div$colon(B z, scala.Function2<B,A,B> op)
public static <B> B $colon$bslash(B z, scala.Function2<A,B,B> op)
public static <B> B foldLeft(B z, scala.Function2<B,A,B> op)
public static <B> B reduceLeft(scala.Function2<B,A,B> op)
public static <B> scala.Option<B> reduceLeftOption(scala.Function2<B,A,B> op)
public static <B> scala.Option<B> reduceRightOption(scala.Function2<A,B,B> op)
public static <A1> A1 reduce(scala.Function2<A1,A1,A1> op)
public static <A1> scala.Option<A1> reduceOption(scala.Function2<A1,A1,A1> op)
public static <A1> A1 fold(A1 z, scala.Function2<A1,A1,A1> op)
public static <B> B aggregate(scala.Function0<B> z, scala.Function2<B,A,B> seqop, scala.Function2<B,B,B> combop)
public static <B> B sum(scala.math.Numeric<B> num)
public static <B> B product(scala.math.Numeric<B> num)
public static <B> A min(scala.math.Ordering<B> cmp)
public static <B> A max(scala.math.Ordering<B> cmp)
public static <B> A maxBy(scala.Function1<A,B> f, scala.math.Ordering<B> cmp)
public static <B> A minBy(scala.Function1<A,B> f, scala.math.Ordering<B> cmp)
public static <B> void copyToBuffer(scala.collection.mutable.Buffer<B> dest)
public static <B> void copyToArray(Object xs, int start)
public static <B> void copyToArray(Object xs)
public static <B> Object toArray(scala.reflect.ClassTag<B> evidence$1)
public static scala.collection.immutable.List<A> toList()
public static scala.collection.immutable.IndexedSeq<A> toIndexedSeq()
public static <B> scala.collection.mutable.Buffer<B> toBuffer()
public static <B> scala.collection.immutable.Set<B> toSet()
public static scala.collection.immutable.Vector<A> toVector()
public static <T,U> scala.collection.immutable.Map<T,U> toMap(scala.Predef.$less$colon$less<A,scala.Tuple2<T,U>> ev)
public static String mkString(String start, String sep, String end)
public static String mkString(String sep)
public static String mkString()
public static scala.collection.mutable.StringBuilder addString(scala.collection.mutable.StringBuilder b, String start, String sep, String end)
public static scala.collection.mutable.StringBuilder addString(scala.collection.mutable.StringBuilder b, String sep)
public static scala.collection.mutable.StringBuilder addString(scala.collection.mutable.StringBuilder b)
public static ParRepr par()
public static Repr repr()
public static final boolean isTraversableAgain()
public static boolean hasDefiniteSize()
public static <B,That> That $plus$plus(scala.collection.GenTraversableOnce<B> that, scala.collection.generic.CanBuildFrom<Repr,B,That> bf)
public static <B,That> That $plus$plus$colon(scala.collection.TraversableOnce<B> that, scala.collection.generic.CanBuildFrom<Repr,B,That> bf)
public static <B,That> That $plus$plus$colon(scala.collection.Traversable<B> that, scala.collection.generic.CanBuildFrom<Repr,B,That> bf)
public static <B,That> That map(scala.Function1<A,B> f, scala.collection.generic.CanBuildFrom<Repr,B,That> bf)
public static <B,That> That flatMap(scala.Function1<A,scala.collection.GenTraversableOnce<B>> f, scala.collection.generic.CanBuildFrom<Repr,B,That> bf)
public static Repr filter(scala.Function1<A,Object> p)
public static Repr filterNot(scala.Function1<A,Object> p)
public static <B,That> That collect(scala.PartialFunction<A,B> pf, scala.collection.generic.CanBuildFrom<Repr,B,That> bf)
public static scala.Tuple2<Repr,Repr> partition(scala.Function1<A,Object> p)
public static <K> scala.collection.immutable.Map<K,Repr> groupBy(scala.Function1<A,K> f)
public static <B,That> That scan(B z, scala.Function2<B,B,B> op, scala.collection.generic.CanBuildFrom<Repr,B,That> cbf)
public static <B,That> That scanLeft(B z, scala.Function2<B,A,B> op, scala.collection.generic.CanBuildFrom<Repr,B,That> bf)
public static <B,That> That scanRight(B z, scala.Function2<A,B,B> op, scala.collection.generic.CanBuildFrom<Repr,B,That> bf)
public static scala.Option<A> headOption()
public static Repr tail()
public static A last()
public static scala.Option<A> lastOption()
public static Repr init()
public static Repr dropWhile(scala.Function1<A,Object> p)
public static scala.Tuple2<Repr,Repr> span(scala.Function1<A,Object> p)
public static scala.Tuple2<Repr,Repr> splitAt(int n)
public static scala.collection.Iterator<Repr> tails()
public static scala.collection.Iterator<Repr> inits()
public static scala.collection.Traversable<A> toTraversable()
public static <Col> Col to(scala.collection.generic.CanBuildFrom<scala.runtime.Nothing$,A,Col> cbf)
public static String stringPrefix()
public static scala.collection.generic.FilterMonadic<A,Repr> withFilter(scala.Function1<A,Object> p)
public abstract static <U> void foreach(scala.Function1<A,U> f)
public abstract static A head()
public abstract static boolean isEmpty()
public static <B> scala.collection.mutable.Builder<B,CC> genericBuilder()
public static <A1,A2> scala.Tuple2<CC,CC> unzip(scala.Function1<A,scala.Tuple2<A1,A2>> asPair)
public static <A1,A2,A3> scala.Tuple3<CC,CC,CC> unzip3(scala.Function1<A,scala.Tuple3<A1,A2,A3>> asTriple)
public static <B> CC flatten(scala.Function1<A,scala.collection.GenTraversableOnce<B>> asTraversable)
public static <B> CC transpose(scala.Function1<A,scala.collection.GenTraversableOnce<B>> asTraversable)
public static <U> void foreach(scala.Function1<A,U> f)
public static boolean forall(scala.Function1<A,Object> p)
public static boolean exists(scala.Function1<A,Object> p)
public static scala.Option<A> find(scala.Function1<A,Object> p)
public static <B> B foldRight(B z, scala.Function2<A,B,B> op)
public static <B> B reduceRight(scala.Function2<A,B,B> op)
public static scala.collection.Iterable<A> toIterable()
public static scala.collection.Iterator<A> toIterator()
public static A head()
public static Repr slice(int from, int until)
public static Repr take(int n)
public static Repr drop(int n)
public static Repr takeWhile(scala.Function1<A,Object> p)
public static scala.collection.Iterator<Repr> grouped(int size)
public static scala.collection.Iterator<Repr> sliding(int size)
public static scala.collection.Iterator<Repr> sliding(int size, int step)
public static Repr takeRight(int n)
public static Repr dropRight(int n)
public static <B> void copyToArray(Object xs, int start, int len)
public static <A1,B,That> That zip(scala.collection.GenIterable<B> that, scala.collection.generic.CanBuildFrom<Repr,scala.Tuple2<A1,B>,That> bf)
public static <B,A1,That> That zipAll(scala.collection.GenIterable<B> that, A1 thisElem, B thatElem, scala.collection.generic.CanBuildFrom<Repr,scala.Tuple2<A1,B>,That> bf)
public static <A1,That> That zipWithIndex(scala.collection.generic.CanBuildFrom<Repr,scala.Tuple2<A1,Object>,That> bf)
public static <B> boolean sameElements(scala.collection.GenIterable<B> that)
public static scala.collection.immutable.Stream<A> toStream()
public static boolean canEqual(Object that)
public static int prefixLength(scala.Function1<A,Object> p)
public static int indexWhere(scala.Function1<A,Object> p)
public static <B> int indexOf(B elem)
public static <B> int indexOf(B elem, int from)
public static <B> int lastIndexOf(B elem)
public static <B> int lastIndexOf(B elem, int end)
public static int lastIndexWhere(scala.Function1<A,Object> p)
public static <B> boolean startsWith(scala.collection.GenSeq<B> that)
public static int lengthCompare(int len)
public static int size()
public static int segmentLength(scala.Function1<A,Object> p, int from)
public static int indexWhere(scala.Function1<A,Object> p, int from)
public static int lastIndexWhere(scala.Function1<A,Object> p, int end)
public static scala.collection.Iterator<Repr> permutations()
public static scala.collection.Iterator<Repr> combinations(int n)
public static Repr reverse()
public static <B,That> That reverseMap(scala.Function1<A,B> f, scala.collection.generic.CanBuildFrom<Repr,B,That> bf)
public static scala.collection.Iterator<A> reverseIterator()
public static <B> boolean startsWith(scala.collection.GenSeq<B> that, int offset)
public static <B> boolean endsWith(scala.collection.GenSeq<B> that)
public static <B> int indexOfSlice(scala.collection.GenSeq<B> that)
public static <B> int indexOfSlice(scala.collection.GenSeq<B> that, int from)
public static <B> int lastIndexOfSlice(scala.collection.GenSeq<B> that)
public static <B> int lastIndexOfSlice(scala.collection.GenSeq<B> that, int end)
public static <B> boolean containsSlice(scala.collection.GenSeq<B> that)
public static <A1> boolean contains(A1 elem)
public static <B,That> That union(scala.collection.GenSeq<B> that, scala.collection.generic.CanBuildFrom<Repr,B,That> bf)
public static <B> Repr diff(scala.collection.GenSeq<B> that)
public static <B> Repr intersect(scala.collection.GenSeq<B> that)
public static Repr distinct()
public static <B,That> That patch(int from, scala.collection.GenSeq<B> patch, int replaced, scala.collection.generic.CanBuildFrom<Repr,B,That> bf)
public static <B,That> That updated(int index, B elem, scala.collection.generic.CanBuildFrom<Repr,B,That> bf)
public static <B,That> That $plus$colon(B elem, scala.collection.generic.CanBuildFrom<Repr,B,That> bf)
public static <B,That> That $colon$plus(B elem, scala.collection.generic.CanBuildFrom<Repr,B,That> bf)
public static <B,That> That padTo(int len, B elem, scala.collection.generic.CanBuildFrom<Repr,B,That> bf)
public static <B> boolean corresponds(scala.collection.GenSeq<B> that, scala.Function2<A,B,Object> p)
public static Repr sortWith(scala.Function2<A,A,Object> lt)
public static <B> Repr sortBy(scala.Function1<A,B> f, scala.math.Ordering<B> ord)
public static <B> Repr sorted(scala.math.Ordering<B> ord)
public static scala.collection.Seq<A> toSeq()
public static scala.collection.immutable.Range indices()
public static Object view()
public static scala.collection.SeqView<A,Repr> view(int from, int until)
public static scala.collection.generic.GenericCompanion<scala.collection.Seq> companion()
public static scala.collection.Seq<A> seq()
public abstract static Object productElement(int n)
public abstract static int productArity()
public static scala.collection.Iterator<Object> productIterator()
public static String productPrefix()
public StructField[] fields()
public String[] fieldNames()
public boolean equals(Object that)
equals
in interface scala.collection.GenSeqLike<StructField,scala.collection.Seq<StructField>>
equals
in interface scala.Equals
equals
in class Object
public int hashCode()
hashCode
in interface scala.collection.GenSeqLike<StructField,scala.collection.Seq<StructField>>
hashCode
in class Object
public StructType add(StructField field)
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))
field
- (undocumented)public StructType add(String name, DataType dataType)
StructType
by adding a new nullable field with no metadata.
val struct = (new StructType) .add("a", IntegerType) .add("b", LongType) .add("c", StringType)
name
- (undocumented)dataType
- (undocumented)public StructType add(String name, DataType dataType, boolean nullable)
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)
name
- (undocumented)dataType
- (undocumented)nullable
- (undocumented)public StructType add(String name, DataType dataType, boolean nullable, Metadata metadata)
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)
name
- (undocumented)dataType
- (undocumented)nullable
- (undocumented)metadata
- (undocumented)public StructType add(String name, DataType dataType, boolean nullable, String comment)
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")
name
- (undocumented)dataType
- (undocumented)nullable
- (undocumented)comment
- (undocumented)public StructType add(String name, String dataType)
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")
name
- (undocumented)dataType
- (undocumented)public StructType add(String name, String dataType, boolean nullable)
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)
name
- (undocumented)dataType
- (undocumented)nullable
- (undocumented)public StructType add(String name, String dataType, boolean nullable, Metadata metadata)
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)
name
- (undocumented)dataType
- (undocumented)nullable
- (undocumented)metadata
- (undocumented)public StructType add(String name, String dataType, boolean nullable, String comment)
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")
name
- (undocumented)dataType
- (undocumented)nullable
- (undocumented)comment
- (undocumented)public StructField apply(String name)
StructField
with the given name.
name
- (undocumented)IllegalArgumentException
- if a field with the given name does not existpublic StructType apply(scala.collection.immutable.Set<String> names)
StructType
containing StructField
s of the given names, preserving the
original order of fields.
names
- (undocumented)IllegalArgumentException
- if a field cannot be found for any of the given namespublic int fieldIndex(String name)
name
- (undocumented)IllegalArgumentException
- if a field with the given name does not existpublic String treeString()
public void printTreeString()
public StructField apply(int fieldIndex)
apply
in interface scala.collection.GenSeqLike<StructField,scala.collection.Seq<StructField>>
apply
in interface scala.collection.SeqLike<StructField,scala.collection.Seq<StructField>>
public int length()
length
in interface scala.collection.GenSeqLike<StructField,scala.collection.Seq<StructField>>
length
in interface scala.collection.SeqLike<StructField,scala.collection.Seq<StructField>>
public scala.collection.Iterator<StructField> iterator()
iterator
in interface scala.collection.GenIterableLike<StructField,scala.collection.Seq<StructField>>
iterator
in interface scala.collection.IterableLike<StructField,scala.collection.Seq<StructField>>
public int defaultSize()
defaultSize
in class DataType
public String simpleString()
DataType
simpleString
in class DataType
public String catalogString()
DataType
catalogString
in class DataType