parquet-dotnet
parquet-dotnet copied to clipboard
"The handle is invalid" exception when redirecting output to a file
Version: Parquet.Net v3.8.5
Runtime Version: .NET 5.0.301
OS: Windows 10 Pro Version 21H1 OS Build 19043.1083
Expected behavior
when I redirect the output of parq tool to a file, I expect the output of parq tool will be in the file. The syntax I use is like this:
parq convert path_to_my_parquet_file.parquet > test.json
Actual behavior
When I open test.json after the execution, I see
parq v3.8.5
reading file (10 rows min)...
The handle is invalid
Steps to reproduce the behavior
- Open Terminal
- Execute
parq convert path_to_my_parquet_file.parquet > test.json
(change with any parquet file) - Check content of test.json
Code snippet reproducing the behavior
I cloned the repository, and debugged to try to find the issue. I get that same exception. The stacktrace is:
at System.ConsolePal.SetCursorPosition(Int32 left, Int32 top)
at System.Console.SetCursorPosition(Int32 left, Int32 top)
at Cpf.Widgets.ProgressMessage.Dispose()
at Parquet.CLI.Commands.FileInputCommand.ReadTable(Int32 maxRows) in C:\Thirdparty\parquet-dotnet\src\Parquet.CLI\Commands\FileInputCommand.cs:line 36
at Parquet.CLI.Commands.ConvertCommand.ConvertFromParquet(Int32 maxRows) in C:\Thirdparty\parquet-dotnet\src\Parquet.CLI\Commands\ConvertCommand.cs:line 48
at Parquet.CLI.Commands.ConvertCommand.Execute(Int32 maxRows) in C:\Thirdparty\parquet-dotnet\src\Parquet.CLI\Commands\ConvertCommand.cs:line 36
at Parquet.CLI.Program.<>c__DisplayClass0_3.<Main>b__9() in C:\Thirdparty\parquet-dotnet\src\Parquet.CLI\Program.cs:line 86
at Cpf.App.Command.Execute(ConsoleArguments arguments, Action`1 onBeforeExecuteCommand)
So it looks like it's trying to set the cursor position, which of course isn't possible in a file
This isn't the official Parquet.NET repo. See https://github.com/aloneguid/parquet-dotnet