(value Column, positionCount int32)
| 655 | } |
| 656 | |
| 657 | func NewRunLengthEncodedColumn(value Column, positionCount int32) (*RunLengthEncodedColumn, error) { |
| 658 | if value == nil { |
| 659 | return nil, fmt.Errorf("value is null") |
| 660 | } |
| 661 | if value.GetPositionCount() != 1 { |
| 662 | return nil, fmt.Errorf("expected value to contain a single position but has %v positions", value.GetPositionCount()) |
| 663 | } |
| 664 | if positionCount < 0 { |
| 665 | return nil, fmt.Errorf("positionCount is negative") |
| 666 | } |
| 667 | column := new(RunLengthEncodedColumn) |
| 668 | switch (value).(type) { |
| 669 | case *RunLengthEncodedColumn: |
| 670 | column.value = (value.(*RunLengthEncodedColumn)).GetValue() |
| 671 | default: |
| 672 | column.value = value |
| 673 | } |
| 674 | column.positionCount = positionCount |
| 675 | return column, nil |
| 676 | } |
| 677 | |
| 678 | func (c *RunLengthEncodedColumn) GetValue() Column { |
| 679 | return c.value |
no test coverage detected
searching dependent graphs…