Skip to content

Commit 07f475b

Browse files
committed
Merge branch 'upmaster' into SPARK-36406
2 parents dcfcc47 + 9054a6a commit 07f475b

File tree

250 files changed

+4692
-1617
lines changed

Some content is hidden

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

250 files changed

+4692
-1617
lines changed

.github/workflows/benchmark.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
120
name: Run benchmarks
221

322
on:

.github/workflows/build_and_test.yml

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
120
name: Build and test
221

322
on:
@@ -686,7 +705,7 @@ jobs:
686705
HIVE_PROFILE: hive2.3
687706
GITHUB_PREV_SHA: ${{ github.event.before }}
688707
SPARK_LOCAL_IP: localhost
689-
ORACLE_DOCKER_IMAGE_NAME: oracle/database:18.4.0-xe
708+
ORACLE_DOCKER_IMAGE_NAME: gvenzl/oracle-xe:18.4.0
690709
SKIP_MIMA: true
691710
steps:
692711
- name: Checkout Spark repository
@@ -724,24 +743,6 @@ jobs:
724743
uses: actions/setup-java@v1
725744
with:
726745
java-version: 8
727-
- name: Cache Oracle docker-images repository
728-
id: cache-oracle-docker-images
729-
uses: actions/cache@v2
730-
with:
731-
path: ./oracle/docker-images
732-
# key should contains the commit hash of the Oracle docker images to be checkout.
733-
key: oracle-docker-images-3f422c4a35b423dfcdbcc57a84f01db6c82eb6c1
734-
- name: Checkout Oracle docker-images repository
735-
uses: actions/checkout@v2
736-
with:
737-
fetch-depth: 0
738-
repository: oracle/docker-images
739-
ref: 3f422c4a35b423dfcdbcc57a84f01db6c82eb6c1
740-
path: ./oracle/docker-images
741-
- name: Install Oracle Docker image
742-
run: |
743-
cd oracle/docker-images/OracleDatabase/SingleInstance/dockerfiles
744-
./buildContainerImage.sh -v 18.4.0 -x
745746
- name: Run tests
746747
run: |
747748
./dev/run-tests --parallelism 1 --modules docker-integration-tests --included-tags org.apache.spark.tags.DockerTest

.github/workflows/cancel_duplicate_workflow_runs.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
120
name: Cancelling Duplicates
221
on:
322
workflow_run:

.github/workflows/publish_snapshot.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
120
name: Publish Snapshot
221

322
on:

.github/workflows/stale.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
120
name: Close stale PRs
221

322
on:

.github/workflows/test_report.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
120
name: Report test results
221
on:
322
workflow_run:

R/pkg/R/sparkR.R

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,40 @@ sparkCheckInstall <- function(sparkHome, master, deployMode) {
655655
} else {
656656
if (interactive() || isMasterLocal(master)) {
657657
message("Spark not found in SPARK_HOME: ", sparkHome)
658+
# If EXISTING_SPARKR_BACKEND_PORT environment variable is set, assume
659+
# that we're in Spark submit. spark-submit always sets Spark home
660+
# so this case should not happen. This is just a safeguard.
661+
isSparkRSubmit <- Sys.getenv("EXISTING_SPARKR_BACKEND_PORT", "") != ""
662+
663+
# SPARKR_ASK_INSTALLATION is an internal environment variable in case
664+
# users want to disable this behavior. This environment variable should
665+
# be removed if no user complains. This environment variable was added
666+
# in case other notebook projects are affected.
667+
if (!isSparkRSubmit && Sys.getenv("SPARKR_ASK_INSTALLATION", "TRUE") == "TRUE") {
668+
# Finally, we're either plain R shell or Rscript.
669+
msg <- paste0(
670+
"Will you download and install (or reuse if it exists) Spark package ",
671+
"under the cache [", sparkCachePath(), "]? (y/n): ")
672+
673+
answer <- NA
674+
while (is.na(answer) || (answer != "y" && answer != "n")) {
675+
# Dispatch on R shell in case readLines does not work in RStudio
676+
# See https://stackoverflow.com/questions/30191232/use-stdin-from-within-r-studio
677+
if (interactive()) {
678+
answer <- readline(prompt = msg)
679+
} else {
680+
cat(msg)
681+
answer <- readLines("stdin", n = 1)
682+
}
683+
}
684+
if (answer == "n") {
685+
stop(paste0(
686+
"Please make sure Spark package is installed in this machine.\n",
687+
" - If there is one, set the path in sparkHome parameter or ",
688+
"environment variable SPARK_HOME.\n",
689+
" - If not, you may run install.spark function to do the job."))
690+
}
691+
}
658692
packageLocalDir <- install.spark()
659693
packageLocalDir
660694
} else if (isClientMode(master) || deployMode == "client") {

common/kvstore/src/main/java/org/apache/spark/util/kvstore/LevelDB.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919

2020
import java.io.File;
2121
import java.io.IOException;
22-
import java.lang.ref.SoftReference;
22+
import java.lang.ref.Reference;
23+
import java.lang.ref.WeakReference;
2324
import java.util.*;
2425
import java.util.concurrent.ConcurrentHashMap;
2526
import java.util.concurrent.ConcurrentLinkedQueue;
@@ -69,10 +70,10 @@ public class LevelDB implements KVStore {
6970

7071
/**
7172
* Trying to close a JNI LevelDB handle with a closed DB causes JVM crashes. This is used to
72-
* ensure that all iterators are correctly closed before LevelDB is closed. Use soft reference
73+
* ensure that all iterators are correctly closed before LevelDB is closed. Use weak references
7374
* to ensure that the iterator can be GCed, when it is only referenced here.
7475
*/
75-
private final ConcurrentLinkedQueue<SoftReference<LevelDBIterator<?>>> iteratorTracker;
76+
private final ConcurrentLinkedQueue<Reference<LevelDBIterator<?>>> iteratorTracker;
7677

7778
public LevelDB(File path) throws Exception {
7879
this(path, new KVStoreSerializer());
@@ -250,7 +251,7 @@ public <T> KVStoreView<T> view(Class<T> type) throws Exception {
250251
public Iterator<T> iterator() {
251252
try {
252253
LevelDBIterator<T> it = new LevelDBIterator<>(type, LevelDB.this, this);
253-
iteratorTracker.add(new SoftReference<>(it));
254+
iteratorTracker.add(new WeakReference<>(it));
254255
return it;
255256
} catch (Exception e) {
256257
throw Throwables.propagate(e);
@@ -301,7 +302,7 @@ public void close() throws IOException {
301302

302303
try {
303304
if (iteratorTracker != null) {
304-
for (SoftReference<LevelDBIterator<?>> ref: iteratorTracker) {
305+
for (Reference<LevelDBIterator<?>> ref: iteratorTracker) {
305306
LevelDBIterator<?> it = ref.get();
306307
if (it != null) {
307308
it.close();

core/src/main/resources/error/error-classes.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"message" : [ "Field name %s is ambiguous and has %s matching fields in the struct." ],
44
"sqlState" : "42000"
55
},
6+
"CONCURRENT_QUERY_ERROR" : {
7+
"message" : [ "Another instance of this query was just started by a concurrent session." ]
8+
},
69
"DIVIDE_BY_ZERO" : {
710
"message" : [ "divide by zero" ],
811
"sqlState" : "22012"
@@ -11,6 +14,13 @@
1114
"message" : [ "Found duplicate keys '%s'" ],
1215
"sqlState" : "23000"
1316
},
17+
"FAILED_RENAME_PATH" : {
18+
"message" : [ "Failed to rename %s to %s as destination already exists" ],
19+
"sqlState" : "22023"
20+
},
21+
"FAILED_SET_ORIGINAL_PERMISSION_BACK" : {
22+
"message" : [ "Failed to set original permission %s back to the created path: %s. Exception: %s" ]
23+
},
1424
"GROUPING_COLUMN_MISMATCH" : {
1525
"message" : [ "Column of grouping (%s) can't be found in grouping columns %s" ],
1626
"sqlState" : "42000"
@@ -29,17 +39,32 @@
2939
"message" : [ "Invalid pivot column '%s'. Pivot columns must be comparable." ],
3040
"sqlState" : "42000"
3141
},
42+
"INCOMPATIBLE_DATASOURCE_REGISTER" : {
43+
"message" : [ "Detected an incompatible DataSourceRegister. Please remove the incompatible library from classpath or upgrade it. Error: %s" ]
44+
},
45+
"INDEX_OUT_OF_BOUNDS" : {
46+
"message" : [ "Index %s must be between 0 and the length of the ArrayData." ],
47+
"sqlState" : "22023"
48+
},
3249
"INVALID_FIELD_NAME" : {
3350
"message" : [ "Field name %s is invalid: %s is not a struct." ],
3451
"sqlState" : "42000"
3552
},
53+
"INVALID_FRACTION_OF_SECOND" : {
54+
"message" : [ "The fraction of sec must be zero. Valid range is [0, 60]." ],
55+
"sqlState" : "22023"
56+
},
3657
"INVALID_JSON_SCHEMA_MAPTYPE" : {
3758
"message" : [ "Input schema %s can only contain StringType as a key type for a MapType." ]
3859
},
3960
"MISSING_COLUMN" : {
4061
"message" : [ "cannot resolve '%s' given input columns: [%s]" ],
4162
"sqlState" : "42000"
4263
},
64+
"MISSING_METHOD" : {
65+
"message" : [ "A method named \"%s\" is not declared in any enclosing class nor any supertype" ],
66+
"sqlState" : "42000"
67+
},
4368
"MISSING_STATIC_PARTITION_COLUMN" : {
4469
"message" : [ "Unknown static partition column: %s" ],
4570
"sqlState" : "42000"
@@ -56,13 +81,29 @@
5681
"message" : [ "Invalid pivot value '%s': value data type %s does not match pivot column data type %s" ],
5782
"sqlState" : "42000"
5883
},
84+
"RENAME_SRC_PATH_NOT_FOUND" : {
85+
"message" : [ "Failed to rename as %s was not found" ],
86+
"sqlState" : "22023"
87+
},
5988
"SECOND_FUNCTION_ARGUMENT_NOT_INTEGER" : {
6089
"message" : [ "The second argument of '%s' function needs to be an integer." ],
6190
"sqlState" : "22023"
6291
},
6392
"UNABLE_TO_ACQUIRE_MEMORY" : {
6493
"message" : [ "Unable to acquire %s bytes of memory, got %s" ]
6594
},
95+
"UNRECOGNIZED_SQL_TYPE" : {
96+
"message" : [ "Unrecognized SQL type %s" ],
97+
"sqlState" : "42000"
98+
},
99+
"UNSUPPORTED_LITERAL_TYPE" : {
100+
"message" : [ "Unsupported literal type %s %s" ],
101+
"sqlState" : "0A000"
102+
},
103+
"UNSUPPORTED_TRANSACTION_BY_JDBC_SERVER" : {
104+
"message" : [ "The target JDBC server does not support transaction and can only support ALTER TABLE with a single action." ],
105+
"sqlState" : "0A000"
106+
},
66107
"WRITING_JOB_ABORTED" : {
67108
"message" : [ "Writing job aborted" ],
68109
"sqlState" : "40000"

0 commit comments

Comments
 (0)