amansinha100 commented on a change in pull request #1334: DRILL-6385: Support
JPPD feature
URL: https://github.com/apache/drill/pull/1334#discussion_r199337353
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinBatch.java
##########
@@ -491,6 +508,50 @@ private void setupHashTable() throws
SchemaChangeException {
// Create the chained hash table
baseHashTable =
new ChainedHashTable(htConfig, context, allocator, buildBatch,
probeBatch, null);
+ if (enableRuntimeFilter) {
+ setupHash64(htConfig);
+ }
+ }
+
+ private void setupHash64(HashTableConfig htConfig) throws
SchemaChangeException {
+ LogicalExpression[] keyExprsBuild = new
LogicalExpression[htConfig.getKeyExprsBuild().size()];
+ ErrorCollector collector = new ErrorCollectorImpl();
+ int i = 0;
+ for (NamedExpression ne : htConfig.getKeyExprsBuild()) {
+ final LogicalExpression expr =
ExpressionTreeMaterializer.materialize(ne.getExpr(), buildBatch, collector,
context.getFunctionRegistry());
+ if (collector.hasErrors()) {
+ throw new SchemaChangeException("Failure while materializing
expression. " + collector.toErrorString());
+ }
+ if (expr == null) {
+ continue;
+ }
+ keyExprsBuild[i] = expr;
+ i++;
+ }
+ i = 0;
+ boolean meetNotExistField = false;
+ TypedFieldId[] buildSideTypeFieldIds = new
TypedFieldId[keyExprsBuild.length];
+ for (NamedExpression ne : htConfig.getKeyExprsBuild()) {
+ SchemaPath schemaPath = (SchemaPath) ne.getExpr();
+ TypedFieldId typedFieldId = buildBatch.getValueVectorId(schemaPath);
+ if (typedFieldId == null) {
+ meetNotExistField = true;
+ continue;
Review comment:
why not break from the loop if you encountered this condition since you are
going to disable runtime filter and return if even 1 field was missing.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services