From 5fd9e65f0ebf989e64b1499ecf6e9e6474ca4be3 Mon Sep 17 00:00:00 2001 From: Wei Zheng Date: Mon, 22 Aug 2022 09:52:30 -0700 Subject: [PATCH] Make functionNullability property consistent in ResolvedFunction The mismatch of "nullability" and "functionNullability" could cause failure of JSON deserialization for ResolvedFunction --- .../src/main/java/io/trino/metadata/ResolvedFunction.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/trino-main/src/main/java/io/trino/metadata/ResolvedFunction.java b/core/trino-main/src/main/java/io/trino/metadata/ResolvedFunction.java index b79ab8b0a36..818e4fa50ce 100644 --- a/core/trino-main/src/main/java/io/trino/metadata/ResolvedFunction.java +++ b/core/trino-main/src/main/java/io/trino/metadata/ResolvedFunction.java @@ -76,7 +76,7 @@ public ResolvedFunction( @JsonProperty("id") FunctionId functionId, @JsonProperty("functionKind") FunctionKind functionKind, @JsonProperty("deterministic") boolean deterministic, - @JsonProperty("nullability") FunctionNullability functionNullability, + @JsonProperty("functionNullability") FunctionNullability functionNullability, @JsonProperty("typeDependencies") Map typeDependencies, @JsonProperty("functionDependencies") Set functionDependencies) { @@ -85,7 +85,7 @@ public ResolvedFunction( this.functionId = requireNonNull(functionId, "functionId is null"); this.functionKind = requireNonNull(functionKind, "functionKind is null"); this.deterministic = deterministic; - this.functionNullability = requireNonNull(functionNullability, "nullability is null"); + this.functionNullability = requireNonNull(functionNullability, "functionNullability is null"); this.typeDependencies = ImmutableMap.copyOf(requireNonNull(typeDependencies, "typeDependencies is null")); this.functionDependencies = ImmutableSet.copyOf(requireNonNull(functionDependencies, "functionDependencies is null")); checkArgument(functionNullability.getArgumentNullable().size() == signature.getArgumentTypes().size(), "signature and functionNullability must have same argument count");