Skip to content

Commit

Permalink
TEIID-4720: changes in requiresLeftLinearJoin and useParensForJoins n…
Browse files Browse the repository at this point in the history
…eeded for Hive (making hive similar to impala)
  • Loading branch information
shawkins authored and johnathonlee committed Feb 24, 2017
1 parent 9f68d20 commit bda3dc0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
Expand Up @@ -235,6 +235,9 @@ <h4 class="western">from ${project.version}</h4>
<a href='https://issues.jboss.org/browse/TEIID-4668'>TEIID-4668</a> - Google translator skips NULL value in INSERT (fixing issues with null inserts/updates)
<li/>
<p style="margin-bottom: 0in">
<a href='https://issues.jboss.org/browse/TEIID-4720'>TEIID-4720</a> - changes in requiresLeftLinearJoin and useParensForJoins needed for Hive (making hive similar to impala)
<li/>
<p style="margin-bottom: 0in">
<a href='https://issues.jboss.org/browse/TEIID-4737'>TEIID-4737</a> - Incorrect work of left join statement (fixing merging of virtual layers under an outer join)
<li/>
<p style="margin-bottom: 0in">
Expand Down
Expand Up @@ -200,7 +200,11 @@ public org.teiid.translator.ExecutionFactory.SupportedJoinCriteria getSupportedJ

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

@Override
public boolean requiresLeftLinearJoin() {
return true;
}
}
Expand Up @@ -120,6 +120,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 bda3dc0

Please sign in to comment.