Skip to content

Commit

Permalink
Update integ for distinct tables
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 6b3aeec commit f2d54e5
Showing 1 changed file with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ class FlintSparkPPLAppendColITSuite
Seq("spark_catalog", "default", "flint_ppl_test"))

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

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

override def beforeAll(): Unit = {
super.beforeAll()
Expand Down Expand Up @@ -98,7 +98,7 @@ class FlintSparkPPLAppendColITSuite
: +- 'UnresolvedRelation [relation], [], false
*/
val t1 = SubqueryAlias(
"T1",
"APPENDCOL_T1",
Project(Seq(ROW_NUMBER_AGGREGATION, UnresolvedStar(None)), RELATION_TEST_TABLE))

/*
Expand All @@ -109,7 +109,7 @@ class FlintSparkPPLAppendColITSuite
+- 'UnresolvedRelation [relation], [], false
*/
val t2 = SubqueryAlias(
"T2",
"APPENDCOL_T2",
Project(
Seq(ROW_NUMBER_AGGREGATION, UnresolvedStar(None)),
Aggregate(AGE_ALIAS :: Nil, Seq(COUNT_STAR, AGE_ALIAS), RELATION_TEST_TABLE)))
Expand Down Expand Up @@ -155,7 +155,7 @@ class FlintSparkPPLAppendColITSuite
: +- 'UnresolvedRelation [relation], [], false
*/
val t1 = SubqueryAlias(
"T1",
"APPENDCOL_T1",
Project(
Seq(ROW_NUMBER_AGGREGATION, UnresolvedStar(None)),
Project(
Expand All @@ -173,7 +173,7 @@ class FlintSparkPPLAppendColITSuite
+- 'UnresolvedRelation [relation], [], false
*/
val t2 = SubqueryAlias(
"T2",
"APPENDCOL_T2",
Project(
Seq(ROW_NUMBER_AGGREGATION, UnresolvedStar(None)),
Aggregate(AGE_ALIAS :: Nil, Seq(COUNT_STAR, AGE_ALIAS), RELATION_TEST_TABLE)))
Expand Down Expand Up @@ -217,7 +217,7 @@ class FlintSparkPPLAppendColITSuite
: +- 'UnresolvedRelation [relation], [], false
*/
val t1 = SubqueryAlias(
"T1",
"APPENDCOL_T1",
Project(
Seq(ROW_NUMBER_AGGREGATION, UnresolvedStar(None)),
Project(
Expand All @@ -236,7 +236,7 @@ class FlintSparkPPLAppendColITSuite
+- 'UnresolvedRelation [flint_ppl_test], [], false
*/
val t2 = SubqueryAlias(
"T2",
"APPENDCOL_T2",
Project(
Seq(ROW_NUMBER_AGGREGATION, UnresolvedStar(None)),
DataFrameDropColumns(
Expand Down Expand Up @@ -284,7 +284,7 @@ class FlintSparkPPLAppendColITSuite
: +- 'UnresolvedRelation [flint_ppl_test], [], false
*/
val mainSearch = SubqueryAlias(
"T1",
"APPENDCOL_T1",
Project(
Seq(ROW_NUMBER_AGGREGATION, UnresolvedStar(None)),
Project(
Expand All @@ -300,7 +300,7 @@ class FlintSparkPPLAppendColITSuite
+- 'UnresolvedRelation [flint_ppl_test], [], false
*/
val firstAppenCol = SubqueryAlias(
"T2",
"APPENDCOL_T2",
Project(
Seq(ROW_NUMBER_AGGREGATION, UnresolvedStar(None)),
DataFrameDropColumns(
Expand All @@ -310,7 +310,7 @@ class FlintSparkPPLAppendColITSuite
Aggregate(AGE_ALIAS :: Nil, Seq(COUNT_STAR, AGE_ALIAS), RELATION_TEST_TABLE)))))

val joinWithFirstAppendCol = SubqueryAlias(
"T1",
"APPENDCOL_T1",
Project(
Seq(ROW_NUMBER_AGGREGATION, UnresolvedStar(None)),
DataFrameDropColumns(
Expand All @@ -324,7 +324,7 @@ class FlintSparkPPLAppendColITSuite
+- 'UnresolvedRelation [flint_ppl_test], [], false
*/
val secondAppendCol = SubqueryAlias(
"T2",
"APPENDCOL_T2",
Project(
Seq(ROW_NUMBER_AGGREGATION, UnresolvedStar(None)),
Project(Seq(UnresolvedAttribute("state")), RELATION_TEST_TABLE)))
Expand Down Expand Up @@ -372,7 +372,7 @@ class FlintSparkPPLAppendColITSuite
: +- 'UnresolvedRelation [relation], [], false
*/
val t1 = SubqueryAlias(
"T1",
"APPENDCOL_T1",
Project(
Seq(ROW_NUMBER_AGGREGATION, UnresolvedStar(None)),
Project(
Expand All @@ -390,7 +390,7 @@ class FlintSparkPPLAppendColITSuite
+- 'UnresolvedRelation [flint_ppl_test], [], false
*/
val t2 = SubqueryAlias(
"T2",
"APPENDCOL_T2",
Project(
Seq(ROW_NUMBER_AGGREGATION, UnresolvedStar(None)),
Aggregate(
Expand All @@ -404,7 +404,7 @@ class FlintSparkPPLAppendColITSuite
val expectedPlan = Project(
Seq(UnresolvedStar(None)),
DataFrameDropColumns(
T12_COLUMNS_SEQ :+ UnresolvedAttribute("T1.age"),
T12_COLUMNS_SEQ :+ UnresolvedAttribute("APPENDCOL_T1.age"),
Join(t1, t2, LeftOuter, Some(T12_JOIN_CONDITION), JoinHint.NONE)))
comparePlans(logicalPlan, expectedPlan, checkAnalysis = false)
}
Expand Down

0 comments on commit f2d54e5

Please sign in to comment.