Search in sources :

Example 1 with HiveStorageFormat

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;
}
Also used : HiveTableHandle(com.facebook.presto.hive.HiveTableHandle) HiveTableProperties.getHiveStorageFormat(com.facebook.presto.hive.HiveTableProperties.getHiveStorageFormat) HiveStorageFormat(com.facebook.presto.hive.HiveStorageFormat)

Aggregations

HiveStorageFormat (com.facebook.presto.hive.HiveStorageFormat)1 HiveTableHandle (com.facebook.presto.hive.HiveTableHandle)1 HiveTableProperties.getHiveStorageFormat (com.facebook.presto.hive.HiveTableProperties.getHiveStorageFormat)1