Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ jobs:
uses: actions/checkout@v2
# Caches maven cache and uses hashes of pom.xml files to find the required cache
- name: Cache Maven Repository
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# Caches MySQL directory used for JDBC storage plugin tests
- name: Cache MySQL
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ~/.embedmysql
key: ${{ runner.os }}-mysql
Expand All @@ -65,15 +65,15 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Cache Maven Repository
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# Caches built protobuf library
- name: Cache protobufs
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ~/protobuf
key: ${{ runner.os }}-protobuf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.util.List;
import java.util.Map;

import org.apache.drill.common.PlanStringBuilder;
import org.apache.drill.common.exceptions.DrillRuntimeException;
import org.apache.drill.common.exceptions.ExecutionSetupException;
import org.apache.drill.common.expression.SchemaPath;
Expand All @@ -39,11 +40,13 @@
import org.apache.drill.exec.store.hive.HiveMetadataProvider.HiveStats;
import org.apache.drill.exec.store.hive.HiveMetadataProvider.LogicalInputSplit;
import org.apache.drill.exec.store.hive.HiveTableWrapper.HivePartitionWrapper;
import org.apache.drill.exec.store.hive.readers.filter.HiveFilter;
import org.apache.drill.exec.util.Utilities;
import org.apache.hadoop.hive.conf.HiveConf;
import org.apache.hadoop.hive.metastore.api.FieldSchema;
import org.apache.hadoop.hive.metastore.api.Partition;
import org.apache.hadoop.hive.metastore.api.Table;
import org.apache.hadoop.hive.ql.io.sarg.SearchArgument;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -54,6 +57,7 @@
import com.fasterxml.jackson.annotation.JsonTypeName;

import static org.apache.drill.exec.store.hive.HiveUtilities.createPartitionWithSpecColumns;
import static org.apache.hadoop.hive.ql.io.sarg.ConvertAstToSearchArg.SARG_PUSHDOWN;

@JsonTypeName("hive-scan")
public class HiveScan extends AbstractGroupScan {
Expand All @@ -70,7 +74,7 @@ public class HiveScan extends AbstractGroupScan {
private List<LogicalInputSplit> inputSplits;

protected List<SchemaPath> columns;

private boolean filterPushedDown = false;
@JsonCreator
public HiveScan(@JsonProperty("userName") final String userName,
@JsonProperty("hiveReadEntry") final HiveReadEntry hiveReadEntry,
Expand Down Expand Up @@ -154,6 +158,16 @@ public boolean supportsPartitionFilterPushdown() {
return !(partitionKeys == null || partitionKeys.size() == 0);
}

@JsonIgnore
public void setFilterPushedDown(boolean isPushedDown) {
this.filterPushedDown = isPushedDown;
}

@JsonIgnore
public boolean isFilterPushedDown() {
return filterPushedDown;
}

@Override
public void applyAssignments(final List<CoordinationProtos.DrillbitEndpoint> endpoints) {
mappings = new ArrayList<>();
Expand Down Expand Up @@ -265,13 +279,17 @@ public String getDigest() {
public String toString() {
List<HivePartitionWrapper> partitions = hiveReadEntry.getHivePartitionWrappers();
int numPartitions = partitions == null ? 0 : partitions.size();
return "HiveScan [table=" + hiveReadEntry.getHiveTableWrapper()
+ ", columns=" + columns
+ ", numPartitions=" + numPartitions
+ ", partitions= " + partitions
+ ", inputDirectories=" + metadataProvider.getInputDirectories(hiveReadEntry)
+ ", confProperties=" + confProperties
+ "]";
String SearchArgumentString = confProperties.get(SARG_PUSHDOWN);
SearchArgument searchArgument = SearchArgumentString == null ? null : HiveFilter.create(SearchArgumentString);

return new PlanStringBuilder(this)
.field("table", hiveReadEntry.getHiveTableWrapper())
.field("columns", columns)
.field("numPartitions", numPartitions)
.field("inputDirectories", metadataProvider.getInputDirectories(hiveReadEntry))
.field("confProperties", confProperties)
.field("SearchArgument", searchArgument)
.toString();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
import org.apache.drill.exec.store.SchemaConfig;
import org.apache.drill.exec.store.StoragePluginOptimizerRule;
import org.apache.drill.exec.store.dfs.FormatPlugin;
import org.apache.drill.exec.store.hive.readers.filter.HivePushFilterIntoScan;
import org.apache.drill.exec.store.hive.schema.HiveSchemaFactory;
import org.apache.drill.shaded.guava.com.google.common.collect.ImmutableSet;

Expand Down Expand Up @@ -220,6 +221,8 @@ public Set<StoragePluginOptimizerRule> getPhysicalOptimizerRules(OptimizerRulesC
"Please disable {} option", ExecConstants.HIVE_OPTIMIZE_MAPRDB_JSON_SCAN_WITH_NATIVE_READER);
}
}
ruleBuilder.add(HivePushFilterIntoScan.FILTER_ON_PROJECT);
ruleBuilder.add(HivePushFilterIntoScan.FILTER_ON_SCAN);
return ruleBuilder.build();
}

Expand Down
Loading
Loading