summaryrefslogtreecommitdiff
path: root/site/docs/1.5.0/api/java/org/apache/spark/sql/types/StructType.html
blob: 4e594c593b38ba08e655283a7e0df329343d3e6c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_51) on Wed Sep 16 15:55:13 PDT 2015 -->
<title>StructType</title>
<meta name="date" content="2015-09-16">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="StructType";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/spark/sql/types/TimestampType.html" title="class in org.apache.spark.sql.types"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/spark/sql/types/StructType.html" target="_top">Frames</a></li>
<li><a href="StructType.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.spark.sql.types</div>
<h2 title="Class StructType" class="title">Class StructType</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li><a href="../../../../../org/apache/spark/sql/types/DataType.html" title="class in org.apache.spark.sql.types">org.apache.spark.sql.types.DataType</a></li>
<li>
<ul class="inheritance">
<li>org.apache.spark.sql.types.StructType</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd>java.io.Serializable, scala.collection.generic.FilterMonadic&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>,scala.collection.Seq&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>&gt;&gt;, scala.collection.generic.GenericTraversableTemplate&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>,scala.collection.Seq&gt;, scala.collection.generic.HasNewBuilder&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>,scala.collection.Seq&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>&gt;&gt;, scala.collection.GenIterable&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>&gt;, scala.collection.GenIterableLike&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>,scala.collection.Seq&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>&gt;&gt;, scala.collection.GenSeq&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>&gt;, scala.collection.GenSeqLike&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>,scala.collection.Seq&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>&gt;&gt;, scala.collection.GenTraversable&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>&gt;, scala.collection.GenTraversableLike&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>,scala.collection.Seq&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>&gt;&gt;, scala.collection.GenTraversableOnce&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>&gt;, scala.collection.Iterable&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>&gt;, scala.collection.IterableLike&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>,scala.collection.Seq&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>&gt;&gt;, scala.collection.Parallelizable&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>,scala.collection.parallel.ParSeq&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>&gt;&gt;, scala.collection.Seq&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>&gt;, scala.collection.SeqLike&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>,scala.collection.Seq&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>&gt;&gt;, scala.collection.Traversable&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>&gt;, scala.collection.TraversableLike&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>,scala.collection.Seq&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>&gt;&gt;, scala.collection.TraversableOnce&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>&gt;, scala.Equals, scala.Function1&lt;java.lang.Object,<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>&gt;, scala.PartialFunction&lt;java.lang.Object,<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>&gt;, scala.Product</dd>
</dl>
<hr>
<br>
<pre>public class <span class="strong">StructType</span>
extends <a href="../../../../../org/apache/spark/sql/types/DataType.html" title="class in org.apache.spark.sql.types">DataType</a>
implements scala.collection.Seq&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>&gt;, scala.Product, scala.Serializable</pre>
<div class="block">:: DeveloperApi ::
 A <a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types"><code>StructType</code></a> object can be constructed by
 <pre><code>
 StructType(fields: Seq[StructField])
 </code></pre>
 For a <a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types"><code>StructType</code></a> object, one or multiple <a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types"><code>StructField</code></a>s can be extracted by names.
 If multiple <a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types"><code>StructField</code></a>s are extracted, a <a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types"><code>StructType</code></a> 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 <code>null</code> will be returned.
 Example:
 <pre><code>
 import org.apache.spark.sql._

 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)

 // This struct does not have a field called "d". null will be returned.
 val nonExisting = struct("d")
 // nonExisting: StructField = null

 // 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(List(StructField(b,LongType,false), StructField(c,BooleanType,false)))

 // Any names without matching fields will be ignored.
 // For the case shown below, "d" will be ignored and
 // it is treated as struct(Set("b", "c")).
 val ignoreNonExisting = struct(Set("b", "c", "d"))
 // ignoreNonExisting: StructType =
 //   StructType(List(StructField(b,LongType,false), StructField(c,BooleanType,false)))
 </code></pre>
 <p>
 A <a href="../../../../../org/apache/spark/sql/Row.html" title="interface in org.apache.spark.sql"><code>Row</code></a> object is used as a value of the StructType.
 Example:
 <pre><code>
 import org.apache.spark.sql._

 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))
 // row: Row = {&#64;link 1,2,true}
 </code></pre></div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../serialized-form.html#org.apache.spark.sql.types.StructType">Serialized Form</a></dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested_class_summary">
<!--   -->
</a>
<h3>Nested Class Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="nested_classes_inherited_from_class_scala.PartialFunction">
<!--   -->
</a>
<h3>Nested classes/interfaces inherited from interface&nbsp;scala.PartialFunction</h3>
<code>scala.PartialFunction.AndThen&lt;A,B,C&gt;, scala.PartialFunction.Lifted&lt;A,B&gt;, scala.PartialFunction.OrElse&lt;A,B&gt;, scala.PartialFunction.Unlifted&lt;A,B&gt;</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="nested_classes_inherited_from_class_scala.collection.SeqLike">
<!--   -->
</a>
<h3>Nested classes/interfaces inherited from interface&nbsp;scala.collection.SeqLike</h3>
<code>scala.collection.SeqLike.CombinationsItr, scala.collection.SeqLike.PermutationsItr</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="nested_classes_inherited_from_class_scala.collection.TraversableLike">
<!--   -->
</a>
<h3>Nested classes/interfaces inherited from interface&nbsp;scala.collection.TraversableLike</h3>
<code>scala.collection.TraversableLike.WithFilter</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="nested_classes_inherited_from_class_scala.collection.TraversableOnce">
<!--   -->
</a>
<h3>Nested classes/interfaces inherited from interface&nbsp;scala.collection.TraversableOnce</h3>
<code>scala.collection.TraversableOnce.BufferedCanBuildFrom&lt;A,Coll extends scala.collection.TraversableOnce&lt;java.lang.Object&gt;&gt;, scala.collection.TraversableOnce.FlattenOps&lt;A&gt;, scala.collection.TraversableOnce.ForceImplicitAmbiguity, scala.collection.TraversableOnce.MonadOps&lt;A&gt;, scala.collection.TraversableOnce.OnceCanBuildFrom&lt;A&gt;</code></li>
</ul>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/spark/sql/types/StructType.html#StructType()">StructType</a></strong>()</code>
<div class="block">No-arg constructor for kryo.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/spark/sql/types/StructType.html#StructType(org.apache.spark.sql.types.StructField[])">StructType</a></strong>(<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>[]&nbsp;fields)</code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types">StructType</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/sql/types/StructType.html#add(java.lang.String, org.apache.spark.sql.types.DataType)">add</a></strong>(java.lang.String&nbsp;name,
   <a href="../../../../../org/apache/spark/sql/types/DataType.html" title="class in org.apache.spark.sql.types">DataType</a>&nbsp;dataType)</code>
<div class="block">Creates a new <a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types"><code>StructType</code></a> by adding a new nullable field with no metadata.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types">StructType</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/sql/types/StructType.html#add(java.lang.String, org.apache.spark.sql.types.DataType, boolean)">add</a></strong>(java.lang.String&nbsp;name,
   <a href="../../../../../org/apache/spark/sql/types/DataType.html" title="class in org.apache.spark.sql.types">DataType</a>&nbsp;dataType,
   boolean&nbsp;nullable)</code>
<div class="block">Creates a new <a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types"><code>StructType</code></a> by adding a new field with no metadata.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types">StructType</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/sql/types/StructType.html#add(java.lang.String, org.apache.spark.sql.types.DataType, boolean, org.apache.spark.sql.types.Metadata)">add</a></strong>(java.lang.String&nbsp;name,
   <a href="../../../../../org/apache/spark/sql/types/DataType.html" title="class in org.apache.spark.sql.types">DataType</a>&nbsp;dataType,
   boolean&nbsp;nullable,
   <a href="../../../../../org/apache/spark/sql/types/Metadata.html" title="class in org.apache.spark.sql.types">Metadata</a>&nbsp;metadata)</code>
<div class="block">Creates a new <a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types"><code>StructType</code></a> by adding a new field and specifying metadata.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types">StructType</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/sql/types/StructType.html#add(java.lang.String, java.lang.String)">add</a></strong>(java.lang.String&nbsp;name,
   java.lang.String&nbsp;dataType)</code>
<div class="block">Creates a new <a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types"><code>StructType</code></a> by adding a new nullable field with no metadata where the
 dataType is specified as a String.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types">StructType</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/sql/types/StructType.html#add(java.lang.String, java.lang.String, boolean)">add</a></strong>(java.lang.String&nbsp;name,
   java.lang.String&nbsp;dataType,
   boolean&nbsp;nullable)</code>
<div class="block">Creates a new <a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types"><code>StructType</code></a> by adding a new field with no metadata where the
 dataType is specified as a String.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types">StructType</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/sql/types/StructType.html#add(java.lang.String, java.lang.String, boolean, org.apache.spark.sql.types.Metadata)">add</a></strong>(java.lang.String&nbsp;name,
   java.lang.String&nbsp;dataType,
   boolean&nbsp;nullable,
   <a href="../../../../../org/apache/spark/sql/types/Metadata.html" title="class in org.apache.spark.sql.types">Metadata</a>&nbsp;metadata)</code>
<div class="block">Creates a new <a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types"><code>StructType</code></a> by adding a new field and specifying metadata where the
 dataType is specified as a String.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types">StructType</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/sql/types/StructType.html#add(org.apache.spark.sql.types.StructField)">add</a></strong>(<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>&nbsp;field)</code>
<div class="block">Creates a new <a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types"><code>StructType</code></a> by adding a new field.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/sql/types/StructType.html#apply(int)">apply</a></strong>(int&nbsp;fieldIndex)</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types">StructType</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/sql/types/StructType.html#apply(scala.collection.immutable.Set)">apply</a></strong>(scala.collection.immutable.Set&lt;java.lang.String&gt;&nbsp;names)</code>
<div class="block">Returns a <a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types"><code>StructType</code></a> containing <a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types"><code>StructField</code></a>s of the given names, preserving the
 original order of fields.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/sql/types/StructType.html#apply(java.lang.String)">apply</a></strong>(java.lang.String&nbsp;name)</code>
<div class="block">Extracts a <a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types"><code>StructField</code></a> of the given name.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/sql/types/StructType.html#defaultSize()">defaultSize</a></strong>()</code>
<div class="block">The default size of a value of the StructType is the total default sizes of all field types.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/sql/types/StructType.html#fieldIndex(java.lang.String)">fieldIndex</a></strong>(java.lang.String&nbsp;name)</code>
<div class="block">Returns index of a given field</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.String[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/sql/types/StructType.html#fieldNames()">fieldNames</a></strong>()</code>
<div class="block">Returns all field names in an array.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/sql/types/StructType.html#fields()">fields</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected static <a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types">StructType</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/sql/types/StructType.html#fromAttributes(scala.collection.Seq)">fromAttributes</a></strong>(scala.collection.Seq&lt;org.apache.spark.sql.catalyst.expressions.Attribute&gt;&nbsp;attributes)</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>org.apache.spark.sql.catalyst.expressions.InterpretedOrdering</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/sql/types/StructType.html#interpretedOrdering()">interpretedOrdering</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>scala.collection.Iterator&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/sql/types/StructType.html#iterator()">iterator</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/sql/types/StructType.html#length()">length</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/sql/types/StructType.html#printTreeString()">printTreeString</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/sql/types/StructType.html#simpleString()">simpleString</a></strong>()</code>
<div class="block">Readable string representation for the type.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected scala.collection.Seq&lt;org.apache.spark.sql.catalyst.expressions.AttributeReference&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/sql/types/StructType.html#toAttributes()">toAttributes</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/sql/types/StructType.html#treeString()">treeString</a></strong>()</code>&nbsp;</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_org.apache.spark.sql.types.DataType">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.spark.sql.types.<a href="../../../../../org/apache/spark/sql/types/DataType.html" title="class in org.apache.spark.sql.types">DataType</a></h3>
<code><a href="../../../../../org/apache/spark/sql/types/DataType.html#buildFormattedString(org.apache.spark.sql.types.DataType, java.lang.String, scala.collection.mutable.StringBuilder)">buildFormattedString</a>, <a href="../../../../../org/apache/spark/sql/types/DataType.html#fromCaseClassString(java.lang.String)">fromCaseClassString</a>, <a href="../../../../../org/apache/spark/sql/types/DataType.html#fromJson(java.lang.String)">fromJson</a>, <a href="../../../../../org/apache/spark/sql/types/DataType.html#json()">json</a>, <a href="../../../../../org/apache/spark/sql/types/DataType.html#prettyJson()">prettyJson</a>, <a href="../../../../../org/apache/spark/sql/types/DataType.html#typeName()">typeName</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_scala.collection.Seq">
<!--   -->
</a>
<h3>Methods inherited from interface&nbsp;scala.collection.Seq</h3>
<code>companion, seq</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_scala.PartialFunction">
<!--   -->
</a>
<h3>Methods inherited from interface&nbsp;scala.PartialFunction</h3>
<code>andThen, applyOrElse, isDefinedAt, lift, orElse, runWith</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_scala.Function1">
<!--   -->
</a>
<h3>Methods inherited from interface&nbsp;scala.Function1</h3>
<code>andThen$mcDD$sp, andThen$mcDF$sp, andThen$mcDI$sp, andThen$mcDJ$sp, andThen$mcFD$sp, andThen$mcFF$sp, andThen$mcFI$sp, andThen$mcFJ$sp, andThen$mcID$sp, andThen$mcIF$sp, andThen$mcII$sp, andThen$mcIJ$sp, andThen$mcJD$sp, andThen$mcJF$sp, andThen$mcJI$sp, andThen$mcJJ$sp, andThen$mcVD$sp, andThen$mcVF$sp, andThen$mcVI$sp, andThen$mcVJ$sp, andThen$mcZD$sp, andThen$mcZF$sp, andThen$mcZI$sp, andThen$mcZJ$sp, 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, compose$mcDD$sp, compose$mcDF$sp, compose$mcDI$sp, compose$mcDJ$sp, compose$mcFD$sp, compose$mcFF$sp, compose$mcFI$sp, compose$mcFJ$sp, compose$mcID$sp, compose$mcIF$sp, compose$mcII$sp, compose$mcIJ$sp, compose$mcJD$sp, compose$mcJF$sp, compose$mcJI$sp, compose$mcJJ$sp, compose$mcVD$sp, compose$mcVF$sp, compose$mcVI$sp, compose$mcVJ$sp, compose$mcZD$sp, compose$mcZF$sp, compose$mcZI$sp, compose$mcZJ$sp, toString</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_scala.collection.SeqLike">
<!--   -->
</a>
<h3>Methods inherited from interface&nbsp;scala.collection.SeqLike</h3>
<code>$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</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_scala.collection.IterableLike">
<!--   -->
</a>
<h3>Methods inherited from interface&nbsp;scala.collection.IterableLike</h3>
<code>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</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_scala.collection.TraversableLike">
<!--   -->
</a>
<h3>Methods inherited from interface&nbsp;scala.collection.TraversableLike</h3>
<code>$plus$plus, $plus$plus$colon, $plus$plus$colon, collect, dropWhile, filter, filterNot, flatMap, groupBy, hasDefiniteSize, headOption, init, inits, isTraversableAgain, last, lastOption, map, partition, repr, scan, scanLeft, scanRight, sliceWithKnownBound, sliceWithKnownDelta, span, splitAt, stringPrefix, tail, tails, to, toTraversable, withFilter</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_scala.collection.TraversableOnce">
<!--   -->
</a>
<h3>Methods inherited from interface&nbsp;scala.collection.TraversableOnce</h3>
<code>$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</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_scala.collection.GenSeqLike">
<!--   -->
</a>
<h3>Methods inherited from interface&nbsp;scala.collection.GenSeqLike</h3>
<code>equals, hashCode, indexOf, indexOf, indexWhere, isDefinedAt, lastIndexOf, lastIndexOf, lastIndexWhere, prefixLength, startsWith</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_scala.collection.GenTraversableOnce">
<!--   -->
</a>
<h3>Methods inherited from interface&nbsp;scala.collection.GenTraversableOnce</h3>
<code>$div$colon$bslash</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_scala.collection.Parallelizable">
<!--   -->
</a>
<h3>Methods inherited from interface&nbsp;scala.collection.Parallelizable</h3>
<code>par</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_scala.Product">
<!--   -->
</a>
<h3>Methods inherited from interface&nbsp;scala.Product</h3>
<code>productArity, productElement, productIterator, productPrefix</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="StructType(org.apache.spark.sql.types.StructField[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>StructType</h4>
<pre>public&nbsp;StructType(<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>[]&nbsp;fields)</pre>
</li>
</ul>
<a name="StructType()">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>StructType</h4>
<pre>public&nbsp;StructType()</pre>
<div class="block">No-arg constructor for kryo.</div>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="fromAttributes(scala.collection.Seq)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fromAttributes</h4>
<pre>protected static&nbsp;<a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types">StructType</a>&nbsp;fromAttributes(scala.collection.Seq&lt;org.apache.spark.sql.catalyst.expressions.Attribute&gt;&nbsp;attributes)</pre>
</li>
</ul>
<a name="fields()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fields</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>[]&nbsp;fields()</pre>
</li>
</ul>
<a name="fieldNames()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fieldNames</h4>
<pre>public&nbsp;java.lang.String[]&nbsp;fieldNames()</pre>
<div class="block">Returns all field names in an array.</div>
</li>
</ul>
<a name="add(org.apache.spark.sql.types.StructField)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>add</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types">StructType</a>&nbsp;add(<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>&nbsp;field)</pre>
<div class="block">Creates a new <a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types"><code>StructType</code></a> by adding a new field.
 <pre><code>
 val struct = (new StructType)
   .add(StructField("a", IntegerType, true))
   .add(StructField("b", LongType, false))
   .add(StructField("c", StringType, true))
</code></pre></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>field</code> - (undocumented)</dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="add(java.lang.String, org.apache.spark.sql.types.DataType)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>add</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types">StructType</a>&nbsp;add(java.lang.String&nbsp;name,
             <a href="../../../../../org/apache/spark/sql/types/DataType.html" title="class in org.apache.spark.sql.types">DataType</a>&nbsp;dataType)</pre>
<div class="block">Creates a new <a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types"><code>StructType</code></a> by adding a new nullable field with no metadata.
 <p>
 val struct = (new StructType)
   .add("a", IntegerType)
   .add("b", LongType)
   .add("c", StringType)</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - (undocumented)</dd><dd><code>dataType</code> - (undocumented)</dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="add(java.lang.String, org.apache.spark.sql.types.DataType, boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>add</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types">StructType</a>&nbsp;add(java.lang.String&nbsp;name,
             <a href="../../../../../org/apache/spark/sql/types/DataType.html" title="class in org.apache.spark.sql.types">DataType</a>&nbsp;dataType,
             boolean&nbsp;nullable)</pre>
<div class="block">Creates a new <a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types"><code>StructType</code></a> by adding a new field with no metadata.
 <p>
 val struct = (new StructType)
   .add("a", IntegerType, true)
   .add("b", LongType, false)
   .add("c", StringType, true)</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - (undocumented)</dd><dd><code>dataType</code> - (undocumented)</dd><dd><code>nullable</code> - (undocumented)</dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="add(java.lang.String, org.apache.spark.sql.types.DataType, boolean, org.apache.spark.sql.types.Metadata)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>add</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types">StructType</a>&nbsp;add(java.lang.String&nbsp;name,
             <a href="../../../../../org/apache/spark/sql/types/DataType.html" title="class in org.apache.spark.sql.types">DataType</a>&nbsp;dataType,
             boolean&nbsp;nullable,
             <a href="../../../../../org/apache/spark/sql/types/Metadata.html" title="class in org.apache.spark.sql.types">Metadata</a>&nbsp;metadata)</pre>
<div class="block">Creates a new <a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types"><code>StructType</code></a> by adding a new field and specifying metadata.
 <pre><code>
 val struct = (new StructType)
   .add("a", IntegerType, true, Metadata.empty)
   .add("b", LongType, false, Metadata.empty)
   .add("c", StringType, true, Metadata.empty)
 </code></pre></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - (undocumented)</dd><dd><code>dataType</code> - (undocumented)</dd><dd><code>nullable</code> - (undocumented)</dd><dd><code>metadata</code> - (undocumented)</dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="add(java.lang.String, java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>add</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types">StructType</a>&nbsp;add(java.lang.String&nbsp;name,
             java.lang.String&nbsp;dataType)</pre>
<div class="block">Creates a new <a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types"><code>StructType</code></a> by adding a new nullable field with no metadata where the
 dataType is specified as a String.
 <p>
 <pre><code>
 val struct = (new StructType)
   .add("a", "int")
   .add("b", "long")
   .add("c", "string")
 </code></pre></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - (undocumented)</dd><dd><code>dataType</code> - (undocumented)</dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="add(java.lang.String, java.lang.String, boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>add</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types">StructType</a>&nbsp;add(java.lang.String&nbsp;name,
             java.lang.String&nbsp;dataType,
             boolean&nbsp;nullable)</pre>
<div class="block">Creates a new <a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types"><code>StructType</code></a> by adding a new field with no metadata where the
 dataType is specified as a String.
 <p>
 <pre><code>
 val struct = (new StructType)
   .add("a", "int", true)
   .add("b", "long", false)
   .add("c", "string", true)
 </code></pre></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - (undocumented)</dd><dd><code>dataType</code> - (undocumented)</dd><dd><code>nullable</code> - (undocumented)</dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="add(java.lang.String, java.lang.String, boolean, org.apache.spark.sql.types.Metadata)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>add</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types">StructType</a>&nbsp;add(java.lang.String&nbsp;name,
             java.lang.String&nbsp;dataType,
             boolean&nbsp;nullable,
             <a href="../../../../../org/apache/spark/sql/types/Metadata.html" title="class in org.apache.spark.sql.types">Metadata</a>&nbsp;metadata)</pre>
<div class="block">Creates a new <a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types"><code>StructType</code></a> by adding a new field and specifying metadata where the
 dataType is specified as a String.
 <pre><code>
 val struct = (new StructType)
   .add("a", "int", true, Metadata.empty)
   .add("b", "long", false, Metadata.empty)
   .add("c", "string", true, Metadata.empty)
 </code></pre></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - (undocumented)</dd><dd><code>dataType</code> - (undocumented)</dd><dd><code>nullable</code> - (undocumented)</dd><dd><code>metadata</code> - (undocumented)</dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="apply(java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>apply</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>&nbsp;apply(java.lang.String&nbsp;name)</pre>
<div class="block">Extracts a <a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types"><code>StructField</code></a> of the given name. If the <a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types"><code>StructType</code></a> object does not
 have a name matching the given name, <code>null</code> will be returned.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - (undocumented)</dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="apply(scala.collection.immutable.Set)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>apply</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types">StructType</a>&nbsp;apply(scala.collection.immutable.Set&lt;java.lang.String&gt;&nbsp;names)</pre>
<div class="block">Returns a <a href="../../../../../org/apache/spark/sql/types/StructType.html" title="class in org.apache.spark.sql.types"><code>StructType</code></a> containing <a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types"><code>StructField</code></a>s of the given names, preserving the
 original order of fields. Those names which do not have matching fields will be ignored.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>names</code> - (undocumented)</dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="fieldIndex(java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fieldIndex</h4>
<pre>public&nbsp;int&nbsp;fieldIndex(java.lang.String&nbsp;name)</pre>
<div class="block">Returns index of a given field</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - (undocumented)</dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="toAttributes()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toAttributes</h4>
<pre>protected&nbsp;scala.collection.Seq&lt;org.apache.spark.sql.catalyst.expressions.AttributeReference&gt;&nbsp;toAttributes()</pre>
</li>
</ul>
<a name="treeString()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>treeString</h4>
<pre>public&nbsp;java.lang.String&nbsp;treeString()</pre>
</li>
</ul>
<a name="printTreeString()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>printTreeString</h4>
<pre>public&nbsp;void&nbsp;printTreeString()</pre>
</li>
</ul>
<a name="apply(int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>apply</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>&nbsp;apply(int&nbsp;fieldIndex)</pre>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code>apply</code>&nbsp;in interface&nbsp;<code>scala.collection.GenSeqLike&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>,scala.collection.Seq&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>&gt;&gt;</code></dd>
<dt><strong>Specified by:</strong></dt>
<dd><code>apply</code>&nbsp;in interface&nbsp;<code>scala.collection.SeqLike&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>,scala.collection.Seq&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>&gt;&gt;</code></dd>
</dl>
</li>
</ul>
<a name="length()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>length</h4>
<pre>public&nbsp;int&nbsp;length()</pre>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code>length</code>&nbsp;in interface&nbsp;<code>scala.collection.GenSeqLike&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>,scala.collection.Seq&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>&gt;&gt;</code></dd>
<dt><strong>Specified by:</strong></dt>
<dd><code>length</code>&nbsp;in interface&nbsp;<code>scala.collection.SeqLike&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>,scala.collection.Seq&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>&gt;&gt;</code></dd>
</dl>
</li>
</ul>
<a name="iterator()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>iterator</h4>
<pre>public&nbsp;scala.collection.Iterator&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>&gt;&nbsp;iterator()</pre>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code>iterator</code>&nbsp;in interface&nbsp;<code>scala.collection.GenIterableLike&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>,scala.collection.Seq&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>&gt;&gt;</code></dd>
<dt><strong>Specified by:</strong></dt>
<dd><code>iterator</code>&nbsp;in interface&nbsp;<code>scala.collection.IterableLike&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>,scala.collection.Seq&lt;<a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types">StructField</a>&gt;&gt;</code></dd>
</dl>
</li>
</ul>
<a name="defaultSize()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>defaultSize</h4>
<pre>public&nbsp;int&nbsp;defaultSize()</pre>
<div class="block">The default size of a value of the StructType is the total default sizes of all field types.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/spark/sql/types/DataType.html#defaultSize()">defaultSize</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/apache/spark/sql/types/DataType.html" title="class in org.apache.spark.sql.types">DataType</a></code></dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="simpleString()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>simpleString</h4>
<pre>public&nbsp;java.lang.String&nbsp;simpleString()</pre>
<div class="block"><strong>Description copied from class:&nbsp;<code><a href="../../../../../org/apache/spark/sql/types/DataType.html#simpleString()">DataType</a></code></strong></div>
<div class="block">Readable string representation for the type.</div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="../../../../../org/apache/spark/sql/types/DataType.html#simpleString()">simpleString</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/apache/spark/sql/types/DataType.html" title="class in org.apache.spark.sql.types">DataType</a></code></dd>
</dl>
</li>
</ul>
<a name="interpretedOrdering()">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>interpretedOrdering</h4>
<pre>public&nbsp;org.apache.spark.sql.catalyst.expressions.InterpretedOrdering&nbsp;interpretedOrdering()</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/spark/sql/types/StructField.html" title="class in org.apache.spark.sql.types"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/spark/sql/types/TimestampType.html" title="class in org.apache.spark.sql.types"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/spark/sql/types/StructType.html" target="_top">Frames</a></li>
<li><a href="StructType.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<script defer="defer" type="text/javascript" src="../../../../../lib/jquery.js"></script><script defer="defer" type="text/javascript" src="../../../../../lib/api-javadocs.js"></script></body>
</html>