Skip to content

Commit 37dc4b1

Browse files
committed
rerun plan stability
2 parents e202987 + ac8307d commit 37dc4b1

File tree

906 files changed

+65038
-54903
lines changed

Some content is hidden

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

906 files changed

+65038
-54903
lines changed

.asf.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
# https://cwiki.apache.org/confluence/display/INFRA/.asf.yaml+features+for+git+repositories
16+
# https://cwiki.apache.org/confluence/display/INFRA/git+-+.asf.yaml+features
1717
---
1818
github:
1919
description: "Apache Spark - A unified analytics engine for large-scale data processing"

R/pkg/R/functions.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ NULL
247247
#' used to transform the data. The first argument is the key, the second argument
248248
#' is the value.
249249
#' }
250-
#' @param zero a \code{Column} used as the initial value in \code{array_aggregate}
250+
#' @param initialValue a \code{Column} used as the initial value in \code{array_aggregate}
251251
#' @param merge a \code{function} a binary function \code{(Column, Column) -> Column}
252252
#' used in \code{array_aggregate}to merge values (the second argument)
253253
#' into accumulator (the first argument).
@@ -3666,11 +3666,11 @@ invoke_higher_order_function <- function(name, cols, funs) {
36663666
#' @aliases array_aggregate array_aggregate,characterOrColumn,Column,function-method
36673667
#' @note array_aggregate since 3.1.0
36683668
setMethod("array_aggregate",
3669-
signature(x = "characterOrColumn", zero = "Column", merge = "function"),
3670-
function(x, zero, merge, finish = NULL) {
3669+
signature(x = "characterOrColumn", initialValue = "Column", merge = "function"),
3670+
function(x, initialValue, merge, finish = NULL) {
36713671
invoke_higher_order_function(
36723672
"ArrayAggregate",
3673-
cols = list(x, zero),
3673+
cols = list(x, initialValue),
36743674
funs = if (is.null(finish)) {
36753675
list(merge)
36763676
} else {

R/pkg/R/generics.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,8 @@ setGeneric("approxCountDistinct", function(x, ...) { standardGeneric("approxCoun
780780

781781
#' @rdname column_collection_functions
782782
#' @name NULL
783-
setGeneric("array_aggregate", function(x, zero, merge, ...) { standardGeneric("array_aggregate") })
783+
setGeneric("array_aggregate",
784+
function(x, initialValue, merge, ...) { standardGeneric("array_aggregate") })
784785

785786
#' @rdname column_collection_functions
786787
#' @name NULL

common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,17 @@ public UTF8String trimRight() {
683683
return copyUTF8String(0, e);
684684
}
685685

686+
/**
687+
* Trims at most `numSpaces` space characters (ASCII 32) from the end of this string.
688+
*/
689+
public UTF8String trimTrailingSpaces(int numSpaces) {
690+
assert numSpaces > 0;
691+
int endIdx = numBytes - 1;
692+
int trimTo = numBytes - numSpaces;
693+
while (endIdx >= trimTo && getByte(endIdx) == 0x20) endIdx--;
694+
return copyUTF8String(0, endIdx);
695+
}
696+
686697
/**
687698
* Trims instances of the given trim string from the end of this string.
688699
*
@@ -1065,16 +1076,20 @@ public UTF8String replace(UTF8String search, UTF8String replace) {
10651076
return buf.build();
10661077
}
10671078

1068-
// TODO: Need to use `Code Point` here instead of Char in case the character longer than 2 bytes
1069-
public UTF8String translate(Map<Character, Character> dict) {
1079+
public UTF8String translate(Map<String, String> dict) {
10701080
String srcStr = this.toString();
10711081

10721082
StringBuilder sb = new StringBuilder();
1073-
for(int k = 0; k< srcStr.length(); k++) {
1074-
if (null == dict.get(srcStr.charAt(k))) {
1075-
sb.append(srcStr.charAt(k));
1076-
} else if ('\0' != dict.get(srcStr.charAt(k))){
1077-
sb.append(dict.get(srcStr.charAt(k)));
1083+
int charCount = 0;
1084+
for (int k = 0; k < srcStr.length(); k += charCount) {
1085+
int codePoint = srcStr.codePointAt(k);
1086+
charCount = Character.charCount(codePoint);
1087+
String subStr = srcStr.substring(k, k + charCount);
1088+
String translated = dict.get(subStr);
1089+
if (null == translated) {
1090+
sb.append(subStr);
1091+
} else if (!"\0".equals(translated)) {
1092+
sb.append(translated);
10781093
}
10791094
}
10801095
return fromString(sb.toString());

common/unsafe/src/test/java/org/apache/spark/unsafe/types/UTF8StringSuite.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -465,27 +465,27 @@ public void translate() {
465465
assertEquals(
466466
fromString("1a2s3ae"),
467467
fromString("translate").translate(ImmutableMap.of(
468-
'r', '1',
469-
'n', '2',
470-
'l', '3',
471-
't', '\0'
468+
"r", "1",
469+
"n", "2",
470+
"l", "3",
471+
"t", "\0"
472472
)));
473473
assertEquals(
474474
fromString("translate"),
475475
fromString("translate").translate(new HashMap<>()));
476476
assertEquals(
477477
fromString("asae"),
478478
fromString("translate").translate(ImmutableMap.of(
479-
'r', '\0',
480-
'n', '\0',
481-
'l', '\0',
482-
't', '\0'
479+
"r", "\0",
480+
"n", "\0",
481+
"l", "\0",
482+
"t", "\0"
483483
)));
484484
assertEquals(
485485
fromString("aa世b"),
486486
fromString("花花世界").translate(ImmutableMap.of(
487-
'花', 'a',
488-
'界', 'b'
487+
"花", "a",
488+
"界", "b"
489489
)));
490490
}
491491

core/pom.xml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,13 @@
3535
</properties>
3636

3737
<dependencies>
38-
<dependency>
39-
<groupId>com.thoughtworks.paranamer</groupId>
40-
<artifactId>paranamer</artifactId>
41-
</dependency>
4238
<dependency>
4339
<groupId>org.apache.avro</groupId>
4440
<artifactId>avro</artifactId>
4541
</dependency>
4642
<dependency>
4743
<groupId>org.apache.avro</groupId>
4844
<artifactId>avro-mapred</artifactId>
49-
<classifier>${avro.mapred.classifier}</classifier>
5045
</dependency>
5146
<dependency>
5247
<groupId>com.google.guava</groupId>
@@ -171,6 +166,10 @@
171166
<artifactId>jakarta.servlet-api</artifactId>
172167
<version>${jakartaservlet.version}</version>
173168
</dependency>
169+
<dependency>
170+
<groupId>commons-codec</groupId>
171+
<artifactId>commons-codec</artifactId>
172+
</dependency>
174173
<dependency>
175174
<groupId>org.apache.commons</groupId>
176175
<artifactId>commons-lang3</artifactId>

core/src/main/java/org/apache/spark/shuffle/api/WritableByteChannelWrapper.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
/**
2626
* :: Private ::
27-
*
2827
* A thin wrapper around a {@link WritableByteChannel}.
2928
* <p>
3029
* This is primarily provided for the local disk shuffle implementation to provide a

core/src/main/java/org/apache/spark/shuffle/api/metadata/MapOutputCommitMessage.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
/**
2525
* :: Private ::
26-
*
2726
* Represents the result of writing map outputs for a shuffle map task.
2827
* <p>
2928
* Partition lengths represents the length of each block written in the map task. This can

core/src/main/java/org/apache/spark/shuffle/api/metadata/MapOutputMetadata.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
/**
2323
* :: Private ::
24-
*
2524
* An opaque metadata tag for registering the result of committing the output of a
2625
* shuffle map task.
2726
* <p>

core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import java.util.Comparator;
2121
import java.util.LinkedList;
2222

23-
import org.apache.avro.reflect.Nullable;
23+
import javax.annotation.Nullable;
2424

2525
import org.apache.spark.TaskContext;
2626
import org.apache.spark.memory.MemoryConsumer;

0 commit comments

Comments
 (0)