Revanth14 commented on code in PR #1213: URL: https://github.com/apache/iceberg-go/pull/1213#discussion_r3471282672
########## expression_json.go: ########## @@ -0,0 +1,51 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// This file is a PROPOSED public API surface for REST scan-planning +// expression JSON (apache/iceberg-go#1178). The bodies are intentionally +// unimplemented; the file exists so the API shape can be reviewed. +// +// The codec lives in the root iceberg package because expression internals +// are defined here and are not exported. Compatibility with Java's +// ExpressionParser is correctness-critical and every encoding must be +// confirmed against checked-in Java golden fixtures. +// +// Design decision: MarshalExpressionJSON emits Java ExpressionParser wire +// format, including bare JSON booleans for AlwaysTrue/AlwaysFalse (`true` and +// `false`). The Java REST reference uses the same parser for planTableScan +// request filters, even though the REST OpenAPI Expression schema also models +// true/false as objects (`{"type":"true"}` and `{"type":"false"}`). Review Comment: Addressed, with one spec clarification since this is load-bearing. The actionable part is in: `UnmarshalExpressionJSON` now documents accepting bare booleans plus the Java typed-literal form (`{"type":"literal","value":...}`), which is the round-trip-critical form. `MarshalExpressionJSON` still emits bare booleans for Java/reference compatibility. On `{"type":"true"}` / `{"type":"false"}`: those are in the REST OpenAPI Expression schema as `TrueExpression` / `FalseExpression`, but Java's `ExpressionParser` does not implement that object form. So the doc now treats them as a defensive unmarshal-only compatibility path for strict-spec servers, not as the Java/reference encoding. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
