From f21682f6738e77c525303b481d6ae6ff726e04ef Mon Sep 17 00:00:00 2001 From: Louis Chu Date: Thu, 5 Sep 2024 14:11:30 -0700 Subject: [PATCH] Fix type mismatch Signed-off-by: Louis Chu --- .../config/OpenSearchAsyncQuerySchedulerConfigComposer.java | 4 ++-- .../OpenSearchAsyncQuerySchedulerConfigComposerTest.java | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/async-query/src/main/java/org/opensearch/sql/spark/config/OpenSearchAsyncQuerySchedulerConfigComposer.java b/async-query/src/main/java/org/opensearch/sql/spark/config/OpenSearchAsyncQuerySchedulerConfigComposer.java index 6dce09a406..f791b050a1 100644 --- a/async-query/src/main/java/org/opensearch/sql/spark/config/OpenSearchAsyncQuerySchedulerConfigComposer.java +++ b/async-query/src/main/java/org/opensearch/sql/spark/config/OpenSearchAsyncQuerySchedulerConfigComposer.java @@ -24,12 +24,12 @@ public void compose( SparkSubmitParameters sparkSubmitParameters, DispatchQueryRequest dispatchQueryRequest, AsyncQueryRequestContext context) { - String externalSchedulerEnabled = + Boolean externalSchedulerEnabled = settings.getSettingValue(Settings.Key.ASYNC_QUERY_EXTERNAL_SCHEDULER_ENABLED); String externalSchedulerInterval = settings.getSettingValue(Settings.Key.ASYNC_QUERY_EXTERNAL_SCHEDULER_INTERVAL); sparkSubmitParameters.setConfigItem( - FLINT_JOB_EXTERNAL_SCHEDULER_ENABLED, externalSchedulerEnabled); + FLINT_JOB_EXTERNAL_SCHEDULER_ENABLED, String.valueOf(externalSchedulerEnabled)); sparkSubmitParameters.setConfigItem( FLINT_JOB_EXTERNAL_SCHEDULER_INTERVAL, externalSchedulerInterval); } diff --git a/async-query/src/test/java/org/opensearch/sql/spark/config/OpenSearchAsyncQuerySchedulerConfigComposerTest.java b/async-query/src/test/java/org/opensearch/sql/spark/config/OpenSearchAsyncQuerySchedulerConfigComposerTest.java index 7836c63b7a..1556d4db3f 100644 --- a/async-query/src/test/java/org/opensearch/sql/spark/config/OpenSearchAsyncQuerySchedulerConfigComposerTest.java +++ b/async-query/src/test/java/org/opensearch/sql/spark/config/OpenSearchAsyncQuerySchedulerConfigComposerTest.java @@ -31,7 +31,7 @@ public void setUp() { @Test public void testCompose() { when(settings.getSettingValue(Settings.Key.ASYNC_QUERY_EXTERNAL_SCHEDULER_ENABLED)) - .thenReturn("true"); + .thenReturn(true); when(settings.getSettingValue(Settings.Key.ASYNC_QUERY_EXTERNAL_SCHEDULER_INTERVAL)) .thenReturn("10 minutes"); @@ -46,7 +46,7 @@ public void testCompose() { @Test public void testComposeWithDisabledScheduler() { when(settings.getSettingValue(Settings.Key.ASYNC_QUERY_EXTERNAL_SCHEDULER_ENABLED)) - .thenReturn("false"); + .thenReturn(false); composer.compose(sparkSubmitParameters, dispatchQueryRequest, context); @@ -57,7 +57,7 @@ public void testComposeWithDisabledScheduler() { @Test public void testComposeWithMissingInterval() { when(settings.getSettingValue(Settings.Key.ASYNC_QUERY_EXTERNAL_SCHEDULER_ENABLED)) - .thenReturn("true"); + .thenReturn(true); when(settings.getSettingValue(Settings.Key.ASYNC_QUERY_EXTERNAL_SCHEDULER_INTERVAL)) .thenReturn("");