Giorgi / DuckDB.NET

Bindings and ADO.NET Provider for DuckDB
https://duckdb.net
MIT License
356 stars 62 forks source link

Parquet write fails with DuckDB.dll 0.2.8 #13

Closed mmauri closed 2 years ago

mmauri commented 2 years ago

Thanks for fixing the previous issue so quick. I have tried to write a parquet file and it throws this error: Catalog Error: Copy Function with name parquet does not exist! Did you mean "csv"?

It works on the CLI duckdb.exe, I haven't found any doc stating that the C++ API does not support Parquet, so I don't know if the issue is about your bindings or the Dll API itself.

using var conn = new DuckDBConnection("Data Source=:memory:");
try
{
    conn.Open();
    var command = conn.CreateCommand();

    command.CommandText = "CREATE TABLE integers(foo INTEGER, bar INTEGER);";
    var executeNonQuery = command.ExecuteNonQuery();

    command.CommandText = "INSERT INTO integers VALUES (3, 4), (5, 6), (7, 8);";
    executeNonQuery = command.ExecuteNonQuery();

    command.CommandText = "SELECT foo, bar FROM integers";
    var reader = command.ExecuteReader();

    command.CommandText = "COPY (SELECT * FROM integers) TO 'result-snappy.parquet' (FORMAT 'parquet');";
    executeNonQuery = command.ExecuteNonQuery();
}
catch (Exception ex)
{
    Console.WriteLine(ex.Message);
}

Thanks for your effort bringing DuckDB to .NET!

Giorgi commented 2 years ago

I think it is the same issue as Copy table to parquet does not work in Node.js environment

As stated there:

Yes, we are currently not shipping the Parquet extension with the node client. We probably should do that.

See also: How to build a static library with extensions

mmauri commented 2 years ago

Thanks, Let's hope that they include the extensions on the C++ API, as they do in the Python/R packages.

SartorialOffense commented 2 years ago

So they were kind enough to add it in by default:

https://github.com/duckdb/duckdb/pull/2563

I pulled out the new DLL and tested it with a Parquet file in your sample application.

Giorgi commented 2 years ago

Did it work?

SartorialOffense commented 2 years ago

Yup!

On Tue, Nov 9, 2021 at 4:02 PM Giorgi Dalakishvili @.***> wrote:

Did it work?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Giorgi/DuckDB.NET/issues/13#issuecomment-964586254, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC2Z5OSJ7MQXGN7SJT64PO3ULGK5ZANCNFSM5DNE4LLQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

mmauri commented 2 years ago

Great news!! Thanks Sartorial, for your help on the duckdb repo!

SartorialOffense commented 2 years ago

Happy to help! I need it for a project I am working on right now.

On Sun, Nov 14, 2021 at 1:43 PM Marc Mauri @.***> wrote:

Great news!! Thanks Sartorial, for your help on the duckdb repo!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Giorgi/DuckDB.NET/issues/13#issuecomment-968351746, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC2Z5OSTZIXXVZ77H62HE7LUMAGOXANCNFSM5DNE4LLQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.