From d287f56d12efd884cabb8a4b408881e66edb0858 Mon Sep 17 00:00:00 2001 From: "GUY.MOLINARI" Date: Wed, 12 Jun 2024 13:39:39 +0000 Subject: [PATCH] Added sourceOrdinal to load 'csv' like files (tpc-h data). --- core/mapper.go | 4 ++++ shared/table.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/core/mapper.go b/core/mapper.go index 562358e..ba9eb21 100644 --- a/core/mapper.go +++ b/core/mapper.go @@ -302,6 +302,7 @@ func ResolveMapper(attr *Attribute) (mapper Mapper, err error) { return nil, fmt.Errorf("MappingStrategy is nil for '%s'", attr.FieldName) } +/* if attr.MappingStrategy == "Delegated" && attr.DelegationTarget == "" { return nil, fmt.Errorf("DelegationTarget is nil for '%s'", attr.FieldName) } else if attr.MappingStrategy == "Delegated" && attr.DelegationTarget != "" { @@ -312,6 +313,7 @@ func ResolveMapper(attr *Attribute) (mapper Mapper, err error) { } return ResolveMapper(target) } +*/ if attr.MappingStrategy == "Custom" || attr.MappingStrategy == "CustomBSI" { if attr.MapperConfig != nil { @@ -329,9 +331,11 @@ func ResolveMapper(attr *Attribute) (mapper Mapper, err error) { func lookupMapper(mapperName string, conf map[string]string) (Mapper, error) { +/* if mapperName == "Undefined" || mapperName == "Delegated" { return nil, nil } +*/ mapperFactory, ok := mapperFactories[mapperName] if !ok { // Factory has not been registered. diff --git a/shared/table.go b/shared/table.go index 80a2ad3..cf56d8d 100644 --- a/shared/table.go +++ b/shared/table.go @@ -65,7 +65,7 @@ type BasicAttribute struct { IsTimeSeries bool `yaml:"isTimeSeries,omitempty"` TimeQuantumType string `yaml:"timeQuantumType,omitempty"` Exclusive bool `yaml:"exclusive,omitempty"` - DelegationTarget string `yaml:"delegationTarget,omitempty"` + SourceOrdinal int `yaml:"sourceOrdinal,omitempty"` } func (a *BasicAttribute) GetParent() TableInterface {