File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/v2 Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -23,14 +23,21 @@ import org.apache.spark.sql.connector.read.SupportsPushDownJoin.ColumnWithAlias
2323class V2ScanRelationPushDownSuite extends SparkFunSuite {
2424
2525 private def assertAliases (
26- leftInput : Array [String ],
27- rightInput : Array [String ],
28- expectedLeft : Array [ColumnWithAlias ],
29- expectedRight : Array [ColumnWithAlias ]
30- ): Unit = {
26+ leftInput : Array [String ],
27+ rightInput : Array [String ],
28+ expectedLeft : Array [ColumnWithAlias ],
29+ expectedRight : Array [ColumnWithAlias ]
30+ ): Unit = {
3131 val (actualLeft, actualRight) = V2ScanRelationPushDown
3232 .generateColumnAliasesForDuplicatedName(leftInput, rightInput)
3333
34+ val uniqName : ColumnWithAlias => String = col => {
35+ if (col.alias() == null ) col.colName() else col.alias().toLowerCase()
36+ }
37+ // Ensure no duplicate column names after ignoring capitalization
38+ assert((actualLeft++ actualRight).map(uniqName).distinct.length
39+ == actualLeft.length + actualRight.length)
40+
3441 assert(
3542 actualLeft === expectedLeft,
3643 s """ Left side aliases mismatch.
You can’t perform that action at this time.
0 commit comments