diff --git a/changelog.md b/changelog.md index 1a4eb1f5a..4a32a43e0 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,8 @@ ### Added +- Make aggregation functions available through implicit casts. + ([#381](https://github.com/hasura/ndc-postgres/pull/380)) - Support for introspecting domain types. ([#380](https://github.com/hasura/ndc-postgres/pull/380)) diff --git a/crates/configuration/src/version3/mod.rs b/crates/configuration/src/version3/mod.rs index 8c661b1cb..d901866a9 100644 --- a/crates/configuration/src/version3/mod.rs +++ b/crates/configuration/src/version3/mod.rs @@ -151,7 +151,11 @@ pub async fn introspect( .instrument(info_span!("Decode introspection result")) .await?; - let scalar_types = occurring_scalar_types(&tables, &args.metadata.native_queries); + let scalar_types = occurring_scalar_types( + &tables, + &args.metadata.native_queries, + &args.metadata.aggregate_functions, + ); let relevant_comparison_operators = filter_comparison_operators(&scalar_types, comparison_operators); @@ -178,6 +182,7 @@ pub async fn introspect( pub fn occurring_scalar_types( tables: &metadata::TablesInfo, native_queries: &metadata::NativeQueries, + aggregate_functions: &metadata::AggregateFunctions, ) -> BTreeSet { let tables_column_types = tables .0 @@ -191,6 +196,10 @@ pub fn occurring_scalar_types( .0 .values() .flat_map(|v| v.arguments.values().map(|c| &c.r#type)); + let aggregate_functions_result_types = aggregate_functions + .0 + .values() + .flat_map(|x| x.values().map(|agg_fn| agg_fn.return_type.clone())); tables_column_types .chain(native_queries_column_types) @@ -199,6 +208,7 @@ pub fn occurring_scalar_types( metadata::Type::ScalarType(ref t) => Some(t.clone()), // only keep scalar types metadata::Type::ArrayType(_) | metadata::Type::CompositeType(_) => None, }) + .chain(aggregate_functions_result_types) .collect::>() } @@ -240,14 +250,6 @@ fn filter_aggregate_functions( .0 .into_iter() .filter(|(typ, _)| scalar_types.contains(typ)) - .map(|(typ, ops)| { - ( - typ, - ops.into_iter() - .filter(|(_, op)| scalar_types.contains(&op.return_type)) - .collect(), - ) - }) .collect(), ) } diff --git a/crates/configuration/src/version3/version3.sql b/crates/configuration/src/version3/version3.sql index ca5826c74..97bfa5f8c 100644 --- a/crates/configuration/src/version3/version3.sql +++ b/crates/configuration/src/version3/version3.sql @@ -354,6 +354,46 @@ WITH -- the purpose of selecting preferred implicit casts. ), + implicit_casts AS + ( + SELECT + t_from.type_name as from_type, + t_to.type_name as to_type + FROM + pg_cast + INNER JOIN + scalar_types + AS t_from + ON (t_from.type_id = pg_cast.castsource) + INNER JOIN + scalar_types + AS t_to + ON (t_to.type_id = pg_cast.casttarget) + WHERE + pg_cast.castcontext = 'i' + AND t_from.type_name != t_to.type_name + + -- This is a good candidate for a configurable option. + AND (t_from.type_name, t_to.type_name) NOT IN + ( + -- Ignore other casts that are unlikely to ever be relevant + ('bytea', 'geography'), + ('bytea', 'geometry'), + ('geography', 'bytea'), + ('geometry', 'bytea'), + ('geometry', 'text'), + ('text', 'geometry') + ) + UNION + -- Any domain type may be implicitly cast to its base type, even though these casts + -- are not declared in `pg_cast`. + SELECT + domain_types.type_name as from_type, + domain_types.base_type as to_type + FROM + domain_types + ), + -- Aggregate functions are recorded across 'pg_proc' and 'pg_aggregate', see -- https://www.postgresql.org/docs/current/catalog-pg-proc.html and -- https://www.postgresql.org/docs/current/catalog-pg-aggregate.html for @@ -372,6 +412,13 @@ WITH FROM pg_catalog.pg_proc AS proc + INNER JOIN + -- Until the schema is made part of our model of types we only consider + -- types defined in the public schema. + unqualified_schemas_for_types_and_procedures + AS q + ON (q.schema_id = proc.pronamespace) + -- fetch the argument type name, discarding any unsupported types INNER JOIN scalar_types AS arg_type ON (arg_type.type_id = proc.proargtypes[0]) @@ -393,6 +440,65 @@ WITH AND aggregate.aggnumdirectargs = 0 ), + aggregates_cast_extended AS + ( + WITH + type_combinations AS + ( + SELECT + agg.proc_name AS proc_name, + agg.return_type AS return_type, + cast1.from_type AS argument_type, + true AS argument_casted + FROM + aggregates + AS agg + INNER JOIN + implicit_casts + AS cast1 + ON (cast1.to_type = agg.argument_type) + UNION + SELECT + agg.proc_name AS proc_name, + agg.return_type AS return_type, + agg.argument_type AS argument_type, + false AS argument_casted + FROM + aggregates + AS agg + ), + + preferred_combinations AS + ( + SELECT + *, + -- CockroachDB does not observe ORDER BY of nested expressions, + -- So we cannot use the DISTINCT ON idiom to remove duplicates. + -- Therefore we resort to filtering by ordered ROW_NUMBER(). + ROW_NUMBER() + OVER + ( + PARTITION BY + proc_name, argument_type + ORDER BY + -- Prefer uncast argument. + NOT argument_casted DESC, + -- Arbitrary desperation: Lexical ordering + return_type ASC + ) + AS row_number + FROM + type_combinations + ) + SELECT + proc_name, + argument_type, + return_type + FROM + preferred_combinations + WHERE + row_number = 1 + ), -- Comparison procedures are any entries in 'pg_proc' that happen to be -- binary functions that return booleans. We also require, for the sake of @@ -508,46 +614,6 @@ WITH SELECT * FROM comparison_procedures ), - implicit_casts AS - ( - SELECT - t_from.type_name as from_type, - t_to.type_name as to_type - FROM - pg_cast - INNER JOIN - scalar_types - AS t_from - ON (t_from.type_id = pg_cast.castsource) - INNER JOIN - scalar_types - AS t_to - ON (t_to.type_id = pg_cast.casttarget) - WHERE - pg_cast.castcontext = 'i' - AND t_from.type_name != t_to.type_name - - -- This is a good candidate for a configurable option. - AND (t_from.type_name, t_to.type_name) NOT IN - ( - -- Ignore other casts that are unlikely to ever be relevant - ('bytea', 'geography'), - ('bytea', 'geometry'), - ('geography', 'bytea'), - ('geometry', 'bytea'), - ('geometry', 'text'), - ('text', 'geometry') - ) - UNION - -- Any domain type may be implicitly cast to its base type, even though these casts - -- are not declared in `pg_cast`. - SELECT - domain_types.type_name as from_type, - domain_types.base_type as to_type - FROM - domain_types - ), - -- Some comparison operators are not defined explicitly for every type they would be -- valid for, relying instead on implicit casts to extend the types they can apply to. -- @@ -1103,7 +1169,7 @@ FROM agg.argument_type, agg.return_type FROM - aggregates AS agg + aggregates_cast_extended AS agg ORDER BY argument_type, proc_name, return_type ) AS agg GROUP BY agg.argument_type diff --git a/crates/connectors/ndc-postgres/src/schema.rs b/crates/connectors/ndc-postgres/src/schema.rs index 49785354d..8a192b8d7 100644 --- a/crates/connectors/ndc-postgres/src/schema.rs +++ b/crates/connectors/ndc-postgres/src/schema.rs @@ -21,60 +21,64 @@ pub async fn get_schema( ) -> Result { let metadata = &config.metadata; let mut scalar_types: BTreeMap = - configuration::occurring_scalar_types(&metadata.tables, &metadata.native_queries) - .iter() - .map(|scalar_type| { - ( - scalar_type.0.clone(), - models::ScalarType { - aggregate_functions: metadata - .aggregate_functions - .0 - .get(scalar_type) - .unwrap_or(&BTreeMap::new()) - .iter() - .map(|(function_name, function_definition)| { - ( - function_name.clone(), - models::AggregateFunctionDefinition { - result_type: models::Type::Named { - name: function_definition.return_type.0.clone(), - }, + configuration::occurring_scalar_types( + &metadata.tables, + &metadata.native_queries, + &metadata.aggregate_functions, + ) + .iter() + .map(|scalar_type| { + ( + scalar_type.0.clone(), + models::ScalarType { + aggregate_functions: metadata + .aggregate_functions + .0 + .get(scalar_type) + .unwrap_or(&BTreeMap::new()) + .iter() + .map(|(function_name, function_definition)| { + ( + function_name.clone(), + models::AggregateFunctionDefinition { + result_type: models::Type::Named { + name: function_definition.return_type.0.clone(), }, - ) - }) - .collect(), - comparison_operators: metadata - .comparison_operators - .0 - .get(scalar_type) - .unwrap_or(&BTreeMap::new()) - .iter() - .map(|(op_name, op_def)| { - ( - op_name.clone(), - match op_def.operator_kind { - metadata::OperatorKind::Equal => { - models::ComparisonOperatorDefinition::Equal + }, + ) + }) + .collect(), + comparison_operators: metadata + .comparison_operators + .0 + .get(scalar_type) + .unwrap_or(&BTreeMap::new()) + .iter() + .map(|(op_name, op_def)| { + ( + op_name.clone(), + match op_def.operator_kind { + metadata::OperatorKind::Equal => { + models::ComparisonOperatorDefinition::Equal + } + metadata::OperatorKind::In => { + models::ComparisonOperatorDefinition::In + } + metadata::OperatorKind::Custom => { + models::ComparisonOperatorDefinition::Custom { + argument_type: models::Type::Named { + name: op_def.argument_type.0.clone(), + }, } - metadata::OperatorKind::In => { - models::ComparisonOperatorDefinition::In - } - metadata::OperatorKind::Custom => { - models::ComparisonOperatorDefinition::Custom { - argument_type: models::Type::Named { - name: op_def.argument_type.0.clone(), - }, - } - } - }, - ) - }) - .collect(), - }, - ) - }) - .collect(); + } + }, + ) + }) + .collect(), + }, + ) + }) + .collect(); let collections_by_identifier: BTreeMap<(&str, &str), &str> = metadata .tables diff --git a/crates/tests/databases-tests/src/citus/snapshots/databases_tests__citus__schema_tests__schema_test__get_schema.snap b/crates/tests/databases-tests/src/citus/snapshots/databases_tests__citus__schema_tests__schema_test__get_schema.snap index 028616c24..4c2d3305e 100644 --- a/crates/tests/databases-tests/src/citus/snapshots/databases_tests__citus__schema_tests__schema_test__get_schema.snap +++ b/crates/tests/databases-tests/src/citus/snapshots/databases_tests__citus__schema_tests__schema_test__get_schema.snap @@ -69,8 +69,150 @@ expression: result } } }, + "bpchar": { + "aggregate_functions": { + "max": { + "result_type": { + "type": "named", + "name": "bpchar" + } + }, + "min": { + "result_type": { + "type": "named", + "name": "bpchar" + } + } + }, + "comparison_operators": { + "_eq": { + "type": "equal" + }, + "_gt": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "bpchar" + } + }, + "_gte": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "bpchar" + } + }, + "_ilike": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "text" + } + }, + "_in": { + "type": "in" + }, + "_iregex": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "text" + } + }, + "_like": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "text" + } + }, + "_lt": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "bpchar" + } + }, + "_lte": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "bpchar" + } + }, + "_neq": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "bpchar" + } + }, + "_nilike": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "text" + } + }, + "_niregex": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "text" + } + }, + "_nlike": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "text" + } + }, + "_nregex": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "text" + } + }, + "_regex": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "text" + } + }, + "starts_with": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "bpchar" + } + }, + "ts_match_tt": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "bpchar" + } + } + } + }, "char": { - "aggregate_functions": {}, + "aggregate_functions": { + "max": { + "result_type": { + "type": "named", + "name": "text" + } + }, + "min": { + "result_type": { + "type": "named", + "name": "text" + } + } + }, "comparison_operators": { "_eq": { "type": "equal" @@ -245,7 +387,86 @@ expression: result } }, "even_number": { - "aggregate_functions": {}, + "aggregate_functions": { + "avg": { + "result_type": { + "type": "named", + "name": "numeric" + } + }, + "bit_and": { + "result_type": { + "type": "named", + "name": "int4" + } + }, + "bit_or": { + "result_type": { + "type": "named", + "name": "int4" + } + }, + "bit_xor": { + "result_type": { + "type": "named", + "name": "int4" + } + }, + "max": { + "result_type": { + "type": "named", + "name": "int4" + } + }, + "min": { + "result_type": { + "type": "named", + "name": "int4" + } + }, + "stddev": { + "result_type": { + "type": "named", + "name": "numeric" + } + }, + "stddev_pop": { + "result_type": { + "type": "named", + "name": "numeric" + } + }, + "stddev_samp": { + "result_type": { + "type": "named", + "name": "numeric" + } + }, + "sum": { + "result_type": { + "type": "named", + "name": "int8" + } + }, + "var_pop": { + "result_type": { + "type": "named", + "name": "numeric" + } + }, + "var_samp": { + "result_type": { + "type": "named", + "name": "numeric" + } + }, + "variance": { + "result_type": { + "type": "named", + "name": "numeric" + } + } + }, "comparison_operators": { "_eq": { "type": "equal" @@ -879,6 +1100,77 @@ expression: result } } }, + "interval": { + "aggregate_functions": { + "avg": { + "result_type": { + "type": "named", + "name": "interval" + } + }, + "max": { + "result_type": { + "type": "named", + "name": "interval" + } + }, + "min": { + "result_type": { + "type": "named", + "name": "interval" + } + }, + "sum": { + "result_type": { + "type": "named", + "name": "interval" + } + } + }, + "comparison_operators": { + "_eq": { + "type": "equal" + }, + "_gt": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "interval" + } + }, + "_gte": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "interval" + } + }, + "_in": { + "type": "in" + }, + "_lt": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "interval" + } + }, + "_lte": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "interval" + } + }, + "_neq": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "interval" + } + } + } + }, "numeric": { "aggregate_functions": { "avg": { @@ -1117,6 +1409,12 @@ expression: result }, "time": { "aggregate_functions": { + "avg": { + "result_type": { + "type": "named", + "name": "interval" + } + }, "max": { "result_type": { "type": "named", @@ -1128,6 +1426,12 @@ expression: result "type": "named", "name": "time" } + }, + "sum": { + "result_type": { + "type": "named", + "name": "interval" + } } }, "comparison_operators": { @@ -1398,7 +1702,20 @@ expression: result } }, "varchar": { - "aggregate_functions": {}, + "aggregate_functions": { + "max": { + "result_type": { + "type": "named", + "name": "bpchar" + } + }, + "min": { + "result_type": { + "type": "named", + "name": "bpchar" + } + } + }, "comparison_operators": { "_eq": { "type": "equal" diff --git a/crates/tests/databases-tests/src/cockroach/snapshots/databases_tests__cockroach__schema_tests__schema_test__get_schema.snap b/crates/tests/databases-tests/src/cockroach/snapshots/databases_tests__cockroach__schema_tests__schema_test__get_schema.snap index 6b3f0d05f..7e22a5fd6 100644 --- a/crates/tests/databases-tests/src/cockroach/snapshots/databases_tests__cockroach__schema_tests__schema_test__get_schema.snap +++ b/crates/tests/databases-tests/src/cockroach/snapshots/databases_tests__cockroach__schema_tests__schema_test__get_schema.snap @@ -70,7 +70,14 @@ expression: result } }, "char": { - "aggregate_functions": {}, + "aggregate_functions": { + "concat_agg": { + "result_type": { + "type": "named", + "name": "text" + } + } + }, "comparison_operators": { "_eq": { "type": "equal" @@ -260,7 +267,62 @@ expression: result } }, "float4": { - "aggregate_functions": {}, + "aggregate_functions": { + "avg": { + "result_type": { + "type": "named", + "name": "float8" + } + }, + "sqrdiff": { + "result_type": { + "type": "named", + "name": "float8" + } + }, + "stddev": { + "result_type": { + "type": "named", + "name": "float8" + } + }, + "stddev_pop": { + "result_type": { + "type": "named", + "name": "float8" + } + }, + "stddev_samp": { + "result_type": { + "type": "named", + "name": "float8" + } + }, + "sum": { + "result_type": { + "type": "named", + "name": "float8" + } + }, + "var_pop": { + "result_type": { + "type": "named", + "name": "float8" + } + }, + "var_samp": { + "result_type": { + "type": "named", + "name": "float8" + } + }, + "variance": { + "result_type": { + "type": "named", + "name": "float8" + } + } + }, "comparison_operators": { "_eq": { "type": "equal" @@ -407,7 +469,86 @@ expression: result } }, "int2": { - "aggregate_functions": {}, + "aggregate_functions": { + "avg": { + "result_type": { + "type": "named", + "name": "float8" + } + }, + "bit_and": { + "result_type": { + "type": "named", + "name": "int8" + } + }, + "bit_or": { + "result_type": { + "type": "named", + "name": "int8" + } + }, + "sqrdiff": { + "result_type": { + "type": "named", + "name": "float8" + } + }, + "stddev": { + "result_type": { + "type": "named", + "name": "float8" + } + }, + "stddev_pop": { + "result_type": { + "type": "named", + "name": "float8" + } + }, + "stddev_samp": { + "result_type": { + "type": "named", + "name": "float8" + } + }, + "sum": { + "result_type": { + "type": "named", + "name": "float8" + } + }, + "sum_int": { + "result_type": { + "type": "named", + "name": "int8" + } + }, + "var_pop": { + "result_type": { + "type": "named", + "name": "float8" + } + }, + "var_samp": { + "result_type": { + "type": "named", + "name": "float8" + } + }, + "variance": { + "result_type": { + "type": "named", + "name": "float8" + } + }, + "xor_agg": { + "result_type": { + "type": "named", + "name": "int8" + } + } + }, "comparison_operators": { "_eq": { "type": "equal" @@ -453,7 +594,86 @@ expression: result } }, "int4": { - "aggregate_functions": {}, + "aggregate_functions": { + "avg": { + "result_type": { + "type": "named", + "name": "float8" + } + }, + "bit_and": { + "result_type": { + "type": "named", + "name": "int8" + } + }, + "bit_or": { + "result_type": { + "type": "named", + "name": "int8" + } + }, + "sqrdiff": { + "result_type": { + "type": "named", + "name": "float8" + } + }, + "stddev": { + "result_type": { + "type": "named", + "name": "float8" + } + }, + "stddev_pop": { + "result_type": { + "type": "named", + "name": "float8" + } + }, + "stddev_samp": { + "result_type": { + "type": "named", + "name": "float8" + } + }, + "sum": { + "result_type": { + "type": "named", + "name": "float8" + } + }, + "sum_int": { + "result_type": { + "type": "named", + "name": "int8" + } + }, + "var_pop": { + "result_type": { + "type": "named", + "name": "float8" + } + }, + "var_samp": { + "result_type": { + "type": "named", + "name": "float8" + } + }, + "variance": { + "result_type": { + "type": "named", + "name": "float8" + } + }, + "xor_agg": { + "result_type": { + "type": "named", + "name": "int8" + } + } + }, "comparison_operators": { "_eq": { "type": "equal" @@ -623,6 +843,65 @@ expression: result } } }, + "interval": { + "aggregate_functions": { + "avg": { + "result_type": { + "type": "named", + "name": "interval" + } + }, + "sum": { + "result_type": { + "type": "named", + "name": "interval" + } + } + }, + "comparison_operators": { + "_eq": { + "type": "equal" + }, + "_gt": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "interval" + } + }, + "_gte": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "interval" + } + }, + "_in": { + "type": "in" + }, + "_lt": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "interval" + } + }, + "_lte": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "interval" + } + }, + "_neq": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "interval" + } + } + } + }, "numeric": { "aggregate_functions": { "avg": { @@ -876,7 +1155,20 @@ expression: result } }, "time": { - "aggregate_functions": {}, + "aggregate_functions": { + "avg": { + "result_type": { + "type": "named", + "name": "interval" + } + }, + "sum": { + "result_type": { + "type": "named", + "name": "interval" + } + } + }, "comparison_operators": { "_eq": { "type": "equal" @@ -1106,7 +1398,14 @@ expression: result } }, "varchar": { - "aggregate_functions": {}, + "aggregate_functions": { + "concat_agg": { + "result_type": { + "type": "named", + "name": "text" + } + } + }, "comparison_operators": { "_eq": { "type": "equal" diff --git a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__postgres_current_only_configure_v3_initial_configuration_is_unchanged.snap b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__postgres_current_only_configure_v3_initial_configuration_is_unchanged.snap index 94dd670f9..74b52ae95 100644 --- a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__postgres_current_only_configure_v3_initial_configuration_is_unchanged.snap +++ b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__postgres_current_only_configure_v3_initial_configuration_is_unchanged.snap @@ -1066,6 +1066,47 @@ expression: default_configuration "returnType": "date" } }, + "even_number": { + "avg": { + "returnType": "numeric" + }, + "bit_and": { + "returnType": "int4" + }, + "bit_or": { + "returnType": "int4" + }, + "bit_xor": { + "returnType": "int4" + }, + "max": { + "returnType": "int4" + }, + "min": { + "returnType": "int4" + }, + "stddev": { + "returnType": "numeric" + }, + "stddev_pop": { + "returnType": "numeric" + }, + "stddev_samp": { + "returnType": "numeric" + }, + "sum": { + "returnType": "int8" + }, + "var_pop": { + "returnType": "numeric" + }, + "var_samp": { + "returnType": "numeric" + }, + "variance": { + "returnType": "numeric" + } + }, "float8": { "avg": { "returnType": "float8" @@ -1227,6 +1268,14 @@ expression: default_configuration "min": { "returnType": "timestamp" } + }, + "varchar": { + "max": { + "returnType": "bpchar" + }, + "min": { + "returnType": "bpchar" + } } }, "comparisonOperators": { diff --git a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__schema_tests__schema_test__get_schema.snap b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__schema_tests__schema_test__get_schema.snap index dcc80f7d1..fadab0ad2 100644 --- a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__schema_tests__schema_test__get_schema.snap +++ b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__schema_tests__schema_test__get_schema.snap @@ -69,8 +69,178 @@ expression: result } } }, + "bpchar": { + "aggregate_functions": { + "max": { + "result_type": { + "type": "named", + "name": "bpchar" + } + }, + "min": { + "result_type": { + "type": "named", + "name": "bpchar" + } + } + }, + "comparison_operators": { + "_eq": { + "type": "equal" + }, + "_gt": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "bpchar" + } + }, + "_gte": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "bpchar" + } + }, + "_ilike": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "text" + } + }, + "_in": { + "type": "in" + }, + "_iregex": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "text" + } + }, + "_like": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "text" + } + }, + "_lt": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "bpchar" + } + }, + "_lte": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "bpchar" + } + }, + "_neq": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "bpchar" + } + }, + "_nilike": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "text" + } + }, + "_niregex": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "text" + } + }, + "_nlike": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "text" + } + }, + "_nregex": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "text" + } + }, + "_regex": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "text" + } + }, + "st_coveredby": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "bpchar" + } + }, + "st_covers": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "bpchar" + } + }, + "st_intersects": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "bpchar" + } + }, + "st_relatematch": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "bpchar" + } + }, + "starts_with": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "bpchar" + } + }, + "ts_match_tt": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "bpchar" + } + } + } + }, "char": { - "aggregate_functions": {}, + "aggregate_functions": { + "max": { + "result_type": { + "type": "named", + "name": "text" + } + }, + "min": { + "result_type": { + "type": "named", + "name": "text" + } + } + }, "comparison_operators": { "_eq": { "type": "equal" @@ -273,7 +443,86 @@ expression: result } }, "even_number": { - "aggregate_functions": {}, + "aggregate_functions": { + "avg": { + "result_type": { + "type": "named", + "name": "numeric" + } + }, + "bit_and": { + "result_type": { + "type": "named", + "name": "int4" + } + }, + "bit_or": { + "result_type": { + "type": "named", + "name": "int4" + } + }, + "bit_xor": { + "result_type": { + "type": "named", + "name": "int4" + } + }, + "max": { + "result_type": { + "type": "named", + "name": "int4" + } + }, + "min": { + "result_type": { + "type": "named", + "name": "int4" + } + }, + "stddev": { + "result_type": { + "type": "named", + "name": "numeric" + } + }, + "stddev_pop": { + "result_type": { + "type": "named", + "name": "numeric" + } + }, + "stddev_samp": { + "result_type": { + "type": "named", + "name": "numeric" + } + }, + "sum": { + "result_type": { + "type": "named", + "name": "int8" + } + }, + "var_pop": { + "result_type": { + "type": "named", + "name": "numeric" + } + }, + "var_samp": { + "result_type": { + "type": "named", + "name": "numeric" + } + }, + "variance": { + "result_type": { + "type": "named", + "name": "numeric" + } + } + }, "comparison_operators": { "_eq": { "type": "equal" @@ -907,6 +1156,77 @@ expression: result } } }, + "interval": { + "aggregate_functions": { + "avg": { + "result_type": { + "type": "named", + "name": "interval" + } + }, + "max": { + "result_type": { + "type": "named", + "name": "interval" + } + }, + "min": { + "result_type": { + "type": "named", + "name": "interval" + } + }, + "sum": { + "result_type": { + "type": "named", + "name": "interval" + } + } + }, + "comparison_operators": { + "_eq": { + "type": "equal" + }, + "_gt": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "interval" + } + }, + "_gte": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "interval" + } + }, + "_in": { + "type": "in" + }, + "_lt": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "interval" + } + }, + "_lte": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "interval" + } + }, + "_neq": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "interval" + } + } + } + }, "numeric": { "aggregate_functions": { "avg": { @@ -1173,6 +1493,12 @@ expression: result }, "time": { "aggregate_functions": { + "avg": { + "result_type": { + "type": "named", + "name": "interval" + } + }, "max": { "result_type": { "type": "named", @@ -1184,6 +1510,12 @@ expression: result "type": "named", "name": "time" } + }, + "sum": { + "result_type": { + "type": "named", + "name": "interval" + } } }, "comparison_operators": { @@ -1454,7 +1786,20 @@ expression: result } }, "varchar": { - "aggregate_functions": {}, + "aggregate_functions": { + "max": { + "result_type": { + "type": "named", + "name": "bpchar" + } + }, + "min": { + "result_type": { + "type": "named", + "name": "bpchar" + } + } + }, "comparison_operators": { "_eq": { "type": "equal" diff --git a/static/citus/v3-chinook-ndc-metadata/configuration.json b/static/citus/v3-chinook-ndc-metadata/configuration.json index e6bfee504..b3367616f 100644 --- a/static/citus/v3-chinook-ndc-metadata/configuration.json +++ b/static/citus/v3-chinook-ndc-metadata/configuration.json @@ -1572,6 +1572,22 @@ "returnType": "bool" } }, + "bpchar": { + "max": { + "returnType": "bpchar" + }, + "min": { + "returnType": "bpchar" + } + }, + "char": { + "max": { + "returnType": "text" + }, + "min": { + "returnType": "text" + } + }, "date": { "max": { "returnType": "date" @@ -1580,6 +1596,47 @@ "returnType": "date" } }, + "even_number": { + "avg": { + "returnType": "numeric" + }, + "bit_and": { + "returnType": "int4" + }, + "bit_or": { + "returnType": "int4" + }, + "bit_xor": { + "returnType": "int4" + }, + "max": { + "returnType": "int4" + }, + "min": { + "returnType": "int4" + }, + "stddev": { + "returnType": "numeric" + }, + "stddev_pop": { + "returnType": "numeric" + }, + "stddev_samp": { + "returnType": "numeric" + }, + "sum": { + "returnType": "int8" + }, + "var_pop": { + "returnType": "numeric" + }, + "var_samp": { + "returnType": "numeric" + }, + "variance": { + "returnType": "numeric" + } + }, "float4": { "avg": { "returnType": "float8" @@ -1767,6 +1824,20 @@ "returnType": "numeric" } }, + "interval": { + "avg": { + "returnType": "interval" + }, + "max": { + "returnType": "interval" + }, + "min": { + "returnType": "interval" + }, + "sum": { + "returnType": "interval" + } + }, "numeric": { "avg": { "returnType": "numeric" @@ -1808,11 +1879,17 @@ } }, "time": { + "avg": { + "returnType": "interval" + }, "max": { "returnType": "time" }, "min": { "returnType": "time" + }, + "sum": { + "returnType": "interval" } }, "timestamp": { @@ -1838,6 +1915,14 @@ "min": { "returnType": "timetz" } + }, + "varchar": { + "max": { + "returnType": "bpchar" + }, + "min": { + "returnType": "bpchar" + } } }, "comparisonOperators": { @@ -1885,6 +1970,110 @@ "isInfix": true } }, + "bpchar": { + "_eq": { + "operatorName": "=", + "operatorKind": "equal", + "argumentType": "bpchar", + "isInfix": true + }, + "_gt": { + "operatorName": ">", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": true + }, + "_gte": { + "operatorName": ">=", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": true + }, + "_ilike": { + "operatorName": "~~*", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_in": { + "operatorName": "IN", + "operatorKind": "in", + "argumentType": "bpchar", + "isInfix": true + }, + "_iregex": { + "operatorName": "~*", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_like": { + "operatorName": "~~", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_lt": { + "operatorName": "<", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": true + }, + "_lte": { + "operatorName": "<=", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": true + }, + "_neq": { + "operatorName": "<>", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": true + }, + "_nilike": { + "operatorName": "!~~*", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_niregex": { + "operatorName": "!~*", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_nlike": { + "operatorName": "!~~", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_nregex": { + "operatorName": "!~", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_regex": { + "operatorName": "~", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "starts_with": { + "operatorName": "starts_with", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": false + }, + "ts_match_tt": { + "operatorName": "ts_match_tt", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": false + } + }, "char": { "_eq": { "operatorName": "=", @@ -2297,6 +2486,50 @@ "isInfix": true } }, + "interval": { + "_eq": { + "operatorName": "=", + "operatorKind": "equal", + "argumentType": "interval", + "isInfix": true + }, + "_gt": { + "operatorName": ">", + "operatorKind": "custom", + "argumentType": "interval", + "isInfix": true + }, + "_gte": { + "operatorName": ">=", + "operatorKind": "custom", + "argumentType": "interval", + "isInfix": true + }, + "_in": { + "operatorName": "IN", + "operatorKind": "in", + "argumentType": "interval", + "isInfix": true + }, + "_lt": { + "operatorName": "<", + "operatorKind": "custom", + "argumentType": "interval", + "isInfix": true + }, + "_lte": { + "operatorName": "<=", + "operatorKind": "custom", + "argumentType": "interval", + "isInfix": true + }, + "_neq": { + "operatorName": "<>", + "operatorKind": "custom", + "argumentType": "interval", + "isInfix": true + } + }, "numeric": { "_eq": { "operatorName": "=", diff --git a/static/cockroach/v3-chinook-ndc-metadata/configuration.json b/static/cockroach/v3-chinook-ndc-metadata/configuration.json index e7441d98c..fc7788601 100644 --- a/static/cockroach/v3-chinook-ndc-metadata/configuration.json +++ b/static/cockroach/v3-chinook-ndc-metadata/configuration.json @@ -1478,6 +1478,40 @@ "returnType": "bool" } }, + "char": { + "concat_agg": { + "returnType": "text" + } + }, + "float4": { + "avg": { + "returnType": "float8" + }, + "sqrdiff": { + "returnType": "float8" + }, + "stddev": { + "returnType": "float8" + }, + "stddev_pop": { + "returnType": "float8" + }, + "stddev_samp": { + "returnType": "float8" + }, + "sum": { + "returnType": "float8" + }, + "var_pop": { + "returnType": "float8" + }, + "var_samp": { + "returnType": "float8" + }, + "variance": { + "returnType": "float8" + } + }, "float8": { "avg": { "returnType": "float8" @@ -1507,6 +1541,88 @@ "returnType": "float8" } }, + "int2": { + "avg": { + "returnType": "float8" + }, + "bit_and": { + "returnType": "int8" + }, + "bit_or": { + "returnType": "int8" + }, + "sqrdiff": { + "returnType": "float8" + }, + "stddev": { + "returnType": "float8" + }, + "stddev_pop": { + "returnType": "float8" + }, + "stddev_samp": { + "returnType": "float8" + }, + "sum": { + "returnType": "float8" + }, + "sum_int": { + "returnType": "int8" + }, + "var_pop": { + "returnType": "float8" + }, + "var_samp": { + "returnType": "float8" + }, + "variance": { + "returnType": "float8" + }, + "xor_agg": { + "returnType": "int8" + } + }, + "int4": { + "avg": { + "returnType": "float8" + }, + "bit_and": { + "returnType": "int8" + }, + "bit_or": { + "returnType": "int8" + }, + "sqrdiff": { + "returnType": "float8" + }, + "stddev": { + "returnType": "float8" + }, + "stddev_pop": { + "returnType": "float8" + }, + "stddev_samp": { + "returnType": "float8" + }, + "sum": { + "returnType": "float8" + }, + "sum_int": { + "returnType": "int8" + }, + "var_pop": { + "returnType": "float8" + }, + "var_samp": { + "returnType": "float8" + }, + "variance": { + "returnType": "float8" + }, + "xor_agg": { + "returnType": "int8" + } + }, "int8": { "avg": { "returnType": "numeric" @@ -1548,6 +1664,14 @@ "returnType": "int8" } }, + "interval": { + "avg": { + "returnType": "interval" + }, + "sum": { + "returnType": "interval" + } + }, "numeric": { "avg": { "returnType": "numeric" @@ -1581,6 +1705,19 @@ "concat_agg": { "returnType": "text" } + }, + "time": { + "avg": { + "returnType": "interval" + }, + "sum": { + "returnType": "interval" + } + }, + "varchar": { + "concat_agg": { + "returnType": "text" + } } }, "comparisonOperators": { @@ -2020,6 +2157,50 @@ "isInfix": true } }, + "interval": { + "_eq": { + "operatorName": "=", + "operatorKind": "equal", + "argumentType": "interval", + "isInfix": true + }, + "_gt": { + "operatorName": ">", + "operatorKind": "custom", + "argumentType": "interval", + "isInfix": true + }, + "_gte": { + "operatorName": ">=", + "operatorKind": "custom", + "argumentType": "interval", + "isInfix": true + }, + "_in": { + "operatorName": "IN", + "operatorKind": "in", + "argumentType": "interval", + "isInfix": true + }, + "_lt": { + "operatorName": "<", + "operatorKind": "custom", + "argumentType": "interval", + "isInfix": true + }, + "_lte": { + "operatorName": "<=", + "operatorKind": "custom", + "argumentType": "interval", + "isInfix": true + }, + "_neq": { + "operatorName": "!=", + "operatorKind": "custom", + "argumentType": "interval", + "isInfix": true + } + }, "numeric": { "_eq": { "operatorName": "=", diff --git a/static/postgres/broken-queries-ndc-metadata/configuration.json b/static/postgres/broken-queries-ndc-metadata/configuration.json index 9d1670f62..67408b4ad 100644 --- a/static/postgres/broken-queries-ndc-metadata/configuration.json +++ b/static/postgres/broken-queries-ndc-metadata/configuration.json @@ -50,6 +50,9 @@ }, "aggregateFunctions": { "int4": { + "avg": { + "returnType": "numeric" + }, "bit_and": { "returnType": "int4" }, @@ -64,6 +67,100 @@ }, "min": { "returnType": "int4" + }, + "stddev": { + "returnType": "numeric" + }, + "stddev_pop": { + "returnType": "numeric" + }, + "stddev_samp": { + "returnType": "numeric" + }, + "sum": { + "returnType": "int8" + }, + "var_pop": { + "returnType": "numeric" + }, + "var_samp": { + "returnType": "numeric" + }, + "variance": { + "returnType": "numeric" + } + }, + "int8": { + "avg": { + "returnType": "numeric" + }, + "bit_and": { + "returnType": "int8" + }, + "bit_or": { + "returnType": "int8" + }, + "bit_xor": { + "returnType": "int8" + }, + "max": { + "returnType": "int8" + }, + "min": { + "returnType": "int8" + }, + "stddev": { + "returnType": "numeric" + }, + "stddev_pop": { + "returnType": "numeric" + }, + "stddev_samp": { + "returnType": "numeric" + }, + "sum": { + "returnType": "numeric" + }, + "var_pop": { + "returnType": "numeric" + }, + "var_samp": { + "returnType": "numeric" + }, + "variance": { + "returnType": "numeric" + } + }, + "numeric": { + "avg": { + "returnType": "numeric" + }, + "max": { + "returnType": "numeric" + }, + "min": { + "returnType": "numeric" + }, + "stddev": { + "returnType": "numeric" + }, + "stddev_pop": { + "returnType": "numeric" + }, + "stddev_samp": { + "returnType": "numeric" + }, + "sum": { + "returnType": "numeric" + }, + "var_pop": { + "returnType": "numeric" + }, + "var_samp": { + "returnType": "numeric" + }, + "variance": { + "returnType": "numeric" } } }, @@ -111,6 +208,94 @@ "argumentType": "int4", "isInfix": true } + }, + "int8": { + "_eq": { + "operatorName": "=", + "operatorKind": "equal", + "argumentType": "int8", + "isInfix": true + }, + "_gt": { + "operatorName": ">", + "operatorKind": "custom", + "argumentType": "int8", + "isInfix": true + }, + "_gte": { + "operatorName": ">=", + "operatorKind": "custom", + "argumentType": "int8", + "isInfix": true + }, + "_in": { + "operatorName": "IN", + "operatorKind": "in", + "argumentType": "int8", + "isInfix": true + }, + "_lt": { + "operatorName": "<", + "operatorKind": "custom", + "argumentType": "int8", + "isInfix": true + }, + "_lte": { + "operatorName": "<=", + "operatorKind": "custom", + "argumentType": "int8", + "isInfix": true + }, + "_neq": { + "operatorName": "<>", + "operatorKind": "custom", + "argumentType": "int8", + "isInfix": true + } + }, + "numeric": { + "_eq": { + "operatorName": "=", + "operatorKind": "equal", + "argumentType": "numeric", + "isInfix": true + }, + "_gt": { + "operatorName": ">", + "operatorKind": "custom", + "argumentType": "numeric", + "isInfix": true + }, + "_gte": { + "operatorName": ">=", + "operatorKind": "custom", + "argumentType": "numeric", + "isInfix": true + }, + "_in": { + "operatorName": "IN", + "operatorKind": "in", + "argumentType": "numeric", + "isInfix": true + }, + "_lt": { + "operatorName": "<", + "operatorKind": "custom", + "argumentType": "numeric", + "isInfix": true + }, + "_lte": { + "operatorName": "<=", + "operatorKind": "custom", + "argumentType": "numeric", + "isInfix": true + }, + "_neq": { + "operatorName": "<>", + "operatorKind": "custom", + "argumentType": "numeric", + "isInfix": true + } } } }, diff --git a/static/postgres/v3-chinook-ndc-metadata/configuration.json b/static/postgres/v3-chinook-ndc-metadata/configuration.json index 51cdc3bbb..12267da28 100644 --- a/static/postgres/v3-chinook-ndc-metadata/configuration.json +++ b/static/postgres/v3-chinook-ndc-metadata/configuration.json @@ -1829,6 +1829,22 @@ "returnType": "bool" } }, + "bpchar": { + "max": { + "returnType": "bpchar" + }, + "min": { + "returnType": "bpchar" + } + }, + "char": { + "max": { + "returnType": "text" + }, + "min": { + "returnType": "text" + } + }, "date": { "max": { "returnType": "date" @@ -1837,6 +1853,47 @@ "returnType": "date" } }, + "even_number": { + "avg": { + "returnType": "numeric" + }, + "bit_and": { + "returnType": "int4" + }, + "bit_or": { + "returnType": "int4" + }, + "bit_xor": { + "returnType": "int4" + }, + "max": { + "returnType": "int4" + }, + "min": { + "returnType": "int4" + }, + "stddev": { + "returnType": "numeric" + }, + "stddev_pop": { + "returnType": "numeric" + }, + "stddev_samp": { + "returnType": "numeric" + }, + "sum": { + "returnType": "int8" + }, + "var_pop": { + "returnType": "numeric" + }, + "var_samp": { + "returnType": "numeric" + }, + "variance": { + "returnType": "numeric" + } + }, "float4": { "avg": { "returnType": "float8" @@ -2024,6 +2081,20 @@ "returnType": "numeric" } }, + "interval": { + "avg": { + "returnType": "interval" + }, + "max": { + "returnType": "interval" + }, + "min": { + "returnType": "interval" + }, + "sum": { + "returnType": "interval" + } + }, "numeric": { "avg": { "returnType": "numeric" @@ -2065,11 +2136,17 @@ } }, "time": { + "avg": { + "returnType": "interval" + }, "max": { "returnType": "time" }, "min": { "returnType": "time" + }, + "sum": { + "returnType": "interval" } }, "timestamp": { @@ -2095,6 +2172,14 @@ "min": { "returnType": "timetz" } + }, + "varchar": { + "max": { + "returnType": "bpchar" + }, + "min": { + "returnType": "bpchar" + } } }, "comparisonOperators": { @@ -2142,6 +2227,134 @@ "isInfix": true } }, + "bpchar": { + "_eq": { + "operatorName": "=", + "operatorKind": "equal", + "argumentType": "bpchar", + "isInfix": true + }, + "_gt": { + "operatorName": ">", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": true + }, + "_gte": { + "operatorName": ">=", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": true + }, + "_ilike": { + "operatorName": "~~*", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_in": { + "operatorName": "IN", + "operatorKind": "in", + "argumentType": "bpchar", + "isInfix": true + }, + "_iregex": { + "operatorName": "~*", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_like": { + "operatorName": "~~", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_lt": { + "operatorName": "<", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": true + }, + "_lte": { + "operatorName": "<=", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": true + }, + "_neq": { + "operatorName": "<>", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": true + }, + "_nilike": { + "operatorName": "!~~*", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_niregex": { + "operatorName": "!~*", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_nlike": { + "operatorName": "!~~", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_nregex": { + "operatorName": "!~", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_regex": { + "operatorName": "~", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "st_coveredby": { + "operatorName": "st_coveredby", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": false + }, + "st_covers": { + "operatorName": "st_covers", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": false + }, + "st_intersects": { + "operatorName": "st_intersects", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": false + }, + "st_relatematch": { + "operatorName": "st_relatematch", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": false + }, + "starts_with": { + "operatorName": "starts_with", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": false + }, + "ts_match_tt": { + "operatorName": "ts_match_tt", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": false + } + }, "char": { "_eq": { "operatorName": "=", @@ -2578,6 +2791,50 @@ "isInfix": true } }, + "interval": { + "_eq": { + "operatorName": "=", + "operatorKind": "equal", + "argumentType": "interval", + "isInfix": true + }, + "_gt": { + "operatorName": ">", + "operatorKind": "custom", + "argumentType": "interval", + "isInfix": true + }, + "_gte": { + "operatorName": ">=", + "operatorKind": "custom", + "argumentType": "interval", + "isInfix": true + }, + "_in": { + "operatorName": "IN", + "operatorKind": "in", + "argumentType": "interval", + "isInfix": true + }, + "_lt": { + "operatorName": "<", + "operatorKind": "custom", + "argumentType": "interval", + "isInfix": true + }, + "_lte": { + "operatorName": "<=", + "operatorKind": "custom", + "argumentType": "interval", + "isInfix": true + }, + "_neq": { + "operatorName": "<>", + "operatorKind": "custom", + "argumentType": "interval", + "isInfix": true + } + }, "numeric": { "_eq": { "operatorName": "=", diff --git a/static/yugabyte/v3-chinook-ndc-metadata/configuration.json b/static/yugabyte/v3-chinook-ndc-metadata/configuration.json index 47fdeb2e2..7f208ade0 100644 --- a/static/yugabyte/v3-chinook-ndc-metadata/configuration.json +++ b/static/yugabyte/v3-chinook-ndc-metadata/configuration.json @@ -1546,6 +1546,22 @@ "returnType": "bool" } }, + "bpchar": { + "max": { + "returnType": "bpchar" + }, + "min": { + "returnType": "bpchar" + } + }, + "char": { + "max": { + "returnType": "text" + }, + "min": { + "returnType": "text" + } + }, "date": { "max": { "returnType": "date" @@ -1554,6 +1570,44 @@ "returnType": "date" } }, + "even_number": { + "avg": { + "returnType": "numeric" + }, + "bit_and": { + "returnType": "int4" + }, + "bit_or": { + "returnType": "int4" + }, + "max": { + "returnType": "int4" + }, + "min": { + "returnType": "int4" + }, + "stddev": { + "returnType": "numeric" + }, + "stddev_pop": { + "returnType": "numeric" + }, + "stddev_samp": { + "returnType": "numeric" + }, + "sum": { + "returnType": "int8" + }, + "var_pop": { + "returnType": "numeric" + }, + "var_samp": { + "returnType": "numeric" + }, + "variance": { + "returnType": "numeric" + } + }, "float4": { "avg": { "returnType": "float8" @@ -1732,6 +1786,20 @@ "returnType": "numeric" } }, + "interval": { + "avg": { + "returnType": "interval" + }, + "max": { + "returnType": "interval" + }, + "min": { + "returnType": "interval" + }, + "sum": { + "returnType": "interval" + } + }, "numeric": { "avg": { "returnType": "numeric" @@ -1773,11 +1841,17 @@ } }, "time": { + "avg": { + "returnType": "interval" + }, "max": { "returnType": "time" }, "min": { "returnType": "time" + }, + "sum": { + "returnType": "interval" } }, "timestamp": { @@ -1803,6 +1877,14 @@ "min": { "returnType": "timetz" } + }, + "varchar": { + "max": { + "returnType": "bpchar" + }, + "min": { + "returnType": "bpchar" + } } }, "comparisonOperators": { @@ -1850,6 +1932,110 @@ "isInfix": true } }, + "bpchar": { + "_eq": { + "operatorName": "=", + "operatorKind": "equal", + "argumentType": "bpchar", + "isInfix": true + }, + "_gt": { + "operatorName": ">", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": true + }, + "_gte": { + "operatorName": ">=", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": true + }, + "_ilike": { + "operatorName": "~~*", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_in": { + "operatorName": "IN", + "operatorKind": "in", + "argumentType": "bpchar", + "isInfix": true + }, + "_iregex": { + "operatorName": "~*", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_like": { + "operatorName": "~~", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_lt": { + "operatorName": "<", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": true + }, + "_lte": { + "operatorName": "<=", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": true + }, + "_neq": { + "operatorName": "<>", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": true + }, + "_nilike": { + "operatorName": "!~~*", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_niregex": { + "operatorName": "!~*", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_nlike": { + "operatorName": "!~~", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_nregex": { + "operatorName": "!~", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_regex": { + "operatorName": "~", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "starts_with": { + "operatorName": "starts_with", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": false + }, + "ts_match_tt": { + "operatorName": "ts_match_tt", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": false + } + }, "char": { "_eq": { "operatorName": "=", @@ -2262,6 +2448,50 @@ "isInfix": true } }, + "interval": { + "_eq": { + "operatorName": "=", + "operatorKind": "equal", + "argumentType": "interval", + "isInfix": true + }, + "_gt": { + "operatorName": ">", + "operatorKind": "custom", + "argumentType": "interval", + "isInfix": true + }, + "_gte": { + "operatorName": ">=", + "operatorKind": "custom", + "argumentType": "interval", + "isInfix": true + }, + "_in": { + "operatorName": "IN", + "operatorKind": "in", + "argumentType": "interval", + "isInfix": true + }, + "_lt": { + "operatorName": "<", + "operatorKind": "custom", + "argumentType": "interval", + "isInfix": true + }, + "_lte": { + "operatorName": "<=", + "operatorKind": "custom", + "argumentType": "interval", + "isInfix": true + }, + "_neq": { + "operatorName": "<>", + "operatorKind": "custom", + "argumentType": "interval", + "isInfix": true + } + }, "numeric": { "_eq": { "operatorName": "=",