Skip to content

Commit 0be142d

Browse files
committed
Merge pull request #3 from apache/master
Pulling functionality from apache spark
2 parents 106fd8e + a189442 commit 0be142d

File tree

1,365 files changed

+56660
-21644
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,365 files changed

+56660
-21644
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ scalastyle-output.xml
6666
R-unit-tests.log
6767
R/unit-tests.out
6868
python/lib/pyspark.zip
69+
lint-r-report.log
6970

7071
# For Hive
7172
metastore_db/

.rat-excludes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ spark-env.sh
2828
spark-env.cmd
2929
spark-env.sh.template
3030
log4j-defaults.properties
31+
log4j-defaults-repl.properties
3132
bootstrap-tooltip.js
3233
jquery-1.11.1.min.js
3334
d3.min.js
@@ -80,5 +81,9 @@ local-1425081759269/*
8081
local-1426533911241/*
8182
local-1426633911242/*
8283
local-1430917381534/*
84+
local-1430917381535_1
85+
local-1430917381535_2
8386
DESCRIPTION
8487
NAMESPACE
88+
test_support/*
89+
.lintr

LICENSE

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,68 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
836836
See the License for the specific language governing permissions and
837837
limitations under the License.
838838

839+
========================================================================
840+
For vis.js (core/src/main/resources/org/apache/spark/ui/static/vis.min.js):
841+
========================================================================
842+
Copyright (C) 2010-2015 Almende B.V.
843+
844+
Vis.js is dual licensed under both
845+
846+
* The Apache 2.0 License
847+
http://www.apache.org/licenses/LICENSE-2.0
848+
849+
and
850+
851+
* The MIT License
852+
http://opensource.org/licenses/MIT
853+
854+
Vis.js may be distributed under either license.
855+
856+
========================================================================
857+
For dagre-d3 (core/src/main/resources/org/apache/spark/ui/static/dagre-d3.min.js):
858+
========================================================================
859+
Copyright (c) 2013 Chris Pettitt
860+
861+
Permission is hereby granted, free of charge, to any person obtaining a copy
862+
of this software and associated documentation files (the "Software"), to deal
863+
in the Software without restriction, including without limitation the rights
864+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
865+
copies of the Software, and to permit persons to whom the Software is
866+
furnished to do so, subject to the following conditions:
867+
868+
The above copyright notice and this permission notice shall be included in
869+
all copies or substantial portions of the Software.
870+
871+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
872+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
873+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
874+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
875+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
876+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
877+
THE SOFTWARE.
878+
879+
========================================================================
880+
For graphlib-dot (core/src/main/resources/org/apache/spark/ui/static/graphlib-dot.min.js):
881+
========================================================================
882+
Copyright (c) 2012-2013 Chris Pettitt
883+
884+
Permission is hereby granted, free of charge, to any person obtaining a copy
885+
of this software and associated documentation files (the "Software"), to deal
886+
in the Software without restriction, including without limitation the rights
887+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
888+
copies of the Software, and to permit persons to whom the Software is
889+
furnished to do so, subject to the following conditions:
890+
891+
The above copyright notice and this permission notice shall be included in
892+
all copies or substantial portions of the Software.
893+
894+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
895+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
896+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
897+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
898+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
899+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
900+
THE SOFTWARE.
839901

840902
========================================================================
841903
BSD-style licenses
@@ -845,7 +907,7 @@ The following components are provided under a BSD-style license. See project lin
845907

846908
(BSD 3 Clause) core (com.github.fommil.netlib:core:1.1.2 - https://github.com/fommil/netlib-java/core)
847909
(BSD 3 Clause) JPMML-Model (org.jpmml:pmml-model:1.1.15 - https://github.com/jpmml/jpmml-model)
848-
(BSD 3-clause style license) jblas (org.jblas:jblas:1.2.3 - http://jblas.org/)
910+
(BSD 3-clause style license) jblas (org.jblas:jblas:1.2.4 - http://jblas.org/)
849911
(BSD License) AntLR Parser Generator (antlr:antlr:2.7.7 - http://www.antlr.org/)
850912
(BSD License) Javolution (javolution:javolution:5.5.1 - http://javolution.org)
851913
(BSD licence) ANTLR ST4 4.0.4 (org.antlr:ST4:4.0.4 - http://www.stringtemplate.org)
@@ -888,3 +950,4 @@ The following components are provided under the MIT License. See project link fo
888950
(MIT License) scopt (com.github.scopt:scopt_2.10:3.2.0 - https://github.com/scopt/scopt)
889951
(The MIT License) Mockito (org.mockito:mockito-all:1.8.5 - http://www.mockito.org)
890952
(MIT License) jquery (https://jquery.org/license/)
953+
(MIT License) AnchorJS (https://github.com/bryanbraun/anchorjs)

R/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ The SparkR documentation (Rd files and HTML files) are not a part of the source
5252
SparkR comes with several sample programs in the `examples/src/main/r` directory.
5353
To run one of them, use `./bin/sparkR <filename> <args>`. For example:
5454

55-
./bin/sparkR examples/src/main/r/pi.R local[2]
55+
./bin/sparkR examples/src/main/r/dataframe.R
5656

5757
You can also run the unit-tests for SparkR by running (you need to install the [testthat](http://cran.r-project.org/web/packages/testthat/index.html) package first):
5858

@@ -63,5 +63,5 @@ You can also run the unit-tests for SparkR by running (you need to install the [
6363
The `./bin/spark-submit` and `./bin/sparkR` can also be used to submit jobs to YARN clusters. You will need to set YARN conf dir before doing so. For example on CDH you can run
6464
```
6565
export YARN_CONF_DIR=/etc/hadoop/conf
66-
./bin/spark-submit --master yarn examples/src/main/r/pi.R 4
66+
./bin/spark-submit --master yarn examples/src/main/r/dataframe.R
6767
```

R/create-docs.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
# After running this script the html docs can be found in
2424
# $SPARK_HOME/R/pkg/html
2525

26+
set -o pipefail
27+
set -e
28+
2629
# Figure out where the script is
2730
export FWDIR="$(cd "`dirname "$0"`"; pwd)"
2831
pushd $FWDIR
2932

30-
# Generate Rd file
31-
Rscript -e 'library(devtools); devtools::document(pkg="./pkg", roclets=c("rd"))'
32-
33-
# Install the package
33+
# Install the package (this will also generate the Rd files)
3434
./install-dev.sh
3535

3636
# Now create HTML files

R/install-dev.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,20 @@
2626
# NOTE(shivaram): Right now we use $SPARK_HOME/R/lib to be the installation directory
2727
# to load the SparkR package on the worker nodes.
2828

29+
set -o pipefail
30+
set -e
2931

3032
FWDIR="$(cd `dirname $0`; pwd)"
3133
LIB_DIR="$FWDIR/lib"
3234

3335
mkdir -p $LIB_DIR
3436

35-
# Install R
37+
pushd $FWDIR
38+
39+
# Generate Rd files if devtools is installed
40+
Rscript -e ' if("devtools" %in% rownames(installed.packages())) { library(devtools); devtools::document(pkg="./pkg", roclets=c("rd")) }'
41+
42+
# Install SparkR to $LIB_DIR
3643
R CMD INSTALL --library=$LIB_DIR $FWDIR/pkg/
44+
45+
popd

R/log4j.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
log4j.rootCategory=INFO, file
2020
log4j.appender.file=org.apache.log4j.FileAppender
2121
log4j.appender.file.append=true
22-
log4j.appender.file.file=R-unit-tests.log
22+
log4j.appender.file.file=R/target/unit-tests.log
2323
log4j.appender.file.layout=org.apache.log4j.PatternLayout
2424
log4j.appender.file.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss.SSS} %t %p %c{1}: %m%n
2525

R/pkg/.lintr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
linters: with_defaults(line_length_linter(100), camel_case_linter = NULL)
2+
exclusions: list("inst/profile/general.R" = 1, "inst/profile/shell.R")

R/pkg/NAMESPACE

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,37 @@
11
# Imports from base R
22
importFrom(methods, setGeneric, setMethod, setOldClass)
3-
useDynLib(SparkR, stringHashCode)
3+
4+
# Disable native libraries till we figure out how to package it
5+
# See SPARKR-7839
6+
#useDynLib(SparkR, stringHashCode)
47

58
# S3 methods exported
69
export("sparkR.init")
710
export("sparkR.stop")
811
export("print.jobj")
912

13+
# Job group lifecycle management methods
14+
export("setJobGroup",
15+
"clearJobGroup",
16+
"cancelJobGroup")
17+
1018
exportClasses("DataFrame")
1119

12-
exportMethods("cache",
20+
exportMethods("arrange",
21+
"cache",
1322
"collect",
1423
"columns",
1524
"count",
1625
"describe",
1726
"distinct",
27+
"dropna",
1828
"dtypes",
1929
"except",
2030
"explain",
31+
"fillna",
2132
"filter",
2233
"first",
34+
"group_by",
2335
"groupBy",
2436
"head",
2537
"insertInto",
@@ -28,12 +40,15 @@ exportMethods("cache",
2840
"join",
2941
"limit",
3042
"orderBy",
43+
"mutate",
3144
"names",
3245
"persist",
3346
"printSchema",
3447
"registerTempTable",
48+
"rename",
3549
"repartition",
36-
"sampleDF",
50+
"sample",
51+
"sample_frac",
3752
"saveAsParquetFile",
3853
"saveAsTable",
3954
"saveDF",
@@ -42,42 +57,68 @@ exportMethods("cache",
4257
"selectExpr",
4358
"show",
4459
"showDF",
45-
"sortDF",
60+
"summarize",
4661
"take",
4762
"unionAll",
4863
"unpersist",
4964
"where",
5065
"withColumn",
51-
"withColumnRenamed")
66+
"withColumnRenamed",
67+
"write.df")
5268

5369
exportClasses("Column")
5470

5571
exportMethods("abs",
72+
"acos",
5673
"alias",
5774
"approxCountDistinct",
5875
"asc",
76+
"asin",
77+
"atan",
78+
"atan2",
5979
"avg",
6080
"cast",
81+
"cbrt",
82+
"ceiling",
6183
"contains",
84+
"cos",
85+
"cosh",
6286
"countDistinct",
6387
"desc",
6488
"endsWith",
89+
"exp",
90+
"expm1",
91+
"floor",
6592
"getField",
6693
"getItem",
94+
"hypot",
6795
"isNotNull",
6896
"isNull",
6997
"last",
7098
"like",
99+
"log",
100+
"log10",
101+
"log1p",
71102
"lower",
72103
"max",
73104
"mean",
74105
"min",
106+
"n",
107+
"n_distinct",
108+
"rint",
75109
"rlike",
110+
"sign",
111+
"sin",
112+
"sinh",
76113
"sqrt",
77114
"startsWith",
78115
"substr",
79116
"sum",
80117
"sumDistinct",
118+
"tan",
119+
"tanh",
120+
"toDegrees",
121+
"toRadians",
81122
"upper")
82123

83124
exportClasses("GroupedData")
@@ -94,6 +135,7 @@ export("cacheTable",
94135
"jsonFile",
95136
"loadDF",
96137
"parquetFile",
138+
"read.df",
97139
"sql",
98140
"table",
99141
"tableNames",

0 commit comments

Comments
 (0)