pvary commented on code in PR #8553: URL: https://github.com/apache/iceberg/pull/8553#discussion_r1339720066
########## flink/v1.17/flink/src/main/java/org/apache/iceberg/flink/source/reader/IcebergWatermarkExtractor.java: ########## @@ -0,0 +1,28 @@ +/* + * 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 java.io.Serializable; +import org.apache.iceberg.flink.source.split.IcebergSourceSplit; + +/** The interface used to extract watermarks from splits. */ +public interface IcebergWatermarkExtractor<T> extends Serializable { Review Comment: > we probably can use the `TimestampAssigner<T>` interface here too. `T` could be `IcebergSourceSplit`. Technically we could use the `TimestampAssigner`, but I think it would be confusing. Having a specific interface seems better for me, but if you feel strongly about this, we can do that. > We can add an implementation of `IcebergSourceSplitTimestampAssigner(String fieldName, TimeUnit unit)`. I am also thinking it can be non-public. Maybe `IcebergSource$Builder` just exposes `timestampField(String fieldName, TimeUnit unit)`? Are we sure that this is the only watermark extractor user would like to use? Seems too specific to me. What if the timestamp is stored in a `long` for whatever reason? Also this specific implementation requires us to have statistics which we should turn on for the source. I hope, that in the future we might be able to fetch only statistics for a specific column - with further complicates this. So as a first approach, I would suggest to stick to the `IcebergWatermarkExtractor` approach, and we might reconsider adding streamlined interfaces when we see the actual usage of the API. WDYT? -- 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]
