File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis
core/src/test/scala/org/apache/spark/sql Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -562,6 +562,9 @@ class Analyzer(
562562
563563 resolveExpression(unbound, LocalRelation (attributes), throws = true ) transform {
564564 case n : NewInstance
565+ // If this is an inner class of another class, register the outer object in `OuterScopes`.
566+ // Note that static inner classes (e.g., inner classes within Scala objects) don't need
567+ // outer pointer registration.
565568 if n.outerPointer.isEmpty &&
566569 n.cls.isMemberClass &&
567570 ! Modifier .isStatic(n.cls.getModifiers) =>
Original file line number Diff line number Diff line change @@ -622,8 +622,7 @@ class DatasetSuite extends QueryTest with SharedSQLContext {
622622 Some (1 ), Some (2 ), Some (3 ))
623623 }
624624
625- test(" SPARK-13540 add Scala object to OuterScopes" ) {
626- OuterScopes .addOuterScope(OuterObject )
625+ test(" SPARK-13540 Dataset of nested class defined in Scala object" ) {
627626 checkAnswer(
628627 Seq (OuterObject .InnerClass (" foo" )).toDS(),
629628 OuterObject .InnerClass (" foo" ))
You can’t perform that action at this time.
0 commit comments