/
generics.R
1527 lines (1110 loc) · 47.9 KB
/
generics.R
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
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
############ RDD Actions and Transformations ############
# @rdname aggregateRDD
# @seealso reduce
setGeneric("aggregateRDD",
function(x, zeroValue, seqOp, combOp) { standardGeneric("aggregateRDD") })
setGeneric("cacheRDD", function(x) { standardGeneric("cacheRDD") })
# @rdname coalesce
# @seealso repartition
setGeneric("coalesceRDD", function(x, numPartitions, ...) { standardGeneric("coalesceRDD") })
# @rdname checkpoint-methods
setGeneric("checkpointRDD", function(x) { standardGeneric("checkpointRDD") })
setGeneric("collectRDD", function(x, ...) { standardGeneric("collectRDD") })
# @rdname collect-methods
setGeneric("collectAsMap", function(x) { standardGeneric("collectAsMap") })
# @rdname collect-methods
setGeneric("collectPartition",
function(x, partitionId) {
standardGeneric("collectPartition")
})
setGeneric("countRDD", function(x) { standardGeneric("countRDD") })
setGeneric("lengthRDD", function(x) { standardGeneric("lengthRDD") })
# @rdname countByValue
setGeneric("countByValue", function(x) { standardGeneric("countByValue") })
# @rdname crosstab
setGeneric("crosstab", function(x, col1, col2) { standardGeneric("crosstab") })
# @rdname freqItems
setGeneric("freqItems", function(x, cols, support = 0.01) { standardGeneric("freqItems") })
# @rdname approxQuantile
setGeneric("approxQuantile",
function(x, cols, probabilities, relativeError) {
standardGeneric("approxQuantile")
})
setGeneric("distinctRDD", function(x, numPartitions = 1) { standardGeneric("distinctRDD") })
# @rdname filterRDD
setGeneric("filterRDD", function(x, f) { standardGeneric("filterRDD") })
setGeneric("firstRDD", function(x, ...) { standardGeneric("firstRDD") })
# @rdname flatMap
setGeneric("flatMap", function(X, FUN) { standardGeneric("flatMap") })
# @rdname fold
# @seealso reduce
setGeneric("fold", function(x, zeroValue, op) { standardGeneric("fold") })
setGeneric("foreach", function(x, func) { standardGeneric("foreach") })
setGeneric("foreachPartition", function(x, func) { standardGeneric("foreachPartition") })
# The jrdd accessor function.
setGeneric("getJRDD", function(rdd, ...) { standardGeneric("getJRDD") })
# @rdname glom
setGeneric("glom", function(x) { standardGeneric("glom") })
# @rdname histogram
setGeneric("histogram", function(df, col, nbins=10) { standardGeneric("histogram") })
setGeneric("joinRDD", function(x, y, ...) { standardGeneric("joinRDD") })
# @rdname keyBy
setGeneric("keyBy", function(x, func) { standardGeneric("keyBy") })
setGeneric("lapplyPartition", function(X, FUN) { standardGeneric("lapplyPartition") })
setGeneric("lapplyPartitionsWithIndex",
function(X, FUN) {
standardGeneric("lapplyPartitionsWithIndex")
})
setGeneric("map", function(X, FUN) { standardGeneric("map") })
setGeneric("mapPartitions", function(X, FUN) { standardGeneric("mapPartitions") })
setGeneric("mapPartitionsWithIndex",
function(X, FUN) { standardGeneric("mapPartitionsWithIndex") })
# @rdname maximum
setGeneric("maximum", function(x) { standardGeneric("maximum") })
# @rdname minimum
setGeneric("minimum", function(x) { standardGeneric("minimum") })
# @rdname sumRDD
setGeneric("sumRDD", function(x) { standardGeneric("sumRDD") })
# @rdname name
setGeneric("name", function(x) { standardGeneric("name") })
# @rdname getNumPartitionsRDD
setGeneric("getNumPartitionsRDD", function(x) { standardGeneric("getNumPartitionsRDD") })
# @rdname getNumPartitions
setGeneric("numPartitions", function(x) { standardGeneric("numPartitions") })
setGeneric("persistRDD", function(x, newLevel) { standardGeneric("persistRDD") })
# @rdname pipeRDD
setGeneric("pipeRDD", function(x, command, env = list()) { standardGeneric("pipeRDD")})
# @rdname pivot
setGeneric("pivot", function(x, colname, values = list()) { standardGeneric("pivot") })
# @rdname reduce
setGeneric("reduce", function(x, func) { standardGeneric("reduce") })
setGeneric("repartitionRDD", function(x, ...) { standardGeneric("repartitionRDD") })
# @rdname sampleRDD
setGeneric("sampleRDD",
function(x, withReplacement, fraction, seed) {
standardGeneric("sampleRDD")
})
# @rdname saveAsObjectFile
# @seealso objectFile
setGeneric("saveAsObjectFile", function(x, path) { standardGeneric("saveAsObjectFile") })
# @rdname saveAsTextFile
setGeneric("saveAsTextFile", function(x, path) { standardGeneric("saveAsTextFile") })
# @rdname setName
setGeneric("setName", function(x, name) { standardGeneric("setName") })
setGeneric("showRDD", function(object, ...) { standardGeneric("showRDD") })
# @rdname sortBy
setGeneric("sortBy",
function(x, func, ascending = TRUE, numPartitions = 1) {
standardGeneric("sortBy")
})
setGeneric("takeRDD", function(x, num) { standardGeneric("takeRDD") })
# @rdname takeOrdered
setGeneric("takeOrdered", function(x, num) { standardGeneric("takeOrdered") })
# @rdname takeSample
setGeneric("takeSample",
function(x, withReplacement, num, seed) {
standardGeneric("takeSample")
})
# @rdname top
setGeneric("top", function(x, num) { standardGeneric("top") })
# @rdname unionRDD
setGeneric("unionRDD", function(x, y) { standardGeneric("unionRDD") })
setGeneric("unpersistRDD", function(x, ...) { standardGeneric("unpersistRDD") })
# @rdname zipRDD
setGeneric("zipRDD", function(x, other) { standardGeneric("zipRDD") })
# @rdname zipRDD
setGeneric("zipPartitions", function(..., func) { standardGeneric("zipPartitions") },
signature = "...")
# @rdname zipWithIndex
# @seealso zipWithUniqueId
setGeneric("zipWithIndex", function(x) { standardGeneric("zipWithIndex") })
# @rdname zipWithUniqueId
# @seealso zipWithIndex
setGeneric("zipWithUniqueId", function(x) { standardGeneric("zipWithUniqueId") })
############ Binary Functions #############
# @rdname cartesian
setGeneric("cartesian", function(x, other) { standardGeneric("cartesian") })
# @rdname countByKey
setGeneric("countByKey", function(x) { standardGeneric("countByKey") })
# @rdname flatMapValues
setGeneric("flatMapValues", function(X, FUN) { standardGeneric("flatMapValues") })
# @rdname intersection
setGeneric("intersection",
function(x, other, numPartitions = 1) {
standardGeneric("intersection")
})
# @rdname keys
setGeneric("keys", function(x) { standardGeneric("keys") })
# @rdname lookup
setGeneric("lookup", function(x, key) { standardGeneric("lookup") })
# @rdname mapValues
setGeneric("mapValues", function(X, FUN) { standardGeneric("mapValues") })
# @rdname sampleByKey
setGeneric("sampleByKey",
function(x, withReplacement, fractions, seed) {
standardGeneric("sampleByKey")
})
# @rdname values
setGeneric("values", function(x) { standardGeneric("values") })
############ Shuffle Functions ############
# @rdname aggregateByKey
# @seealso foldByKey, combineByKey
setGeneric("aggregateByKey",
function(x, zeroValue, seqOp, combOp, numPartitions) {
standardGeneric("aggregateByKey")
})
# @rdname cogroup
setGeneric("cogroup",
function(..., numPartitions) {
standardGeneric("cogroup")
},
signature = "...")
# @rdname combineByKey
# @seealso groupByKey, reduceByKey
setGeneric("combineByKey",
function(x, createCombiner, mergeValue, mergeCombiners, numPartitions) {
standardGeneric("combineByKey")
})
# @rdname foldByKey
# @seealso aggregateByKey, combineByKey
setGeneric("foldByKey",
function(x, zeroValue, func, numPartitions) {
standardGeneric("foldByKey")
})
# @rdname join-methods
setGeneric("fullOuterJoin", function(x, y, numPartitions) { standardGeneric("fullOuterJoin") })
# @rdname groupByKey
# @seealso reduceByKey
setGeneric("groupByKey", function(x, numPartitions) { standardGeneric("groupByKey") })
# @rdname join-methods
setGeneric("join", function(x, y, ...) { standardGeneric("join") })
# @rdname join-methods
setGeneric("leftOuterJoin", function(x, y, numPartitions) { standardGeneric("leftOuterJoin") })
setGeneric("partitionByRDD", function(x, ...) { standardGeneric("partitionByRDD") })
# @rdname reduceByKey
# @seealso groupByKey
setGeneric("reduceByKey", function(x, combineFunc, numPartitions) { standardGeneric("reduceByKey")})
# @rdname reduceByKeyLocally
# @seealso reduceByKey
setGeneric("reduceByKeyLocally",
function(x, combineFunc) {
standardGeneric("reduceByKeyLocally")
})
# @rdname join-methods
setGeneric("rightOuterJoin", function(x, y, numPartitions) { standardGeneric("rightOuterJoin") })
# @rdname sortByKey
setGeneric("sortByKey",
function(x, ascending = TRUE, numPartitions = 1) {
standardGeneric("sortByKey")
})
# @rdname subtract
setGeneric("subtract",
function(x, other, numPartitions = 1) {
standardGeneric("subtract")
})
# @rdname subtractByKey
setGeneric("subtractByKey",
function(x, other, numPartitions = 1) {
standardGeneric("subtractByKey")
})
################### Broadcast Variable Methods #################
# @rdname broadcast
setGeneric("value", function(bcast) { standardGeneric("value") })
#################### SparkDataFrame Methods ########################
#' @param x a SparkDataFrame or GroupedData.
#' @param ... further arguments to be passed to or from other methods.
#' @return A SparkDataFrame.
#' @rdname summarize
setGeneric("agg", function(x, ...) { standardGeneric("agg") })
#' alias
#'
#' Returns a new SparkDataFrame or a Column with an alias set. Equivalent to SQL "AS" keyword.
#'
#' @name alias
#' @rdname alias
#' @param object x a SparkDataFrame or a Column
#' @param data new name to use
#' @return a SparkDataFrame or a Column
NULL
#' @rdname arrange
setGeneric("arrange", function(x, col, ...) { standardGeneric("arrange") })
#' @rdname as.data.frame
setGeneric("as.data.frame",
function(x, row.names = NULL, optional = FALSE, ...) {
standardGeneric("as.data.frame")
})
# Do not document the generic because of signature changes across R versions
#' @noRd
setGeneric("attach")
#' @rdname cache
setGeneric("cache", function(x) { standardGeneric("cache") })
#' @rdname checkpoint
setGeneric("checkpoint", function(x, eager = TRUE) { standardGeneric("checkpoint") })
#' @rdname coalesce
#' @param x a SparkDataFrame.
#' @param ... additional argument(s).
setGeneric("coalesce", function(x, ...) { standardGeneric("coalesce") })
#' @rdname collect
setGeneric("collect", function(x, ...) { standardGeneric("collect") })
#' @param do.NULL currently not used.
#' @param prefix currently not used.
#' @rdname columns
setGeneric("colnames", function(x, do.NULL = TRUE, prefix = "col") { standardGeneric("colnames") })
#' @rdname columns
setGeneric("colnames<-", function(x, value) { standardGeneric("colnames<-") })
#' @rdname coltypes
setGeneric("coltypes", function(x) { standardGeneric("coltypes") })
#' @rdname coltypes
setGeneric("coltypes<-", function(x, value) { standardGeneric("coltypes<-") })
#' @rdname columns
setGeneric("columns", function(x) {standardGeneric("columns") })
#' @param x a GroupedData or Column.
#' @rdname count
setGeneric("count", function(x) { standardGeneric("count") })
#' @rdname cov
#' @param x a Column or a SparkDataFrame.
#' @param ... additional argument(s). If \code{x} is a Column, a Column
#' should be provided. If \code{x} is a SparkDataFrame, two column names should
#' be provided.
setGeneric("cov", function(x, ...) {standardGeneric("cov") })
#' @rdname corr
#' @param x a Column or a SparkDataFrame.
#' @param ... additional argument(s). If \code{x} is a Column, a Column
#' should be provided. If \code{x} is a SparkDataFrame, two column names should
#' be provided.
setGeneric("corr", function(x, ...) {standardGeneric("corr") })
#' @rdname cov
setGeneric("covar_samp", function(col1, col2) {standardGeneric("covar_samp") })
#' @rdname cov
setGeneric("covar_pop", function(col1, col2) {standardGeneric("covar_pop") })
#' @rdname createOrReplaceTempView
setGeneric("createOrReplaceTempView",
function(x, viewName) {
standardGeneric("createOrReplaceTempView")
})
# @rdname crossJoin
setGeneric("crossJoin", function(x, y) { standardGeneric("crossJoin") })
#' @rdname cube
setGeneric("cube", function(x, ...) { standardGeneric("cube") })
#' @rdname dapply
setGeneric("dapply", function(x, func, schema) { standardGeneric("dapply") })
#' @rdname dapplyCollect
setGeneric("dapplyCollect", function(x, func) { standardGeneric("dapplyCollect") })
#' @param x a SparkDataFrame or GroupedData.
#' @param ... additional argument(s) passed to the method.
#' @rdname gapply
setGeneric("gapply", function(x, ...) { standardGeneric("gapply") })
#' @param x a SparkDataFrame or GroupedData.
#' @param ... additional argument(s) passed to the method.
#' @rdname gapplyCollect
setGeneric("gapplyCollect", function(x, ...) { standardGeneric("gapplyCollect") })
# @rdname getNumPartitions
setGeneric("getNumPartitions", function(x) { standardGeneric("getNumPartitions") })
#' @rdname describe
setGeneric("describe", function(x, col, ...) { standardGeneric("describe") })
#' @rdname distinct
setGeneric("distinct", function(x) { standardGeneric("distinct") })
#' @rdname drop
setGeneric("drop", function(x, ...) { standardGeneric("drop") })
#' @rdname dropDuplicates
setGeneric("dropDuplicates", function(x, ...) { standardGeneric("dropDuplicates") })
#' @rdname nafunctions
setGeneric("dropna",
function(x, how = c("any", "all"), minNonNulls = NULL, cols = NULL) {
standardGeneric("dropna")
})
#' @rdname nafunctions
setGeneric("na.omit",
function(object, ...) {
standardGeneric("na.omit")
})
#' @rdname dtypes
setGeneric("dtypes", function(x) { standardGeneric("dtypes") })
#' @rdname explain
#' @param x a SparkDataFrame or a StreamingQuery.
#' @param extended Logical. If extended is FALSE, prints only the physical plan.
#' @param ... further arguments to be passed to or from other methods.
setGeneric("explain", function(x, ...) { standardGeneric("explain") })
#' @rdname except
setGeneric("except", function(x, y) { standardGeneric("except") })
#' @rdname exceptAll
setGeneric("exceptAll", function(x, y) { standardGeneric("exceptAll") })
#' @rdname nafunctions
setGeneric("fillna", function(x, value, cols = NULL) { standardGeneric("fillna") })
#' @rdname filter
setGeneric("filter", function(x, condition) { standardGeneric("filter") })
#' @rdname first
setGeneric("first", function(x, ...) { standardGeneric("first") })
#' @rdname groupBy
setGeneric("group_by", function(x, ...) { standardGeneric("group_by") })
#' @rdname groupBy
setGeneric("groupBy", function(x, ...) { standardGeneric("groupBy") })
#' @rdname hint
setGeneric("hint", function(x, name, ...) { standardGeneric("hint") })
#' @rdname insertInto
setGeneric("insertInto", function(x, tableName, ...) { standardGeneric("insertInto") })
#' @rdname intersect
setGeneric("intersect", function(x, y) { standardGeneric("intersect") })
#' @rdname intersectAll
setGeneric("intersectAll", function(x, y) { standardGeneric("intersectAll") })
#' @rdname isLocal
setGeneric("isLocal", function(x) { standardGeneric("isLocal") })
#' @rdname isStreaming
setGeneric("isStreaming", function(x) { standardGeneric("isStreaming") })
#' @rdname limit
setGeneric("limit", function(x, num) {standardGeneric("limit") })
#' @rdname localCheckpoint
setGeneric("localCheckpoint", function(x, eager = TRUE) { standardGeneric("localCheckpoint") })
#' @rdname merge
setGeneric("merge")
#' @rdname mutate
setGeneric("mutate", function(.data, ...) {standardGeneric("mutate") })
#' @rdname orderBy
setGeneric("orderBy", function(x, col, ...) { standardGeneric("orderBy") })
#' @rdname persist
setGeneric("persist", function(x, newLevel) { standardGeneric("persist") })
#' @rdname printSchema
setGeneric("printSchema", function(x) { standardGeneric("printSchema") })
#' @rdname rename
setGeneric("rename", function(x, ...) { standardGeneric("rename") })
#' @rdname repartition
setGeneric("repartition", function(x, ...) { standardGeneric("repartition") })
#' @rdname repartitionByRange
setGeneric("repartitionByRange", function(x, ...) { standardGeneric("repartitionByRange") })
#' @rdname sample
setGeneric("sample",
function(x, withReplacement = FALSE, fraction, seed) {
standardGeneric("sample")
})
#' @rdname rollup
setGeneric("rollup", function(x, ...) { standardGeneric("rollup") })
#' @rdname sample
setGeneric("sample_frac",
function(x, withReplacement = FALSE, fraction, seed) { standardGeneric("sample_frac") })
#' @rdname sampleBy
setGeneric("sampleBy", function(x, col, fractions, seed) { standardGeneric("sampleBy") })
#' @rdname saveAsTable
setGeneric("saveAsTable", function(df, tableName, source = NULL, mode = "error", ...) {
standardGeneric("saveAsTable")
})
setGeneric("str")
#' @rdname take
setGeneric("take", function(x, num) { standardGeneric("take") })
#' @rdname mutate
setGeneric("transform", function(`_data`, ...) {standardGeneric("transform") })
#' @rdname write.df
setGeneric("write.df", function(df, path = NULL, source = NULL, mode = "error", ...) {
standardGeneric("write.df")
})
#' @rdname write.df
setGeneric("saveDF", function(df, path, source = NULL, mode = "error", ...) {
standardGeneric("saveDF")
})
#' @rdname write.jdbc
setGeneric("write.jdbc", function(x, url, tableName, mode = "error", ...) {
standardGeneric("write.jdbc")
})
#' @rdname write.json
setGeneric("write.json", function(x, path, ...) { standardGeneric("write.json") })
#' @rdname write.orc
setGeneric("write.orc", function(x, path, ...) { standardGeneric("write.orc") })
#' @rdname write.parquet
setGeneric("write.parquet", function(x, path, ...) {
standardGeneric("write.parquet")
})
#' @rdname write.stream
setGeneric("write.stream", function(df, source = NULL, outputMode = NULL, ...) {
standardGeneric("write.stream")
})
#' @rdname write.text
setGeneric("write.text", function(x, path, ...) { standardGeneric("write.text") })
#' @rdname schema
setGeneric("schema", function(x) { standardGeneric("schema") })
#' @rdname select
setGeneric("select", function(x, col, ...) { standardGeneric("select") })
#' @rdname selectExpr
setGeneric("selectExpr", function(x, expr, ...) { standardGeneric("selectExpr") })
#' @rdname showDF
setGeneric("showDF", function(x, ...) { standardGeneric("showDF") })
# @rdname storageLevel
setGeneric("storageLevel", function(x) { standardGeneric("storageLevel") })
#' @rdname subset
setGeneric("subset", function(x, ...) { standardGeneric("subset") })
#' @rdname summarize
setGeneric("summarize", function(x, ...) { standardGeneric("summarize") })
#' @rdname summary
setGeneric("summary", function(object, ...) { standardGeneric("summary") })
setGeneric("toJSON", function(x, ...) { standardGeneric("toJSON") })
setGeneric("toRDD", function(x) { standardGeneric("toRDD") })
#' @rdname union
setGeneric("union", function(x, y) { standardGeneric("union") })
#' @rdname unionAll
setGeneric("unionAll", function(x, y) { standardGeneric("unionAll") })
#' @rdname unionByName
setGeneric("unionByName", function(x, y) { standardGeneric("unionByName") })
#' @rdname unpersist
setGeneric("unpersist", function(x, ...) { standardGeneric("unpersist") })
#' @rdname filter
setGeneric("where", function(x, condition) { standardGeneric("where") })
#' @rdname with
setGeneric("with")
#' @rdname withColumn
setGeneric("withColumn", function(x, colName, col) { standardGeneric("withColumn") })
#' @rdname rename
setGeneric("withColumnRenamed",
function(x, existingCol, newCol) { standardGeneric("withColumnRenamed") })
#' @rdname withWatermark
setGeneric("withWatermark", function(x, eventTime, delayThreshold) {
standardGeneric("withWatermark")
})
#' @rdname write.df
setGeneric("write.df", function(df, path = NULL, ...) { standardGeneric("write.df") })
#' @rdname randomSplit
setGeneric("randomSplit", function(x, weights, seed) { standardGeneric("randomSplit") })
#' @rdname broadcast
setGeneric("broadcast", function(x) { standardGeneric("broadcast") })
###################### Column Methods ##########################
#' @rdname columnfunctions
setGeneric("asc", function(x) { standardGeneric("asc") })
#' @rdname between
setGeneric("between", function(x, bounds) { standardGeneric("between") })
#' @rdname cast
setGeneric("cast", function(x, dataType) { standardGeneric("cast") })
#' @rdname columnfunctions
#' @param x a Column object.
#' @param ... additional argument(s).
setGeneric("contains", function(x, ...) { standardGeneric("contains") })
#' @rdname columnfunctions
setGeneric("desc", function(x) { standardGeneric("desc") })
#' @rdname endsWith
setGeneric("endsWith", function(x, suffix) { standardGeneric("endsWith") })
#' @rdname columnfunctions
setGeneric("getField", function(x, ...) { standardGeneric("getField") })
#' @rdname columnfunctions
setGeneric("getItem", function(x, ...) { standardGeneric("getItem") })
#' @rdname columnfunctions
setGeneric("isNaN", function(x) { standardGeneric("isNaN") })
#' @rdname columnfunctions
setGeneric("isNull", function(x) { standardGeneric("isNull") })
#' @rdname columnfunctions
setGeneric("isNotNull", function(x) { standardGeneric("isNotNull") })
#' @rdname columnfunctions
setGeneric("like", function(x, ...) { standardGeneric("like") })
#' @rdname columnfunctions
setGeneric("rlike", function(x, ...) { standardGeneric("rlike") })
#' @rdname startsWith
setGeneric("startsWith", function(x, prefix) { standardGeneric("startsWith") })
#' @rdname column_nonaggregate_functions
#' @name NULL
setGeneric("when", function(condition, value) { standardGeneric("when") })
#' @rdname otherwise
setGeneric("otherwise", function(x, value) { standardGeneric("otherwise") })
#' @rdname over
setGeneric("over", function(x, window) { standardGeneric("over") })
#' @rdname eq_null_safe
setGeneric("%<=>%", function(x, value) { standardGeneric("%<=>%") })
###################### WindowSpec Methods ##########################
#' @rdname partitionBy
setGeneric("partitionBy", function(x, ...) { standardGeneric("partitionBy") })
#' @rdname rowsBetween
setGeneric("rowsBetween", function(x, start, end) { standardGeneric("rowsBetween") })
#' @rdname rangeBetween
setGeneric("rangeBetween", function(x, start, end) { standardGeneric("rangeBetween") })
#' @rdname windowPartitionBy
setGeneric("windowPartitionBy", function(col, ...) { standardGeneric("windowPartitionBy") })
#' @rdname windowOrderBy
setGeneric("windowOrderBy", function(col, ...) { standardGeneric("windowOrderBy") })
###################### Expression Function Methods ##########################
#' @rdname column_datetime_diff_functions
#' @name NULL
setGeneric("add_months", function(y, x) { standardGeneric("add_months") })
#' @rdname column_aggregate_functions
#' @name NULL
setGeneric("approx_count_distinct", function(x, ...) { standardGeneric("approx_count_distinct") })
#' @rdname column_aggregate_functions
#' @name NULL
setGeneric("approxCountDistinct", function(x, ...) { standardGeneric("approxCountDistinct") })
#' @rdname column_collection_functions
#' @name NULL
setGeneric("array_contains", function(x, value) { standardGeneric("array_contains") })
#' @rdname column_collection_functions
#' @name NULL
setGeneric("array_distinct", function(x) { standardGeneric("array_distinct") })
#' @rdname column_collection_functions
#' @name NULL
setGeneric("array_except", function(x, y) { standardGeneric("array_except") })
#' @rdname column_collection_functions
#' @name NULL
setGeneric("array_intersect", function(x, y) { standardGeneric("array_intersect") })
#' @rdname column_collection_functions
#' @name NULL
setGeneric("array_join", function(x, delimiter, ...) { standardGeneric("array_join") })
#' @rdname column_collection_functions
#' @name NULL
setGeneric("array_max", function(x) { standardGeneric("array_max") })
#' @rdname column_collection_functions
#' @name NULL
setGeneric("array_min", function(x) { standardGeneric("array_min") })
#' @rdname column_collection_functions
#' @name NULL
setGeneric("array_position", function(x, value) { standardGeneric("array_position") })
#' @rdname column_collection_functions
#' @name NULL
setGeneric("array_remove", function(x, value) { standardGeneric("array_remove") })
#' @rdname column_collection_functions
#' @name NULL
setGeneric("array_repeat", function(x, count) { standardGeneric("array_repeat") })
#' @rdname column_collection_functions
#' @name NULL
setGeneric("array_sort", function(x) { standardGeneric("array_sort") })
#' @rdname column_collection_functions
#' @name NULL
setGeneric("arrays_overlap", function(x, y) { standardGeneric("arrays_overlap") })
#' @rdname column_collection_functions
#' @name NULL
setGeneric("array_union", function(x, y) { standardGeneric("array_union") })
#' @rdname column_collection_functions
#' @name NULL
setGeneric("arrays_zip", function(x, ...) { standardGeneric("arrays_zip") })
#' @rdname column_string_functions
#' @name NULL
setGeneric("ascii", function(x) { standardGeneric("ascii") })
#' @param x Column to compute on or a GroupedData object.
#' @param ... additional argument(s) when \code{x} is a GroupedData object.
#' @rdname avg
setGeneric("avg", function(x, ...) { standardGeneric("avg") })
#' @rdname column_string_functions
#' @name NULL
setGeneric("base64", function(x) { standardGeneric("base64") })
#' @rdname column_math_functions
#' @name NULL
setGeneric("bin", function(x) { standardGeneric("bin") })
#' @rdname column_nonaggregate_functions
#' @name NULL
setGeneric("bitwiseNOT", function(x) { standardGeneric("bitwiseNOT") })
#' @rdname column_math_functions
#' @name NULL
setGeneric("bround", function(x, ...) { standardGeneric("bround") })
#' @rdname column_math_functions
#' @name NULL
setGeneric("cbrt", function(x) { standardGeneric("cbrt") })
#' @rdname column_math_functions
#' @name NULL
setGeneric("ceil", function(x) { standardGeneric("ceil") })
#' @rdname column_aggregate_functions
#' @name NULL
setGeneric("collect_list", function(x) { standardGeneric("collect_list") })
#' @rdname column_aggregate_functions
#' @name NULL
setGeneric("collect_set", function(x) { standardGeneric("collect_set") })
#' @rdname column
setGeneric("column", function(x) { standardGeneric("column") })
#' @rdname column_collection_functions
#' @name NULL
setGeneric("concat", function(x, ...) { standardGeneric("concat") })
#' @rdname column_string_functions
#' @name NULL
setGeneric("concat_ws", function(sep, x, ...) { standardGeneric("concat_ws") })
#' @rdname column_math_functions
#' @name NULL
setGeneric("conv", function(x, fromBase, toBase) { standardGeneric("conv") })
#' @rdname column_aggregate_functions
#' @name NULL
setGeneric("countDistinct", function(x, ...) { standardGeneric("countDistinct") })
#' @rdname column_misc_functions
#' @name NULL
setGeneric("crc32", function(x) { standardGeneric("crc32") })
#' @rdname column_nonaggregate_functions
#' @name NULL
setGeneric("create_array", function(x, ...) { standardGeneric("create_array") })
#' @rdname column_nonaggregate_functions
#' @name NULL
setGeneric("create_map", function(x, ...) { standardGeneric("create_map") })
#' @rdname column_misc_functions
#' @name NULL
setGeneric("hash", function(x, ...) { standardGeneric("hash") })
#' @rdname column_window_functions
#' @name NULL
setGeneric("cume_dist", function(x = "missing") { standardGeneric("cume_dist") })
#' @rdname column_datetime_functions
#' @name NULL
setGeneric("current_date", function(x = "missing") { standardGeneric("current_date") })
#' @rdname column_datetime_functions
#' @name NULL
setGeneric("current_timestamp", function(x = "missing") { standardGeneric("current_timestamp") })
#' @rdname column_datetime_diff_functions
#' @name NULL
setGeneric("datediff", function(y, x) { standardGeneric("datediff") })
#' @rdname column_datetime_diff_functions
#' @name NULL
setGeneric("date_add", function(y, x) { standardGeneric("date_add") })
#' @rdname column_datetime_diff_functions
#' @name NULL
setGeneric("date_format", function(y, x) { standardGeneric("date_format") })
#' @rdname column_datetime_diff_functions
#' @name NULL
setGeneric("date_sub", function(y, x) { standardGeneric("date_sub") })
#' @rdname column_datetime_functions
#' @name NULL
setGeneric("date_trunc", function(format, x) { standardGeneric("date_trunc") })
#' @rdname column_datetime_functions
#' @name NULL
setGeneric("dayofmonth", function(x) { standardGeneric("dayofmonth") })
#' @rdname column_datetime_functions
#' @name NULL
setGeneric("dayofweek", function(x) { standardGeneric("dayofweek") })
#' @rdname column_datetime_functions
#' @name NULL
setGeneric("dayofyear", function(x) { standardGeneric("dayofyear") })
#' @rdname column_string_functions
#' @name NULL
setGeneric("decode", function(x, charset) { standardGeneric("decode") })
#' @rdname column_window_functions
#' @name NULL
setGeneric("dense_rank", function(x = "missing") { standardGeneric("dense_rank") })
#' @rdname column_collection_functions
#' @name NULL
setGeneric("element_at", function(x, extraction) { standardGeneric("element_at") })
#' @rdname column_string_functions
#' @name NULL
setGeneric("encode", function(x, charset) { standardGeneric("encode") })
#' @rdname column_collection_functions
#' @name NULL
setGeneric("explode", function(x) { standardGeneric("explode") })
#' @rdname column_collection_functions
#' @name NULL
setGeneric("explode_outer", function(x) { standardGeneric("explode_outer") })
#' @rdname column_nonaggregate_functions
#' @name NULL
setGeneric("expr", function(x) { standardGeneric("expr") })
#' @rdname column_collection_functions
#' @name NULL
setGeneric("flatten", function(x) { standardGeneric("flatten") })
#' @rdname column_datetime_diff_functions
#' @name NULL
setGeneric("from_utc_timestamp", function(y, x) { standardGeneric("from_utc_timestamp") })
#' @rdname column_string_functions
#' @name NULL
setGeneric("format_number", function(y, x) { standardGeneric("format_number") })
#' @rdname column_string_functions
#' @name NULL
setGeneric("format_string", function(format, x, ...) { standardGeneric("format_string") })
#' @rdname column_collection_functions
#' @name NULL
setGeneric("from_json", function(x, schema, ...) { standardGeneric("from_json") })
#' @rdname column_collection_functions
#' @name NULL
setGeneric("from_csv", function(x, schema, ...) { standardGeneric("from_csv") })
#' @rdname column_datetime_functions
#' @name NULL
setGeneric("from_unixtime", function(x, ...) { standardGeneric("from_unixtime") })
#' @rdname column_nonaggregate_functions
#' @name NULL
setGeneric("greatest", function(x, ...) { standardGeneric("greatest") })
#' @rdname column_aggregate_functions
#' @name NULL
setGeneric("grouping_bit", function(x) { standardGeneric("grouping_bit") })