Skip to content

Commit

Permalink
add complex case
Browse files Browse the repository at this point in the history
Signed-off-by: Lantao Jin <[email protected]>
  • Loading branch information
LantaoJin committed Nov 15, 2024
1 parent e1d5c67 commit 351cd55
Showing 1 changed file with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,43 @@ class PPLLogicalPlanBasicQueriesTranslatorTestSuite
comparePlans(expectedPlan, logPlan, false)
}

test("test describe with complex backticks and more then 3 parts") {
val context = new CatalystPlanContext
val logPlan =
planTransformer.visit(
plan(
pplParser,
"describe `_Basic`.default.`startTime:0,endTime:1`.`logGroups(logGroupIdentifier:['hello/service_log'])`"),
context)

val expectedPlan = DescribeTableCommand(
TableIdentifier(
"startTime:0,endTime:1.logGroups(logGroupIdentifier:['hello/service_log'])",
Option("default"),
Option("_Basic")),
Map.empty[String, String].empty,
isExtended = true,
output = DescribeRelation.getOutputAttrs)
comparePlans(expectedPlan, logPlan, false)
}

test("test read complex table with backticks and more then 3 parts") {
val context = new CatalystPlanContext
val logPlan =
planTransformer.visit(
plan(
pplParser,
"source=`_Basic`.default.`startTime:0,endTime:1`.`logGroups(logGroupIdentifier:['hello/service_log'])`"),
context)
val table = UnresolvedRelation(
Seq(
"_Basic",
"default",
"startTime:0,endTime:1.logGroups(logGroupIdentifier:['hello/service_log'])"))
val expectedPlan = Project(Seq(UnresolvedStar(None)), table)
comparePlans(expectedPlan, logPlan, false)
}

test("test describe FQN table clause") {
val context = new CatalystPlanContext
val logPlan =
Expand Down

0 comments on commit 351cd55

Please sign in to comment.