Skip to content

Commit

Permalink
TEIID-4720 making hive similar to impala
Browse files Browse the repository at this point in the history
  • Loading branch information
shawkins committed Jan 24, 2017
1 parent 4dbda4e commit 8a239f7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,16 @@ public org.teiid.translator.ExecutionFactory.SupportedJoinCriteria getSupportedJ

@Override
public boolean useParensForJoins() {
return true;
return false;
}

@Override
public String translateLiteralDate(java.sql.Date dateValue) {
return "DATE '" + formatDateValue(dateValue) + '\'';
}

@Override
public boolean requiresLeftLinearJoin() {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,20 @@ public void testEqualityJoinCriteria() throws Exception {
helpTestVisitor(bqt, input, output);
}

@Test
public void testFourWayJoin() throws Exception {
String input = "SELECT A.intkey FROM BQT1.SMALLA A JOIN BQT1.SmallB B on A.intkey=B.intkey JOIN BQT1.SMALLA C on A.intkey=C.intkey JOIN BQT1.SMALLB D on A.intkey=D.intkey";
String output = "SELECT A.IntKey FROM SmallA A JOIN SmallB B ON A.IntKey = B.IntKey JOIN SmallA C ON A.IntKey = C.IntKey JOIN SmallB D ON A.IntKey = D.IntKey";
helpTestVisitor(bqt, input, output);
}

@Test
public void testThreeWayJoin() throws Exception {
String input = "SELECT A.intkey FROM BQT1.SMALLA A JOIN BQT1.SmallB B on A.intkey=B.intkey JOIN BQT1.SMALLA C on A.intkey=C.intkey";
String output = "SELECT A.IntKey FROM SmallA A JOIN SmallB B ON A.IntKey = B.IntKey JOIN SmallA C ON A.IntKey = C.IntKey";
helpTestVisitor(bqt, input, output);
}

@Test
public void testCrossJoinCriteria() throws Exception {
String input = "SELECT A.intkey FROM BQT1.SMALLA A Cross join BQT1.SmallB B";
Expand Down

0 comments on commit 8a239f7

Please sign in to comment.