Skip to content

Commit

Permalink
Add configuration property for max characters on alias column
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikzalewski committed Aug 29, 2023
1 parent e36d9f5 commit 8fce268
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public class JdbcMetadataConfig
// between performance and pushdown capabilities
private int domainCompactionThreshold = 32;

private int columnAliasMaxChars = 30;

public boolean isComplexExpressionPushdownEnabled()
{
return complexExpressionPushdownEnabled;
Expand Down Expand Up @@ -100,6 +102,11 @@ public int getDomainCompactionThreshold()
return domainCompactionThreshold;
}

public int getColumnAliasMaxChars()
{
return this.columnAliasMaxChars;
}

@Config("domain-compaction-threshold")
@ConfigDescription("Maximum ranges to allow in a tuple domain without compacting it")
public JdbcMetadataConfig setDomainCompactionThreshold(int domainCompactionThreshold)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public class JdbcMetadataSessionProperties
public static final String AGGREGATION_PUSHDOWN_ENABLED = "aggregation_pushdown_enabled";
public static final String TOPN_PUSHDOWN_ENABLED = "topn_pushdown_enabled";
public static final String DOMAIN_COMPACTION_THRESHOLD = "domain_compaction_threshold";
public static final String COLUMN_ALIAS_MAX_CHARS = "column_alias_max_chars";

private final List<PropertyMetadata<?>> properties;

Expand Down Expand Up @@ -70,6 +71,11 @@ public JdbcMetadataSessionProperties(JdbcMetadataConfig jdbcMetadataConfig, @Max
"Enable TopN pushdown",
jdbcMetadataConfig.isTopNPushdownEnabled(),
false))
.add(integerProperty(
COLUMN_ALIAS_MAX_CHARS,
"Maximum number of characters allowed in a column alias",
jdbcMetadataConfig.getColumnAliasMaxChars(),
false))
.build();
}

Expand Down

0 comments on commit 8fce268

Please sign in to comment.