diff --git a/async-query/src/main/java/org/opensearch/sql/spark/config/SparkExecutionEngineConfigClusterSetting.java b/async-query/src/main/java/org/opensearch/sql/spark/config/SparkExecutionEngineConfigClusterSetting.java index 5c1328bf91..1d6c561fe9 100644 --- a/async-query/src/main/java/org/opensearch/sql/spark/config/SparkExecutionEngineConfigClusterSetting.java +++ b/async-query/src/main/java/org/opensearch/sql/spark/config/SparkExecutionEngineConfigClusterSetting.java @@ -6,8 +6,10 @@ package org.opensearch.sql.spark.config; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; +import lombok.NoArgsConstructor; import org.opensearch.sql.utils.SerializeUtils; /** @@ -16,6 +18,8 @@ */ @Data @Builder +@AllArgsConstructor +@NoArgsConstructor @JsonIgnoreProperties(ignoreUnknown = true) public class SparkExecutionEngineConfigClusterSetting { // optional diff --git a/async-query/src/test/java/org/opensearch/sql/spark/config/SparkExecutionEngineConfigClusterSettingTest.java b/async-query/src/test/java/org/opensearch/sql/spark/config/SparkExecutionEngineConfigClusterSettingTest.java index c6be37567d..a2c7984fc7 100644 --- a/async-query/src/test/java/org/opensearch/sql/spark/config/SparkExecutionEngineConfigClusterSettingTest.java +++ b/async-query/src/test/java/org/opensearch/sql/spark/config/SparkExecutionEngineConfigClusterSettingTest.java @@ -46,4 +46,18 @@ public void testToSparkExecutionEngineConfigWithAllFields() { assertEquals("us-west-1", config.getRegion()); assertEquals("--conf A=1", config.getSparkSubmitParameters()); } + + @Test + public void testToSparkExecutionEngineConfigWithNoFields() { + String json = "{}"; + + SparkExecutionEngineConfigClusterSetting config = + SparkExecutionEngineConfigClusterSetting.toSparkExecutionEngineConfig(json); + + assertNull(config.getApplicationId()); + assertNull(config.getExecutionRoleARN()); + assertNull(config.getRegion()); + assertNull(config.getSparkSubmitParameters()); + } + }