(func: &UnaryFunc, arg: &ReprColumnType)
| 1294 | }; |
| 1295 | |
| 1296 | fn unary_typecheck(func: &UnaryFunc, arg: &ReprColumnType) -> bool { |
| 1297 | use UnaryFunc::*; |
| 1298 | match func { |
| 1299 | CastNumericToMzTimestamp(_) | NegNumeric(_) => arg.scalar_type == NUM_TYPE, |
| 1300 | CastJsonbToNumeric(_) | CastJsonbToBool(_) | CastJsonbToString(_) => { |
| 1301 | arg.scalar_type == ReprScalarType::Jsonb |
| 1302 | } |
| 1303 | ExtractTimestamp(_) | DateTruncTimestamp(_) => { |
| 1304 | arg.scalar_type == ReprScalarType::Timestamp |
| 1305 | } |
| 1306 | ExtractDate(_) => arg.scalar_type == ReprScalarType::Date, |
| 1307 | Not(_) => arg.scalar_type == ReprScalarType::Bool, |
| 1308 | IsNull(_) => true, |
| 1309 | TryParseMonotonicIso8601Timestamp(_) => arg.scalar_type == ReprScalarType::String, |
| 1310 | _ => false, |
| 1311 | } |
| 1312 | } |
| 1313 | |
| 1314 | fn interesting_binary_funcs() -> Vec<BinaryFunc> { |
| 1315 | vec![ |
no outgoing calls
no test coverage detected