You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@paimon.apache.org by lz...@apache.org on 2023/09/13 08:10:03 UTC
[incubator-paimon] branch master updated: [hotfix] fix failed test CallStatementParserTest (#2006)
This is an automated email from the ASF dual-hosted git repository.
lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-paimon.git
The following commit(s) were added to refs/heads/master by this push:
new 2431f1ca2 [hotfix] fix failed test CallStatementParserTest (#2006)
2431f1ca2 is described below
commit 2431f1ca2f53d4bb39ab6839a7f3a982fc995a73
Author: yuzelin <33...@users.noreply.github.com>
AuthorDate: Wed Sep 13 16:09:58 2023 +0800
[hotfix] fix failed test CallStatementParserTest (#2006)
---
.../apache/paimon/spark/extensions/CallStatementParserTest.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/paimon-spark/paimon-spark-common/src/test/java/org/apache/paimon/spark/extensions/CallStatementParserTest.java b/paimon-spark/paimon-spark-common/src/test/java/org/apache/paimon/spark/extensions/CallStatementParserTest.java
index 1ecdc89d8..5f0c61a8c 100644
--- a/paimon-spark/paimon-spark-common/src/test/java/org/apache/paimon/spark/extensions/CallStatementParserTest.java
+++ b/paimon-spark/paimon-spark-common/src/test/java/org/apache/paimon/spark/extensions/CallStatementParserTest.java
@@ -38,6 +38,7 @@ import java.sql.Timestamp;
import java.time.Instant;
import java.util.Arrays;
+import scala.Option;
import scala.collection.JavaConverters;
import static org.assertj.core.api.Assertions.assertThat;
@@ -52,7 +53,11 @@ public class CallStatementParserTest {
@BeforeEach
public void startSparkSession() {
// Stops and clears active session to avoid loading previous non-stopped session.
- SparkSession.getActiveSession().orElse(SparkSession::getDefaultSession).get().stop();
+ Option<SparkSession> optionalSession =
+ SparkSession.getActiveSession().orElse(SparkSession::getDefaultSession);
+ if (!optionalSession.isEmpty()) {
+ optionalSession.get().stop();
+ }
SparkSession.clearActiveSession();
spark =
SparkSession.builder()