Skip to content

Commit 50738d6

Browse files
committed
remove to json string
Signed-off-by: xinyual <xinyual@amazon.com>
1 parent 3662661 commit 50738d6

7 files changed

Lines changed: 2 additions & 74 deletions

File tree

core/src/main/java/org/opensearch/sql/expression/function/PPLBuiltinOperators.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import org.opensearch.sql.expression.function.jsonUDF.JsonFunctionImpl;
3535
import org.opensearch.sql.expression.function.jsonUDF.JsonKeysFunctionImpl;
3636
import org.opensearch.sql.expression.function.jsonUDF.JsonSetFunctionImpl;
37-
import org.opensearch.sql.expression.function.jsonUDF.ToJsonStringFunctionImpl;
3837
import org.opensearch.sql.expression.function.udf.CryptographicFunction;
3938
import org.opensearch.sql.expression.function.udf.datetime.AddSubDateFunction;
4039
import org.opensearch.sql.expression.function.udf.datetime.CurrentFunction;
@@ -68,8 +67,6 @@ public class PPLBuiltinOperators extends ReflectiveSqlOperatorTable {
6867
// Math functions
6968
public static final SqlOperator SPAN = new SpanFunctionImpl().toUDF("SPAN");
7069
public static final SqlOperator JSON = new JsonFunctionImpl().toUDF("JSON");
71-
public static final SqlOperator TO_JSON_STRING =
72-
new ToJsonStringFunctionImpl().toUDF("TO_JSON_STRING");
7370
public static final SqlOperator JSON_ARRAY_LENGTH =
7471
new JsonArrayLengthFunctionImpl().toUDF("JSON_ARRAY_LENGTH");
7572
public static final SqlOperator JSON_EXTRACT =

core/src/main/java/org/opensearch/sql/expression/function/PPLFuncImpTable.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,6 @@ void populate() {
319319
Stream.concat(Stream.of(builder.makeFlag(NULL_ON_NULL)), Arrays.stream(args))
320320
.toArray(RexNode[]::new))));
321321
registerOperator(JSON, PPLBuiltinOperators.JSON);
322-
registerOperator(TO_JSON_STRING, PPLBuiltinOperators.TO_JSON_STRING);
323322
registerOperator(JSON_ARRAY_LENGTH, PPLBuiltinOperators.JSON_ARRAY_LENGTH);
324323
registerOperator(JSON_EXTRACT, PPLBuiltinOperators.JSON_EXTRACT);
325324
registerOperator(JSON_KEYS, PPLBuiltinOperators.JSON_KEYS);

core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/ToJsonStringFunctionImpl.java

Lines changed: 0 additions & 52 deletions
This file was deleted.

integ-test/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,8 @@ integTest {
448448

449449
dependsOn ':opensearch-sql-plugin:bundlePlugin'
450450
if(getOSFamilyType() != "windows") {
451-
dependsOn startPrometheus
452-
finalizedBy stopPrometheus
451+
//dependsOn startPrometheus
452+
//finalizedBy stopPrometheus
453453
}
454454

455455
// enable calcite codegen in IT

integ-test/src/test/java/org/opensearch/sql/calcite/standalone/CalcitePPLJsonBuiltinFunctionIT.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -85,20 +85,6 @@ public void testJsonArrayWithDifferentType() {
8585
verifyDataRows(actual, rows("[1,\"123\",\"{\\\"name\\\":3}\"]"));
8686
}
8787

88-
@Test
89-
public void testToJsonString() {
90-
JSONObject actual =
91-
executeQuery(
92-
String.format(
93-
"source=%s | eval a = to_json_string(name) | fields a" + " | head 1",
94-
TEST_INDEX_GAME_OF_THRONES));
95-
96-
verifySchema(actual, schema("a", "string"));
97-
98-
verifyDataRows(
99-
actual, rows("{\"firstname\":\"Daenerys\",\"lastname\":\"Targaryen\",\"ofHerName\":1}"));
100-
}
101-
10288
@Test
10389
public void testJsonArrayLength() {
10490
JSONObject actual =

ppl/src/main/antlr/OpenSearchPPLLexer.g4

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,6 @@ JSON_VALID: 'JSON_VALID';
372372
JSON: 'JSON';
373373
JSON_OBJECT: 'JSON_OBJECT';
374374
JSON_ARRAY: 'JSON_ARRAY';
375-
TO_JSON_STRING: 'TO_JSON_STRING';
376375
JSON_ARRAY_LENGTH: 'JSON_ARRAY_LENGTH';
377376
JSON_EXTRACT: 'JSON_EXTRACT';
378377
JSON_KEYS: 'JSON_KEYS';

ppl/src/main/antlr/OpenSearchPPLParser.g4

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,6 @@ jsonFunctionName
702702
: JSON
703703
| JSON_OBJECT
704704
| JSON_ARRAY
705-
| TO_JSON_STRING
706705
| JSON_ARRAY_LENGTH
707706
| JSON_EXTRACT
708707
| JSON_KEYS

0 commit comments

Comments
 (0)