Skip to content

Commit

Permalink
Fix registering "SELECT *" queries as tables and caching them. As som…
Browse files Browse the repository at this point in the history
…e tests for this and self-joins.
  • Loading branch information
marmbrus committed Apr 4, 2014
1 parent 3997dc9 commit 11062ac
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ case class LowerCaseSchema(child: LogicalPlan) extends UnaryNode {
a.nullable)(
a.exprId,
a.qualifiers)
case other => other
}

def references = Set.empty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,17 @@ class CachedTableSuite extends QueryTest {
TestSQLContext.uncacheTable("testData")
}
}

test("SELECT Star Cached Table") {
TestSQLContext.sql("SELECT * FROM testData").registerAsTable("selectStar")
TestSQLContext.cacheTable("selectStar")
TestSQLContext.sql("SELECT * FROM selectStar")
TestSQLContext.uncacheTable("selectStar")
}

test("Self-join cached") {
TestSQLContext.cacheTable("testData")
TestSQLContext.sql("SELECT * FROM testData a JOIN testData b ON a.key = b.key")
TestSQLContext.uncacheTable("testData")
}
}

0 comments on commit 11062ac

Please sign in to comment.