Skip to content

Commit

Permalink
Simplify TestingConnectorBehavior declarations
Browse files Browse the repository at this point in the history
Use `true` or a related behavior as the default rather than `false`. Few
cases being off by default remain, but generally true as the default is
much easier to reason about. False defaults were usually a result of
incremental additions, where it's easier to add a behavior that is not
widely adopted, but are harder to think about in a long run.
  • Loading branch information
findepi committed Mar 31, 2023
1 parent 649ade0 commit d27c8d9
Showing 1 changed file with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,12 @@ public enum TestingConnectorBehavior
SUPPORTS_TOPN_PUSHDOWN_WITH_VARCHAR(fallback -> fallback.test(SUPPORTS_TOPN_PUSHDOWN) && fallback.test(SUPPORTS_PREDICATE_PUSHDOWN_WITH_VARCHAR_INEQUALITY)),

SUPPORTS_AGGREGATION_PUSHDOWN,
// Most connectors don't support aggregation pushdown for statistical functions
SUPPORTS_AGGREGATION_PUSHDOWN_STDDEV(false),
SUPPORTS_AGGREGATION_PUSHDOWN_VARIANCE(false),
SUPPORTS_AGGREGATION_PUSHDOWN_COVARIANCE(false),
SUPPORTS_AGGREGATION_PUSHDOWN_CORRELATION(false),
SUPPORTS_AGGREGATION_PUSHDOWN_REGRESSION(false),
SUPPORTS_AGGREGATION_PUSHDOWN_COUNT_DISTINCT(false),
SUPPORTS_AGGREGATION_PUSHDOWN_STDDEV(SUPPORTS_AGGREGATION_PUSHDOWN),
SUPPORTS_AGGREGATION_PUSHDOWN_VARIANCE(SUPPORTS_AGGREGATION_PUSHDOWN),
SUPPORTS_AGGREGATION_PUSHDOWN_COVARIANCE(SUPPORTS_AGGREGATION_PUSHDOWN),
SUPPORTS_AGGREGATION_PUSHDOWN_CORRELATION(SUPPORTS_AGGREGATION_PUSHDOWN),
SUPPORTS_AGGREGATION_PUSHDOWN_REGRESSION(SUPPORTS_AGGREGATION_PUSHDOWN),
SUPPORTS_AGGREGATION_PUSHDOWN_COUNT_DISTINCT(SUPPORTS_AGGREGATION_PUSHDOWN),

SUPPORTS_JOIN_PUSHDOWN(
// Currently no connector supports Join pushdown by default. JDBC connectors may support Join pushdown and BaseJdbcConnectorTest
Expand Down Expand Up @@ -73,13 +72,13 @@ public enum TestingConnectorBehavior
SUPPORTS_SET_COLUMN_TYPE,

SUPPORTS_COMMENT_ON_TABLE,
SUPPORTS_COMMENT_ON_VIEW(false),
SUPPORTS_COMMENT_ON_COLUMN,
SUPPORTS_COMMENT_ON_VIEW_COLUMN(false),
SUPPORTS_COMMENT_ON_COLUMN(SUPPORTS_COMMENT_ON_TABLE),
SUPPORTS_COMMENT_ON_VIEW(SUPPORTS_COMMENT_ON_TABLE),
SUPPORTS_COMMENT_ON_VIEW_COLUMN(SUPPORTS_COMMENT_ON_VIEW),

SUPPORTS_CREATE_VIEW(false),
SUPPORTS_CREATE_VIEW,

SUPPORTS_CREATE_MATERIALIZED_VIEW(false),
SUPPORTS_CREATE_MATERIALIZED_VIEW,
SUPPORTS_CREATE_MATERIALIZED_VIEW_GRACE_PERIOD(SUPPORTS_CREATE_MATERIALIZED_VIEW),
SUPPORTS_CREATE_FEDERATED_MATERIALIZED_VIEW(SUPPORTS_CREATE_MATERIALIZED_VIEW), // i.e. an MV that spans catalogs
SUPPORTS_RENAME_MATERIALIZED_VIEW(SUPPORTS_CREATE_MATERIALIZED_VIEW),
Expand All @@ -88,14 +87,15 @@ public enum TestingConnectorBehavior
SUPPORTS_INSERT,
SUPPORTS_NOT_NULL_CONSTRAINT(SUPPORTS_CREATE_TABLE),

SUPPORTS_DELETE(false),
SUPPORTS_MERGE,

SUPPORTS_DELETE(SUPPORTS_MERGE),
SUPPORTS_ROW_LEVEL_DELETE(SUPPORTS_DELETE),

SUPPORTS_UPDATE(false),
SUPPORTS_UPDATE(SUPPORTS_MERGE),

SUPPORTS_MERGE(false),

SUPPORTS_TRUNCATE(false),
SUPPORTS_TRUNCATE(SUPPORTS_DELETE),

SUPPORTS_NEGATIVE_DATE,

Expand Down

0 comments on commit d27c8d9

Please sign in to comment.