Revanth14 commented on code in PR #1213:
URL: https://github.com/apache/iceberg-go/pull/1213#discussion_r3439475237


##########
expression_json.go:
##########
@@ -0,0 +1,42 @@
+// 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 (e.g. AlwaysTrue/False
+// serialize as the bare JSON booleans `true`/`false`, not objects).
+
+package iceberg
+
+// MarshalExpressionJSON serializes a boolean expression to the JSON format
+// produced by Java's ExpressionParser, for use as a REST scan-planning filter.
+func MarshalExpressionJSON(expr BooleanExpression) ([]byte, error) {

Review Comment:
   Agreed. I made this explicit in the package doc comment.
   
   The contract is now: `MarshalExpressionJSON` emits Java `ExpressionParser` 
wire format, including bare booleans for `AlwaysTrue` / `AlwaysFalse`, and 
`UnmarshalExpressionJSON` must accept both the bare boolean form and the REST 
OpenAPI object form (`{"type":"true"}` / `{"type":"false"}`).
   
   This should give the Phase 1 golden fixtures a clear target.



-- 
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]

Reply via email to