From 7323cc6efdf6c2af891f0869f35905f8a8667897 Mon Sep 17 00:00:00 2001 From: Andy Kwok Date: Thu, 19 Dec 2024 16:54:41 -0800 Subject: [PATCH] Update code style Signed-off-by: Andy Kwok --- .../ppl/FlintSparkPPLAppendColITSuite.scala | 8 +++++-- ...nAppendColCommandTranslatorTestSuite.scala | 24 +++++++++++++------ 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/integ-test/src/integration/scala/org/opensearch/flint/spark/ppl/FlintSparkPPLAppendColITSuite.scala b/integ-test/src/integration/scala/org/opensearch/flint/spark/ppl/FlintSparkPPLAppendColITSuite.scala index 4a77854bc..e1825c439 100644 --- a/integ-test/src/integration/scala/org/opensearch/flint/spark/ppl/FlintSparkPPLAppendColITSuite.scala +++ b/integ-test/src/integration/scala/org/opensearch/flint/spark/ppl/FlintSparkPPLAppendColITSuite.scala @@ -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() diff --git a/ppl-spark-integration/src/test/scala/org/opensearch/flint/spark/ppl/PPLLogicalPlanAppendColCommandTranslatorTestSuite.scala b/ppl-spark-integration/src/test/scala/org/opensearch/flint/spark/ppl/PPLLogicalPlanAppendColCommandTranslatorTestSuite.scala index 71e7e2756..1df436adc 100644 --- a/ppl-spark-integration/src/test/scala/org/opensearch/flint/spark/ppl/PPLLogicalPlanAppendColCommandTranslatorTestSuite.scala +++ b/ppl-spark-integration/src/test/scala/org/opensearch/flint/spark/ppl/PPLLogicalPlanAppendColCommandTranslatorTestSuite.scala @@ -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 /** @@ -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") } @@ -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)),