|
17 | 17 |
|
18 | 18 | package org.apache.spark.sql.catalyst.analysis |
19 | 19 |
|
| 20 | +import org.apache.spark.SparkContext |
20 | 21 | import org.apache.spark.sql.AnalysisException |
21 | 22 | import org.apache.spark.sql.catalyst.catalog.SimpleCatalogRelation |
22 | 23 | import org.apache.spark.sql.catalyst.expressions._ |
@@ -387,10 +388,13 @@ trait CheckAnalysis extends PredicateHelper { |
387 | 388 | // TODO: although map type is not orderable, technically map type should be able to be |
388 | 389 | // used in equality comparison, remove this type check once we support it. |
389 | 390 | case o if mapColumnInSetOperation(o).isDefined => |
390 | | - val mapCol = mapColumnInSetOperation(o).get |
391 | | - failAnalysis("Cannot have map type columns in DataFrame which calls " + |
392 | | - s"set operations(intersect, except, etc.), but the type of column ${mapCol.name} " + |
393 | | - "is " + mapCol.dataType.simpleString) |
| 391 | + val conf = SparkContext.getOrCreate().getConf |
| 392 | + if(!conf.getBoolean("spark.sql.allow.distinct.map", false)) { |
| 393 | + val mapCol = mapColumnInSetOperation(o).get |
| 394 | + failAnalysis("Cannot have map type columns in DataFrame which calls " + |
| 395 | + s"set operations(intersect, except, etc.), but the type of column ${mapCol.name} " + |
| 396 | + "is " + mapCol.dataType.simpleString) |
| 397 | + } |
394 | 398 |
|
395 | 399 | case s: SimpleCatalogRelation => |
396 | 400 | failAnalysis( |
|
0 commit comments