Skip to content

Commit

Permalink
Fix SparkExecutionEngineConfigClusterSetting deserialize issue
Browse files Browse the repository at this point in the history
Signed-off-by: Tomoyuki Morita <[email protected]>
  • Loading branch information
ykmr1224 committed Jul 17, 2024
1 parent a151a7d commit 4ae4566
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -16,6 +18,8 @@
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
public class SparkExecutionEngineConfigClusterSetting {
// optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

}

0 comments on commit 4ae4566

Please sign in to comment.