diff --git a/spark/src/main/java/org/opensearch/sql/spark/asyncquery/model/SparkSubmitParameters.java b/spark/src/main/java/org/opensearch/sql/spark/asyncquery/model/SparkSubmitParameters.java index 627d6cfcc5..f5ef155c9c 100644 --- a/spark/src/main/java/org/opensearch/sql/spark/asyncquery/model/SparkSubmitParameters.java +++ b/spark/src/main/java/org/opensearch/sql/spark/asyncquery/model/SparkSubmitParameters.java @@ -155,9 +155,10 @@ private URI parseUri(String opensearchUri, String datasourceName) { } } - public Builder structuredStreaming() { - config.put("spark.flint.job.type", "streaming"); - + public Builder structuredStreaming(Boolean isStructuredStreaming) { + if (isStructuredStreaming) { + config.put("spark.flint.job.type", "streaming"); + } return this; } diff --git a/spark/src/main/java/org/opensearch/sql/spark/dispatcher/SparkQueryDispatcher.java b/spark/src/main/java/org/opensearch/sql/spark/dispatcher/SparkQueryDispatcher.java index 47d14371b1..2749d7c934 100644 --- a/spark/src/main/java/org/opensearch/sql/spark/dispatcher/SparkQueryDispatcher.java +++ b/spark/src/main/java/org/opensearch/sql/spark/dispatcher/SparkQueryDispatcher.java @@ -123,7 +123,7 @@ private StartJobRequest getStartJobRequestForIndexRequest( .dataSource( dataSourceService.getRawDataSourceMetadata( dispatchQueryRequest.getDatasource())) - .structuredStreaming() + .structuredStreaming(indexDetails.getAutoRefresh()) .build() .toString(), tags,