Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
CR
  • Loading branch information
rxin committed Feb 14, 2017
commit 0d429782b38cf19c0d4d6a5102102e39d872fee7
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ object SubstituteHints {
}

/**
* Removes all the hints. This must be executed after all the other hint rules are executed.
* Removes all the hints, used to remove invalid hints provided by the user.
* This must be executed after all the other hint rules are executed.
*/
object RemoveAllHints extends Rule[LogicalPlan] {
def apply(plan: LogicalPlan): LogicalPlan = plan transformUp {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ class AstBuilder extends SqlBaseBaseVisitor[AnyRef] with Logging {
val withWindow = withDistinct.optionalMap(windows)(withWindows)

// Hint
withWindow.optionalMap(ctx.hint)(withHints)
withWindow.optionalMap(hint)(withHints)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,8 @@ class SubstituteHintsSuite extends AnalysisTest {
}

test("should work for subqueries") {
val relation = UnresolvedRelation(TableIdentifier("table"), Some("tableAlias"))

checkAnalysis(
Hint("MAPJOIN", Seq("tableAlias"), relation),
Hint("MAPJOIN", Seq("tableAlias"), table("table").as("tableAlias")),
BroadcastHint(testRelation),
caseSensitive = false)

Expand All @@ -85,7 +83,7 @@ class SubstituteHintsSuite extends AnalysisTest {

// Negative case: if the alias doesn't match, don't match the original table name.
checkAnalysis(
Hint("MAPJOIN", Seq("table"), relation),
Hint("MAPJOIN", Seq("table"), table("table").as("tableAlias")),
testRelation,
caseSensitive = false)
}
Expand Down