Skip to content

Commit

Permalink
update PR to only inclide
Browse files Browse the repository at this point in the history
json_delete
json_append

Signed-off-by: YANGDB <[email protected]>
  • Loading branch information
YANG-DB committed Dec 11, 2024
1 parent 88bcaea commit 09b7b5c
Showing 1 changed file with 1 addition and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,31 +235,7 @@ class PPLLogicalPlanJsonFunctionsTranslatorTestSuite
val expectedPlan = Project(Seq(UnresolvedStar(None)), eval)
comparePlans(expectedPlan, logPlan, false)
}

test("test json_extend()") {
val context = new CatalystPlanContext
val logPlan =
planTransformer.visit(
plan(
pplParser,
"""source=t | eval result = json_extend('{"a":[{"b":1},{"c":2}]}', array('a.b', 'c','d'))"""),
context)

val table = UnresolvedRelation(Seq("t"))
val keysExpression =
UnresolvedFunction(
"array",
Seq(Literal("a.b"), Literal("c"), Literal("d")),
isDistinct = false)
val jsonObjExp =
Literal("""{"a":[{"b":1},{"c":2}]}""")
val jsonFunc =
Alias(visit("json_extend", util.List.of(jsonObjExp, keysExpression)), "result")()
val eval = Project(Seq(UnresolvedStar(None), jsonFunc), table)
val expectedPlan = Project(Seq(UnresolvedStar(None)), eval)
comparePlans(expectedPlan, logPlan, false)
}


test("test json_keys()") {
val context = new CatalystPlanContext
val logPlan =
Expand Down

0 comments on commit 09b7b5c

Please sign in to comment.