talatuyarer commented on code in PR #14245: URL: https://github.com/apache/iceberg/pull/14245#discussion_r2409136987
########## flink/v2.0/flink/src/test/java/org/apache/iceberg/flink/source/reader/TestColumnStatsWatermarkExtractorEndToEnd.java: ########## @@ -0,0 +1,202 @@ +/* + * 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.flink.source.reader; + +import static org.apache.iceberg.types.Types.NestedField.required; +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.IOException; +import java.nio.file.Path; +import java.util.List; +import java.util.concurrent.TimeUnit; +import org.apache.flink.table.types.logical.RowType; +import org.apache.flink.types.Row; +import org.apache.iceberg.FileFormat; +import org.apache.iceberg.Parameter; +import org.apache.iceberg.ParameterizedTestExtension; +import org.apache.iceberg.Parameters; +import org.apache.iceberg.Schema; +import org.apache.iceberg.Table; +import org.apache.iceberg.data.GenericAppenderHelper; +import org.apache.iceberg.data.RandomGenericData; +import org.apache.iceberg.data.Record; +import org.apache.iceberg.flink.FlinkSchemaUtil; +import org.apache.iceberg.flink.HadoopTableExtension; +import org.apache.iceberg.flink.TestHelpers; +import org.apache.iceberg.flink.source.FlinkInputFormat; +import org.apache.iceberg.flink.source.FlinkSource; +import org.apache.iceberg.types.Types; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestTemplate; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.api.extension.RegisterExtension; +import org.junit.jupiter.api.io.TempDir; + +/** + * End-to-end tests for ColumnStatsWatermarkExtractor with nanosecond precision timestamps. This + * test validates that watermark extraction works correctly with actual data files containing + * nanosecond precision timestamps. + */ +@ExtendWith(ParameterizedTestExtension.class) +public class TestColumnStatsWatermarkExtractorEndToEnd { + + @Parameter(index = 0) + private FileFormat format; + + @Parameters(name = "format = {0}") + public static Object[][] parameters() { + return new Object[][] {{FileFormat.PARQUET}, {FileFormat.AVRO}}; + } + + private static final String DATABASE = "test_db"; + private static final String TABLE = "test_watermark_table"; + + // Schema with nanosecond precision timestamps for watermark testing + private static final Schema NANOSECOND_WATERMARK_SCHEMA = + new Schema( + required(1, "id", Types.LongType.get()), + required(2, "event_time_ns", Types.TimestampNanoType.withoutZone()), + required(3, "event_time_ns_tz", Types.TimestampNanoType.withZone()), + required(4, "event_time_us", Types.TimestampType.withoutZone()), Review Comment: this means µs microsecond symbol. I changed with actual name :) -- 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]
