Skip to content

Commit

Permalink
Update code style
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Kwok <[email protected]>
  • Loading branch information
andy-k-improving committed Dec 20, 2024
1 parent 03b2ba8 commit 7323cc6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,14 @@ class FlintSparkPPLAppendColITSuite
Seq("spark_catalog", "default", "flint_ppl_test"))

private val T12_JOIN_CONDITION =
EqualTo(UnresolvedAttribute("APPENDCOL_T1._row_number_"), UnresolvedAttribute("APPENDCOL_T2._row_number_"))
EqualTo(
UnresolvedAttribute("APPENDCOL_T1._row_number_"),
UnresolvedAttribute("APPENDCOL_T2._row_number_"))

private val T12_COLUMNS_SEQ =
Seq(UnresolvedAttribute("APPENDCOL_T1._row_number_"), UnresolvedAttribute("APPENDCOL_T2._row_number_"))
Seq(
UnresolvedAttribute("APPENDCOL_T1._row_number_"),
UnresolvedAttribute("APPENDCOL_T2._row_number_"))

override def beforeAll(): Unit = {
super.beforeAll()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,14 @@ class PPLLogicalPlanAppendColCommandTranslatorTestSuite
private val RELATION_EMPLOYEES = UnresolvedRelation(Seq("employees"))

private val T12_JOIN_CONDITION =
EqualTo(UnresolvedAttribute("APPENDCOL_T1._row_number_"), UnresolvedAttribute("APPENDCOL_T2._row_number_"))
EqualTo(
UnresolvedAttribute("APPENDCOL_T1._row_number_"),
UnresolvedAttribute("APPENDCOL_T2._row_number_"))

private val T12_COLUMNS_SEQ =
Seq(UnresolvedAttribute("APPENDCOL_T1._row_number_"), UnresolvedAttribute("APPENDCOL_T2._row_number_"))
Seq(
UnresolvedAttribute("APPENDCOL_T1._row_number_"),
UnresolvedAttribute("APPENDCOL_T2._row_number_"))

// @formatter:off
/**
Expand Down Expand Up @@ -333,12 +337,15 @@ class PPLLogicalPlanAppendColCommandTranslatorTestSuite
comparePlans(logicalPlan, expectedPlan, checkAnalysis = false)
}


test("test invalid override sub-search") {
val context = new CatalystPlanContext
val exception = intercept[IllegalStateException](
planTransformer
.visit(plan(pplParser, "source=relation | FIELDS name, age | APPENDCOL override=true [ where age > 10]"), context))
.visit(
plan(
pplParser,
"source=relation | FIELDS name, age | APPENDCOL override=true [ where age > 10]"),
context))
assert(exception.getMessage startsWith "Not Supported operation")
}

Expand Down Expand Up @@ -383,10 +390,13 @@ class PPLLogicalPlanAppendColCommandTranslatorTestSuite
"APPENDCOL_T2",
Project(
Seq(ROW_NUMBER_AGGREGATION, UnresolvedStar(None)),
Aggregate(Nil, Seq(
Aggregate(
Nil,
Seq(
Alias(
UnresolvedFunction(Seq("COUNT"), Seq(UnresolvedStar(None)), isDistinct = false), "age")()),
RELATION_EMPLOYEES)))
UnresolvedFunction(Seq("COUNT"), Seq(UnresolvedStar(None)), isDistinct = false),
"age")()),
RELATION_EMPLOYEES)))

val expectedPlan = Project(
Seq(UnresolvedStar(None)),
Expand Down

0 comments on commit 7323cc6

Please sign in to comment.