Skip to content

Commit

Permalink
Addresses PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
liancheng committed Feb 29, 2016
1 parent d8ca6d7 commit e707881
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,9 @@ class Analyzer(

resolveExpression(unbound, LocalRelation(attributes), throws = true) transform {
case n: NewInstance
// If this is an inner class of another class, register the outer object in `OuterScopes`.
// Note that static inner classes (e.g., inner classes within Scala objects) don't need
// outer pointer registration.
if n.outerPointer.isEmpty &&
n.cls.isMemberClass &&
!Modifier.isStatic(n.cls.getModifiers) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -622,8 +622,7 @@ class DatasetSuite extends QueryTest with SharedSQLContext {
Some(1), Some(2), Some(3))
}

test("SPARK-13540 add Scala object to OuterScopes") {
OuterScopes.addOuterScope(OuterObject)
test("SPARK-13540 Dataset of nested class defined in Scala object") {
checkAnswer(
Seq(OuterObject.InnerClass("foo")).toDS(),
OuterObject.InnerClass("foo"))
Expand Down

0 comments on commit e707881

Please sign in to comment.