rdblue commented on code in PR #4525: URL: https://github.com/apache/iceberg/pull/4525#discussion_r846841623
########## api/src/test/java/org/apache/iceberg/types/TestTypeDefaultValuesValidation.java: ########## @@ -0,0 +1,89 @@ +/* + * 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. + */ + + +package org.apache.iceberg.types; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Arrays; +import java.util.Collection; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; + +import static org.apache.iceberg.types.Types.NestedField.of; +import static org.apache.iceberg.types.Types.NestedField.optional; +import static org.apache.iceberg.types.Types.NestedField.required; + +@RunWith(Parameterized.class) +public class TestTypeDefaultValuesValidation { + private final Type type; + private final JsonNode defaultValue; + + public TestTypeDefaultValuesValidation(Type type, JsonNode defaultValue) { + this.type = type; + this.defaultValue = defaultValue; + } + + @Parameterized.Parameters + public static Collection<Object[]> data() { + return Arrays.asList(new Object[][] { + {Types.BooleanType.get(), parseJsonStringToJsonNode("true")}, + {Types.IntegerType.get(), parseJsonStringToJsonNode("1")}, + {Types.LongType.get(), parseJsonStringToJsonNode("9999999")}, + {Types.FloatType.get(), parseJsonStringToJsonNode("1.23")}, + {Types.DoubleType.get(), parseJsonStringToJsonNode("123.456")}, + {Types.DateType.get(), parseJsonStringToJsonNode("3650")}, + {Types.TimeType.get(), parseJsonStringToJsonNode("36000000000")}, + {Types.TimestampType.withoutZone(), parseJsonStringToJsonNode("1649374911000000")}, Review Comment: Looking at this again, I think that date/time fields should be converted to (strict) ISO-8601 representations. That way they are readable in JSON. -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org