// CastElement returns an Element type for the passed DataType and value v.
CastElement returns an Element type for the passed DataType and value v.
// CastElement returns an Element type for the passed DataType and value v .
func CastElement(dtype arrow.DataType, v interface{}) Element {
	switch dtype.(type) {
	case *arrow.Uint8Type:
		return NewUint8Element(v)
	case *arrow.Int8Type:
		return NewInt8Element(v)
	case *arrow.Uint16Type:
		return NewUint16Element(v)
	case *arrow.Int16Type:
		return NewInt16Element(v)
	case *arrow.Uint32Type:
		return NewUint32Element(v)
	case *arrow.Int32Type:
		return NewInt32Element(v)
	case *arrow.Uint64Type:
		return NewUint64Element(v)
	case *arrow.Int64Type:
		return NewInt64Element(v)
	case *arrow.Float32Type:
		return NewFloat32Element(v)
	case *arrow.Float64Type:
		return NewFloat64Element(v)
	case *arrow.Date32Type:
		return NewDate32Element(v)
	case *arrow.Date64Type:
		return NewDate64Element(v)
	}
	panic(fmt.Errorf("bullseye/element: unsupported element for %T", dtype))
}
func CastElement ( dtype arrow . DataType , v interface { } ) Element { switch dtype . ( type ) { case * arrow . Uint8Type : return NewUint8Element ( v ) case * arrow . Int8Type : return NewInt8Element ( v ) case * arrow . Uint16Type : return NewUint16Element ( v ) case * arrow . Int16Type : return NewInt16Element ( v ) case * arrow . Uint32Type : return NewUint32Element ( v ) case * arrow . Int32Type : return NewInt32Element ( v ) case * arrow . Uint64Type : return NewUint64Element ( v ) case * arrow . Int64Type : return NewInt64Element ( v ) case * arrow . Float32Type : return NewFloat32Element ( v ) case * arrow . Float64Type : return NewFloat64Element ( v ) case * arrow . Date32Type : return NewDate32Element ( v ) case * arrow . Date64Type : return NewDate64Element ( v ) } panic ( fmt . Errorf ( " " , dtype ) ) }
CastElement returns an Element type for the passed DataType and value v.
CastElement returns an Element type for the passed DataType and value v .
// case *arrow.NullType: // TODO: implement // case *arrow.BooleanType: // TODO: implement // case arrow.HALF_FLOAT: // TODO: implement? // case *arrow.StringType: // TODO: implement