aboutsummaryrefslogtreecommitdiff
path: root/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinProbeTemplate.java
diff options
context:
space:
mode:
authorAditya Kishore <aditya@maprtech.com>2014-09-11 10:43:08 -0700
committerAditya Kishore <aditya@maprtech.com>2014-09-11 19:25:28 -0700
commit676f5df6b14b10ccc3603360e0efee9c745c5b97 (patch)
tree592b02f84e8a6da2ace67f8e6c0e46d4237af20b /exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinProbeTemplate.java
parent7ae257c42b2eb4e1db778dca9ba64e2516078b38 (diff)
DRILL-1402: Add check-style rules for trailing space, TABs and blocks without braces
Diffstat (limited to 'exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinProbeTemplate.java')
-rw-r--r--exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinProbeTemplate.java29
1 files changed, 16 insertions, 13 deletions
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinProbeTemplate.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinProbeTemplate.java
index 785deae79..133289e08 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinProbeTemplate.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinProbeTemplate.java
@@ -94,11 +94,13 @@ public abstract class HashJoinProbeTemplate implements HashJoinProbe {
boolean success = true;
while (outputRecords < TARGET_RECORDS_PER_BATCH && recordsProcessed < recordsToProcess) {
success = projectBuildRecord(unmatchedBuildIndexes.get(recordsProcessed), outputRecords);
- if(success){
+ if (success) {
recordsProcessed++;
outputRecords++;
- }else{
- if(outputRecords == 0) throw new IllegalStateException("Too big to fail.");
+ } else {
+ if (outputRecords == 0) {
+ throw new IllegalStateException("Too big to fail.");
+ }
break;
}
}
@@ -166,11 +168,11 @@ public abstract class HashJoinProbeTemplate implements HashJoinProbe {
boolean success = projectBuildRecord(currentCompositeIdx, outputRecords) //
&& projectProbeRecord(recordsProcessed, outputRecords);
- if(!success){
+ if (!success) {
// we failed to project. redo this record.
getNextRecord = false;
return;
- }else{
+ } else {
outputRecords++;
/* Projected single row from the build side with matching key but there
@@ -182,8 +184,7 @@ public abstract class HashJoinProbeTemplate implements HashJoinProbe {
* from the probe side. Drain the next row in the probe side.
*/
recordsProcessed++;
- }
- else {
+ } else {
/* There is more than one row with the same key on the build side
* don't drain more records from the probe side till we have projected
* all the rows with this key
@@ -197,10 +198,10 @@ public abstract class HashJoinProbeTemplate implements HashJoinProbe {
// If we have a left outer join, project the keys
if (joinType == JoinRelType.LEFT || joinType == JoinRelType.FULL) {
boolean success = projectProbeRecord(recordsProcessed, outputRecords);
- if(!success){
- if(outputRecords == 0){
+ if (!success) {
+ if (outputRecords == 0) {
throw new IllegalStateException("Record larger than single batch.");
- }else{
+ } else {
// we've output some records but failed to output this one. return and wait for next call.
return;
}
@@ -214,10 +215,10 @@ public abstract class HashJoinProbeTemplate implements HashJoinProbe {
hjHelper.setRecordMatched(currentCompositeIdx);
boolean success = projectBuildRecord(currentCompositeIdx, outputRecords) //
&& projectProbeRecord(recordsProcessed, outputRecords);
- if(!success){
- if(outputRecords == 0){
+ if (!success) {
+ if (outputRecords == 0) {
throw new IllegalStateException("Record larger than single batch.");
- }else{
+ } else {
// we've output some records but failed to output this one. return and wait for next call.
return;
}
@@ -264,5 +265,7 @@ public abstract class HashJoinProbeTemplate implements HashJoinProbe {
public abstract void doSetup(@Named("context") FragmentContext context, @Named("buildBatch") VectorContainer buildBatch, @Named("probeBatch") RecordBatch probeBatch,
@Named("outgoing") RecordBatch outgoing);
public abstract boolean projectBuildRecord(@Named("buildIndex") int buildIndex, @Named("outIndex") int outIndex);
+
public abstract boolean projectProbeRecord(@Named("probeIndex") int probeIndex, @Named("outIndex") int outIndex);
+
}