CurtHagenlocher commented on code in PR #1816:
URL: https://github.com/apache/arrow-adbc/pull/1816#discussion_r1589750408


##########
csharp/test/Apache.Arrow.Adbc.Tests/ImportedDuckDbTests.cs:
##########
@@ -162,9 +162,45 @@ public void SetIsolationLevelFails()
             });
         }
 
+        [Fact]
+        public void IngestData()
+        {
+            using var database = _duckDb.OpenDatabase("ingest.db");
+            using var connection = database.Connect(null);
+            using var statement = connection.CreateStatement();
+            statement.SetOption("adbc.ingest.target_table", "ingested");
+            statement.SetOption("adbc.ingest.mode", "adbc.ingest.mode.create");
+
+            Schema schema = new Schema([new Field("key", Int32Type.Default, 
false), new Field("value", StringType.Default, false)], null);
+            RecordBatch recordBatch = new RecordBatch(schema, [
+                new Int32Array.Builder().AppendRange([1, 2, 3]).Build(),
+                new StringArray.Builder().AppendRange(["foo", "bar", 
"baz"]).Build()
+                ], 3);
+            statement.Bind(recordBatch, schema);
+            statement.ExecuteUpdate();
+
+            Schema foundSchema = connection.GetTableSchema(null, null, 
"ingested");
+            Assert.Equal(schema.FieldsList.Count, 
foundSchema.FieldsList.Count);
+
+            Assert.Equal(3, GetResultCount(statement, "SELECT * from 
ingested"));
+
+            using var statement2 = connection.BulkIngest("ingestion", 
BulkIngestMode.Append);
+
+            recordBatch = new RecordBatch(schema, [
+                new Int32Array.Builder().AppendRange([4, 5]).Build(),
+                new StringArray.Builder().AppendRange(["quux", 
"zozzle"]).Build()
+                ], 2);
+            statement2.Bind(recordBatch, schema);
+            statement2.ExecuteUpdate();
+
+            // Seems to be a bug in DuckDB?

Review Comment:
   I will investigate this independently. It doesn't look like the test they 
have for this functionality only verifies that no error is produced; not that 
it works correctly.



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

Reply via email to