use of com.facebook.presto.hive.HiveStorageFormat in project presto by prestodb.
the class HiveFilterPushdown method isPushdownFilterSupported.
private boolean isPushdownFilterSupported(ConnectorSession session, TableHandle tableHandle) {
checkArgument(tableHandle.getConnectorHandle() instanceof HiveTableHandle, "pushdownFilter is never supported on a non-hive TableHandle");
if (((HiveTableHandle) tableHandle.getConnectorHandle()).getAnalyzePartitionValues().isPresent()) {
return false;
}
boolean pushdownFilterEnabled = HiveSessionProperties.isPushdownFilterEnabled(session);
if (pushdownFilterEnabled) {
HiveStorageFormat hiveStorageFormat = getHiveStorageFormat(getMetadata(tableHandle).getTableMetadata(session, tableHandle.getConnectorHandle()).getProperties());
if (hiveStorageFormat == HiveStorageFormat.ORC || hiveStorageFormat == HiveStorageFormat.DWRF || hiveStorageFormat == HiveStorageFormat.PARQUET && isParquetPushdownFilterEnabled(session)) {
return true;
}
}
return false;
}
Aggregations