@@ -83,8 +83,10 @@ type MetadataFieldOptions struct {
8383}
8484
8585type MetadataSchemaOptions struct {
86- TableName string
87- TableDescription string
86+ TableName string
87+ TableDescription string
88+ TableIsIncremental bool
89+ TablePKConstraint string
8890}
8991
9092func NewSchemaMetadataFromOptions (opts MetadataSchemaOptions ) arrow.Metadata {
@@ -95,6 +97,12 @@ func NewSchemaMetadataFromOptions(opts MetadataSchemaOptions) arrow.Metadata {
9597 if opts .TableDescription != "" {
9698 kv [MetadataTableDescription ] = opts .TableDescription
9799 }
100+ if opts .TableIsIncremental {
101+ kv [MetadataIncremental ] = MetadataTrue
102+ }
103+ if opts .TablePKConstraint != "" {
104+ kv [MetadataConstraintName ] = opts .TablePKConstraint
105+ }
98106 return arrow .MetadataFrom (kv )
99107}
100108
@@ -295,8 +303,10 @@ func CQSchemaToArrow(table *Table) *arrow.Schema {
295303 fields = append (fields , CQColumnToArrowField (& col ))
296304 }
297305 opts := MetadataSchemaOptions {
298- TableName : table .Name ,
299- TableDescription : table .Description ,
306+ TableName : table .Name ,
307+ TableDescription : table .Description ,
308+ TableIsIncremental : table .IsIncremental ,
309+ TablePKConstraint : table .PkConstraintName ,
300310 }
301311 metadata := NewSchemaMetadataFromOptions (opts )
302312 return arrow .NewSchema (fields , & metadata )
0 commit comments