marcin-krystianc opened a new issue, #47009:
URL: https://github.com/apache/arrow/issues/47009

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   Writing a large parquet file (many rows and columns, large row group size) 
can result in an exception being thrown:
   ```
   Unhandled exception. System.ArgumentOutOfRangeException: bytesAllocated 
('-1786966136') must be a non-negative and non-zero value. (Parameter 
'bytesAllocated')
   Actual value was -1786966136.
      at System.ArgumentOutOfRangeException.ThrowNegativeOrZero[T](T value, 
String paramName)
      at System.ArgumentOutOfRangeException.ThrowIfNegativeOrZero[T](T value, 
String paramName)
      at System.GC.RemoveMemoryPressure(Int64 bytesAllocated)
      at Apache.Arrow.Memory.ExportedAllocationOwner.Dispose()
      at Apache.Arrow.C.CArrowArrayExporter.Dispose(Void** ptr)
      at Apache.Arrow.C.CArrowArrayExporter.ReleaseArray(CArrowArray* cArray)
      at ParquetSharp.Arrow.FileWriter.FileWriter_WriteTable(IntPtr writer, 
CArrowArrayStream* stream, Int64 chunkSize)
      at GenerateData.Program.WriteDataFile(String filePath, Int32 rowsPerFile, 
Int32 chunkSize, Random random, Int64& counter) in 
D:\workspace\ParquetSharp.Dataset\GenerateData\Program.cs:line 70
      at GenerateData.Program.Main(String[] args) in 
D:\workspace\ParquetSharp.Dataset\GenerateData\Program.cs:line 26
     `````
   Most likely the problem is caused by integer overflow here -> 
https://github.com/apache/arrow/blob/3ebe7ee1828793d0a619bcd773eb4d990ccb6b3c/csharp/src/Apache.Arrow/Memory/ExportedAllocationOwner.cs#L27C17-L27C21
   
   
   ### Component(s)
   
   C#


-- 
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...@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to