diff --git a/spark/src/test/java/org/opensearch/sql/spark/asyncquery/model/SparkSubmitParametersTest.java b/spark/src/test/java/org/opensearch/sql/spark/asyncquery/model/SparkSubmitParametersTest.java index 296e47f483..e732cf698c 100644 --- a/spark/src/test/java/org/opensearch/sql/spark/asyncquery/model/SparkSubmitParametersTest.java +++ b/spark/src/test/java/org/opensearch/sql/spark/asyncquery/model/SparkSubmitParametersTest.java @@ -43,4 +43,12 @@ public void testBuildQueryStringNestedQuote() { String params = SparkSubmitParameters.Builder.builder().query(rawQuery).build().toString(); assertTrue(params.contains(expectedQueryInParams)); } + + @Test + public void testBuildQueryStringSpecialCharacter() { + String rawQuery = "SELECT '{\"test ,:+\\\"inner\\\"/\\|?#><\"}'"; + String expectedQueryInParams = "SELECT '{\\\"test ,:+\\\\\\\"inner\\\\\\\"/\\\\|?#><\\\"}'"; + String params = SparkSubmitParameters.Builder.builder().query(rawQuery).build().toString(); + assertTrue(params.contains(expectedQueryInParams)); + } }