Skip to content

Commit

Permalink
Cast pointer to byte instead of char
Browse files Browse the repository at this point in the history
  • Loading branch information
mdrakiburrahman committed Oct 8, 2024
1 parent cbe3a44 commit aa9e205
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/DeltaLake/Kernel/Arrow/Handlers/ArrowFFIInterOpHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/DeltaLake/Kernel/State/ParquetStringPartitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ internal struct ParquetStringPartitions
/// <summary>
/// The list of partition column names.
/// </summary>
public unsafe char** ColNames;
public unsafe byte** ColNames;

/// <summary>
/// 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.
/// </summary>
public unsafe char** ColValues;
public unsafe byte** ColValues;
}
}

0 comments on commit aa9e205

Please sign in to comment.