Skip to content

Commit 7cd8b29

Browse files
authored
Deps: Update org.apache.spark:spark-sql_2.12 to 3.5.5 (googleapis#703)
* Deps: Update to apache spark-sql 3.5.5 * Update scala version to 2.13.8 * Update spark in snippets/pom.xml * Update pom.xml * Upgrade to scala 2.11.12 * Upgrade scale to 2.12.20 * Set to spark-sql_3.12 * spark-sql_2.12 * Update PslSparkUtils.java with scala 2.13 CollectionConverters * Update pom.xml with scala 2.13.16 * Update snippets/pom.xml with 2.13 * Update samples/snapshot/pom.xml with 2.12 * Update PslSparkUtils.java fix import * Update PslWrite.java to override useCommitCoordinator() * Update PslWrite.java * Fix broken pom.xml * Fix scala in PslSparkUtilsTest * Add spark-sql-api * Fix lint errors * Fix commons-lang missing dependency * Remove dependency on StringUtils * remove uneeded import * Fix String.startsWith * Set useCommitCoordinator true * Unpin scala * removing spark pinning * Update current version * Update dataproc image version * Temporarily downgrade to 3.5.3 to test on dataproc * Update samples README and versions.txt * Revert pom changes in samples * Revert "Remove dependency on StringUtils" This reverts commit ac0e9fb. * Separate versioning from PR * Revert string utils update * Revert scala version to 2.12.20 * Revert CollectionConverter changes * Add spark-sql-api undeclared dependency * Update to 3.5.5 again and fix warnings
1 parent 26f9d67 commit 7cd8b29

File tree

9 files changed

+20
-6
lines changed

9 files changed

+20
-6
lines changed

pom.xml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
<maven.compiler.source>1.8</maven.compiler.source>
1717
<maven.compiler.target>1.8</maven.compiler.target>
1818
<encoding>UTF-8</encoding>
19-
<scala.version>2.12.15</scala.version>
19+
<scala.version>2.12.20</scala.version>
2020
<scala.version.short>2.12</scala.version.short>
21-
<spark.version>3.1.2</spark.version>
21+
<spark.version>3.5.5</spark.version>
2222
<hadoop.version>3.2.2</hadoop.version>
2323
</properties>
2424
<dependencyManagement>
@@ -114,6 +114,12 @@
114114
<version>${spark.version}</version>
115115
<scope>provided</scope>
116116
</dependency>
117+
<dependency>
118+
<groupId>org.apache.spark</groupId>
119+
<artifactId>spark-sql-api_${scala.version.short}</artifactId>
120+
<version>${spark.version}</version>
121+
<scope>provided</scope>
122+
</dependency>
117123
<dependency>
118124
<groupId>org.apache.spark</groupId>
119125
<artifactId>spark-unsafe_${scala.version.short}</artifactId>

samples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ follow the steps:
5656
```
5757
4. Create a Dataproc cluster
5858
```sh
59-
gcloud dataproc clusters create $CLUSTER_NAME --region=$REGION --zone=$REGION-$ZONE_ID --image-version=1.5-debian10 --scopes=cloud-platform
59+
gcloud dataproc clusters create $CLUSTER_NAME --region=$REGION --zone=$REGION-$ZONE_ID --image-version=2.3-debian12 --scopes=cloud-platform
6060
```
6161
5. Package sample jar
6262
```sh

samples/simple_read_sample.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if [ "$1" == "run" ]; then
2525
gcloud dataproc clusters create $CLUSTER_NAME \
2626
--region=$REGION \
2727
--zone=$REGION-$ZONE_ID \
28-
--image-version=1.5-debian10 \
28+
--image-version=2.3-debian12 \
2929
--scopes=cloud-platform
3030

3131
# Package sample jar

samples/simple_write_sample.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ if [ "$1" == "run" ]; then
2121
gcloud dataproc clusters create $CLUSTER_NAME \
2222
--region=$REGION \
2323
--zone=$REGION-$ZONE_ID \
24-
--image-version=1.5-debian10 \
24+
--image-version=2.3-debian12 \
2525
--scopes=cloud-platform
2626

2727
# Package sample jar

samples/word_count_sample.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ if [ "$1" == "run" ]; then
2626
gcloud dataproc clusters create $CLUSTER_NAME \
2727
--region=$REGION \
2828
--zone=$REGION-$ZONE_ID \
29-
--image-version=1.5-debian10 \
29+
--image-version=2.3-debian12 \
3030
--scopes=cloud-platform
3131

3232
# Package sample jar

src/main/java/com/google/cloud/pubsublite/spark/BaseDataStream.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ public void commit(org.apache.spark.sql.connector.read.streaming.Offset end) {
8181
}
8282

8383
@Override
84+
@SuppressWarnings("try")
8485
public void stop() {
8586
try (AutoCloseable a = committer;
8687
AutoCloseable b = cursorClient;

src/main/java/com/google/cloud/pubsublite/spark/PslWrite.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,9 @@ public BatchWrite buildForBatch() {
102102
public StreamingWrite buildForStreaming() {
103103
return this;
104104
}
105+
106+
@Override
107+
public boolean useCommitCoordinator() {
108+
return true;
109+
}
105110
}

src/main/java/com/google/cloud/pubsublite/spark/internal/LimitingHeadOffsetReader.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ public PslSourceOffset getHeadOffset() {
101101
}
102102

103103
@Override
104+
@SuppressWarnings("try")
104105
public void close() {
105106
try (AutoCloseable a = topicStatsClient;
106107
Closeable b = partitionCountReader) {

src/main/java/com/google/cloud/pubsublite/spark/internal/MultiPartitionCommitter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@ interface CommitterFactory {
2929

3030
void commit(PslSourceOffset offset);
3131

32+
@Override
3233
void close();
3334
}

0 commit comments

Comments
 (0)