Skip to content

Commit

Permalink
Added sourceOrdinal to load 'csv' like files (tpc-h data).
Browse files Browse the repository at this point in the history
  • Loading branch information
gamolina committed Jun 12, 2024
1 parent 4d11b2d commit d287f56
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions core/mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 != "" {
Expand All @@ -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 {
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion shared/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit d287f56

Please sign in to comment.