Skip to content

Commit

Permalink
Introduce parquet_pushdown_filter_enabled session property
Browse files Browse the repository at this point in the history
This commit introduces parquet_pushdown_filter_enabled session property
and parquet.pushdown-filter-enabled for the hive connector.
  • Loading branch information
yingsu00 committed Jan 12, 2022
1 parent 352b461 commit 4a5a445
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ public class HiveClientConfig
private boolean usePageFileForHiveUnsupportedType = true;

private boolean pushdownFilterEnabled;
private boolean parquetPushdownFilterEnabled;
private boolean rangeFiltersOnSubscriptsEnabled;
private boolean adaptiveFilterReorderingEnabled = true;
private boolean zstdJniDecompressionEnabled;
Expand Down Expand Up @@ -1468,6 +1469,20 @@ public HiveClientConfig setPushdownFilterEnabled(boolean pushdownFilterEnabled)
return this;
}

@NotNull
public boolean isParquetPushdownFilterEnabled()
{
return parquetPushdownFilterEnabled;
}

@Config("hive.parquet.pushdown-filter-enabled")
@ConfigDescription("Experimental: enable complex filter pushdown for Aria Parquet")
public HiveClientConfig setParquetPushdownFilterEnabled(boolean parquetPushdownFilterEnabled)
{
this.parquetPushdownFilterEnabled = parquetPushdownFilterEnabled;
return this;
}

public boolean isRangeFiltersOnSubscriptsEnabled()
{
return rangeFiltersOnSubscriptsEnabled;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ public final class HiveSessionProperties
private static final String TEMPORARY_TABLE_CREATE_EMPTY_BUCKET_FILES = "temporary_table_create_empty_bucket_files";
private static final String USE_PAGEFILE_FOR_HIVE_UNSUPPORTED_TYPE = "use_pagefile_for_hive_unsupported_type";
public static final String PUSHDOWN_FILTER_ENABLED = "pushdown_filter_enabled";
public static final String PARQUET_PUSHDOWN_FILTER_ENABLED = "parquet_pushdown_filter_enabled";
public static final String RANGE_FILTERS_ON_SUBSCRIPTS_ENABLED = "range_filters_on_subscripts_enabled";
public static final String ADAPTIVE_FILTER_REORDERING_ENABLED = "adaptive_filter_reordering_enabled";
public static final String VIRTUAL_BUCKET_COUNT = "virtual_bucket_count";
Expand Down Expand Up @@ -464,6 +465,11 @@ public HiveSessionProperties(HiveClientConfig hiveClientConfig, OrcFileWriterCon
"Experimental: enable complex filter pushdown",
hiveClientConfig.isPushdownFilterEnabled(),
false),
booleanProperty(
PARQUET_PUSHDOWN_FILTER_ENABLED,
"Experimental: enable complex filter pushdown for Parquet",
hiveClientConfig.isParquetPushdownFilterEnabled(),
false),
booleanProperty(
RANGE_FILTERS_ON_SUBSCRIPTS_ENABLED,
"Experimental: enable pushdown of range filters on subscripts (a[2] = 5) into ORC column readers",
Expand Down Expand Up @@ -951,6 +957,11 @@ public static boolean isPushdownFilterEnabled(ConnectorSession session)
return session.getProperty(PUSHDOWN_FILTER_ENABLED, Boolean.class);
}

public static boolean isParquetPushdownFilterEnabled(ConnectorSession session)
{
return session.getProperty(PARQUET_PUSHDOWN_FILTER_ENABLED, Boolean.class);
}

public static boolean isRangeFiltersOnSubscriptsEnabled(ConnectorSession session)
{
return session.getProperty(RANGE_FILTERS_ON_SUBSCRIPTS_ENABLED, Boolean.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ public void testDefaults()
.setCreateEmptyBucketFilesForTemporaryTable(false)
.setUsePageFileForHiveUnsupportedType(true)
.setPushdownFilterEnabled(false)
.setParquetPushdownFilterEnabled(false)
.setZstdJniDecompressionEnabled(false)
.setRangeFiltersOnSubscriptsEnabled(false)
.setAdaptiveFilterReorderingEnabled(true)
Expand Down Expand Up @@ -254,6 +255,7 @@ public void testExplicitPropertyMappings()
.put("hive.create-empty-bucket-files-for-temporary-table", "true")
.put("hive.use-pagefile-for-hive-unsupported-type", "false")
.put("hive.pushdown-filter-enabled", "true")
.put("hive.parquet.pushdown-filter-enabled", "true")
.put("hive.range-filters-on-subscripts-enabled", "true")
.put("hive.adaptive-filter-reordering-enabled", "false")
.put("hive.zstd-jni-decompression-enabled", "true")
Expand Down Expand Up @@ -372,6 +374,7 @@ public void testExplicitPropertyMappings()
.setCreateEmptyBucketFilesForTemporaryTable(true)
.setUsePageFileForHiveUnsupportedType(false)
.setPushdownFilterEnabled(true)
.setParquetPushdownFilterEnabled(true)
.setZstdJniDecompressionEnabled(true)
.setRangeFiltersOnSubscriptsEnabled(true)
.setAdaptiveFilterReorderingEnabled(false)
Expand Down

0 comments on commit 4a5a445

Please sign in to comment.