openinx commented on a change in pull request #1893:
URL: https://github.com/apache/iceberg/pull/1893#discussion_r553158808



##########
File path: flink/src/test/java/org/apache/iceberg/flink/TestFlinkFilters.java
##########
@@ -0,0 +1,306 @@
+/*
+ * 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;
+
+import java.math.BigDecimal;
+import java.time.Instant;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.util.List;
+import java.util.Optional;
+import java.util.stream.Collectors;
+import org.apache.flink.table.api.DataTypes;
+import org.apache.flink.table.api.Expressions;
+import org.apache.flink.table.api.TableColumn;
+import org.apache.flink.table.api.TableSchema;
+import org.apache.flink.table.expressions.ApiExpressionUtils;
+import org.apache.flink.table.expressions.CallExpression;
+import org.apache.flink.table.expressions.Expression;
+import org.apache.flink.table.expressions.FieldReferenceExpression;
+import org.apache.flink.table.expressions.UnresolvedCallExpression;
+import org.apache.flink.table.expressions.UnresolvedReferenceExpression;
+import org.apache.flink.table.expressions.ValueLiteralExpression;
+import org.apache.flink.table.expressions.utils.ApiExpressionDefaultVisitor;
+import org.apache.flink.table.functions.BuiltInFunctionDefinitions;
+import org.apache.iceberg.expressions.And;
+import org.apache.iceberg.expressions.Not;
+import org.apache.iceberg.expressions.Or;
+import org.apache.iceberg.expressions.UnboundPredicate;
+import org.apache.iceberg.util.DateTimeUtil;
+import org.junit.Assert;
+import org.junit.Test;
+
+import static org.apache.flink.table.api.Expressions.$;
+import static org.apache.flink.table.api.Expressions.lit;
+import static org.junit.Assert.assertEquals;
+
+public class TestFlinkFilters {
+
+  private static final TableSchema TABLE_SCHEMA = TableSchema.builder()
+      .field("field1", DataTypes.INT())
+      .field("field2", DataTypes.BIGINT())
+      .field("field3", DataTypes.FLOAT())
+      .field("field4", DataTypes.DOUBLE())
+      .field("field5", DataTypes.STRING())
+      .field("field6", DataTypes.BOOLEAN())
+      .field("field7", DataTypes.BINARY(10))
+      .field("field8", DataTypes.DECIMAL(10, 2))
+      .field("field9", DataTypes.DATE())
+      .field("field10", DataTypes.TIME())
+      .field("field11", DataTypes.TIMESTAMP())
+      .field("field12", DataTypes.TIMESTAMP_WITH_TIME_ZONE())
+      .field("field13", DataTypes.TIMESTAMP_WITH_LOCAL_TIME_ZONE())
+      .build();
+
+  @Test
+  public void testFlinkDataTypeEqual() {
+    matchLiteral("field1", 1, 1);

Review comment:
       In this `matchLiteral` testing method,  we will provide both flink's 
java data type and iceberg's java data type ( for asserting).   I think it's 
not a good way to test those literals because if people don't quite understand 
what's the specific java data type that iceberg type is mapping,   then he may 
provide the wrong iceberg's java type to assert.  The `BINARY` type is an 
example. 
   




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

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