Skip to content

Commit

Permalink
Merge pull request apache#1 from marmbrus/pr/837
Browse files Browse the repository at this point in the history
Add a test.
  • Loading branch information
adrian-wang committed Jun 8, 2014
2 parents 4c726e5 + 6713c09 commit d39cd12
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Expand Up @@ -128,6 +128,7 @@ class SqlParser extends StandardTokenParsers with PackratParsers {
protected val OUTER = Keyword("OUTER")
protected val RIGHT = Keyword("RIGHT")
protected val SELECT = Keyword("SELECT")
protected val SEMI = Keyword("SEMI")
protected val STRING = Keyword("STRING")
protected val SUM = Keyword("SUM")
protected val TRUE = Keyword("TRUE")
Expand Down Expand Up @@ -238,6 +239,7 @@ class SqlParser extends StandardTokenParsers with PackratParsers {

protected lazy val joinType: Parser[JoinType] =
INNER ^^^ Inner |
LEFT ~ SEMI ^^^ LeftSemi |
LEFT ~ opt(OUTER) ^^^ LeftOuter |
RIGHT ~ opt(OUTER) ^^^ RightOuter |
FULL ~ opt(OUTER) ^^^ FullOuter
Expand Down
Expand Up @@ -44,7 +44,7 @@ class QueryTest extends FunSuite {
fail(
s"""
|Exception thrown while executing query:
|${rdd.logicalPlan}
|${rdd.queryExecution}
|== Exception ==
|$e
""".stripMargin)
Expand Down
Expand Up @@ -34,6 +34,13 @@ class SQLQuerySuite extends QueryTest {
arrayData.map(d => (d.data, d.data(0), d.data(0) + d.data(1), d.data(1))).collect().toSeq)
}

test("left semi greater than predicate") {
checkAnswer(
sql("SELECT * FROM testData2 x LEFT SEMI JOIN testData2 y ON x.a >= y.a + 2"),
Seq((3,1), (3,2))
)
}

test("index into array of arrays") {
checkAnswer(
sql(
Expand Down

0 comments on commit d39cd12

Please sign in to comment.