nastra commented on code in PR #7866:
URL: https://github.com/apache/iceberg/pull/7866#discussion_r1236774339


##########
flink/v1.17/flink/src/test/java/org/apache/iceberg/flink/TestFlinkAnonymousTable.java:
##########
@@ -0,0 +1,55 @@
+/*
+ * 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.io.File;
+import java.io.IOException;
+import org.apache.flink.table.api.DataTypes;
+import org.apache.flink.table.api.Schema;
+import org.apache.flink.table.api.Table;
+import org.apache.flink.table.api.TableDescriptor;
+import org.apache.flink.table.api.TableEnvironment;
+import org.junit.Test;
+
+public class TestFlinkAnonymousTable extends FlinkTestBase {
+
+  @Test
+  public void testWriteAnonymousTable() throws IOException {
+    File warehouseDir = TEMPORARY_FOLDER.newFolder();
+    TableEnvironment tEnv = getTableEnv();
+    Table table =
+        tEnv.from(
+            TableDescriptor.forConnector("datagen")
+                .schema(Schema.newBuilder().column("f0", 
DataTypes.STRING()).build())
+                .option("number-of-rows", "3")
+                .build());
+
+    TableDescriptor descriptor =
+        TableDescriptor.forConnector("iceberg")
+            .schema(Schema.newBuilder().column("f0", 
DataTypes.STRING()).build())
+            .option("catalog-name", "hadoop_test")
+            .option("catalog-type", "hadoop")
+            .option("catalog-database", "test_db")
+            .option("catalog-table", "test")
+            .option("warehouse", warehouseDir.getAbsolutePath())
+            .build();
+
+    table.insertInto(descriptor).execute();

Review Comment:
   Right now this test doesn't have any particular assertion other than just 
executing code that was previously failing.
   I see that this isn't failing anymore with your fix, but it's generally good 
practice to add some assertions here that make sure the write you expect 
succeeded (independently from whether an exception has been thrown or not).
   



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

Reply via email to