@@ -7,8 +7,13 @@ namespace ParquetSharp.Schema
77{
88 public sealed class GroupNode : Node
99 {
10- public GroupNode ( string name , Repetition repetition , IReadOnlyList < Node > fields , LogicalType ? logicalType = null )
11- : this ( Make ( name , repetition , fields , logicalType ) )
10+ public GroupNode ( string name , Repetition repetition , IReadOnlyList < Node > fields , LogicalType ? logicalType )
11+ : this ( Make ( name , repetition , fields , logicalType , - 1 ) )
12+ {
13+ }
14+
15+ public GroupNode ( string name , Repetition repetition , IReadOnlyList < Node > fields , LogicalType ? logicalType = null , int fieldId = - 1 )
16+ : this ( Make ( name , repetition , fields , logicalType , fieldId ) )
1217 {
1318 }
1419
@@ -46,7 +51,8 @@ public override Node DeepClone()
4651 Name ,
4752 Repetition ,
4853 clonedFields ,
49- logicalType is NoneLogicalType ? null : logicalType ) ;
54+ logicalType is NoneLogicalType ? null : logicalType ,
55+ FieldId ) ;
5056 }
5157 finally
5258 {
@@ -57,13 +63,13 @@ public override Node DeepClone()
5763 }
5864 }
5965
60- private static unsafe IntPtr Make ( string name , Repetition repetition , IReadOnlyList < Node > fields , LogicalType ? logicalType )
66+ private static unsafe IntPtr Make ( string name , Repetition repetition , IReadOnlyList < Node > fields , LogicalType ? logicalType , int fieldId )
6167 {
6268 var handles = fields . Select ( f => f . Handle . IntPtr ) . ToArray ( ) ;
6369
6470 fixed ( IntPtr * pHandles = handles )
6571 {
66- ExceptionInfo . Check ( GroupNode_Make ( name , repetition , ( IntPtr ) pHandles , handles . Length , logicalType ? . Handle . IntPtr ?? IntPtr . Zero , out var groupNode ) ) ;
72+ ExceptionInfo . Check ( GroupNode_Make ( name , repetition , ( IntPtr ) pHandles , handles . Length , logicalType ? . Handle . IntPtr ?? IntPtr . Zero , fieldId , out var groupNode ) ) ;
6773 GC . KeepAlive ( fields ) ;
6874 GC . KeepAlive ( logicalType ) ;
6975 return groupNode ;
@@ -72,7 +78,7 @@ private static unsafe IntPtr Make(string name, Repetition repetition, IReadOnlyL
7278
7379 [ DllImport ( ParquetDll . Name ) ]
7480 private static extern IntPtr GroupNode_Make (
75- [ MarshalAs ( UnmanagedType . LPUTF8Str ) ] string name , Repetition repetition , IntPtr fields , int numFields , IntPtr logicalType , out IntPtr groupNode ) ;
81+ [ MarshalAs ( UnmanagedType . LPUTF8Str ) ] string name , Repetition repetition , IntPtr fields , int numFields , IntPtr logicalType , int fieldId , out IntPtr groupNode ) ;
7682
7783 [ DllImport ( ParquetDll . Name ) ]
7884 private static extern IntPtr GroupNode_Field ( IntPtr groupNode , int i , out IntPtr field ) ;
0 commit comments