From aa9e205e60c039780ddc5073d85cd714acdc3728 Mon Sep 17 00:00:00 2001 From: Raki <46581776+mdrakiburrahman@users.noreply.github.com> Date: Mon, 7 Oct 2024 23:50:56 -0400 Subject: [PATCH] Cast pointer to byte instead of char --- .../Kernel/Arrow/Handlers/ArrowFFIInterOpHandler.cs | 8 ++++---- src/DeltaLake/Kernel/State/ParquetStringPartitions.cs | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/DeltaLake/Kernel/Arrow/Handlers/ArrowFFIInterOpHandler.cs b/src/DeltaLake/Kernel/Arrow/Handlers/ArrowFFIInterOpHandler.cs index b3dabdd..0fc75c1 100644 --- a/src/DeltaLake/Kernel/Arrow/Handlers/ArrowFFIInterOpHandler.cs +++ b/src/DeltaLake/Kernel/Arrow/Handlers/ArrowFFIInterOpHandler.cs @@ -180,13 +180,13 @@ private static unsafe ParquetStringPartitions ParseParquetStringPartitions( } } - char** colNamesPtr = (char**)Marshal.AllocHGlobal(colNames.Count * sizeof(char*)); - char** colValuesPtr = (char**)Marshal.AllocHGlobal(colValues.Count * sizeof(char*)); + byte** colNamesPtr = (byte**)Marshal.AllocHGlobal(colNames.Count * sizeof(byte*)); + byte** colValuesPtr = (byte**)Marshal.AllocHGlobal(colValues.Count * sizeof(byte*)); for (int i = 0; i < colNames.Count; i++) { - colNamesPtr[i] = (char*)Marshal.StringToHGlobalAnsi(colNames[i]); - colValuesPtr[i] = (char*)Marshal.StringToHGlobalAnsi(colValues[i]); + colNamesPtr[i] = (byte*)Marshal.StringToHGlobalAnsi(colNames[i]); + colValuesPtr[i] = (byte*)Marshal.StringToHGlobalAnsi(colValues[i]); } return new ParquetStringPartitions diff --git a/src/DeltaLake/Kernel/State/ParquetStringPartitions.cs b/src/DeltaLake/Kernel/State/ParquetStringPartitions.cs index 8820e04..1ed3a95 100644 --- a/src/DeltaLake/Kernel/State/ParquetStringPartitions.cs +++ b/src/DeltaLake/Kernel/State/ParquetStringPartitions.cs @@ -24,12 +24,12 @@ internal struct ParquetStringPartitions /// /// The list of partition column names. /// - public unsafe char** ColNames; + public unsafe byte** ColNames; /// /// The list of partition column values, all strings, even if they are /// numbers - as they are stored as strings in the parquet the Kernel reads back. /// - public unsafe char** ColValues; + public unsafe byte** ColValues; } }