|
| 1 | +// SPDX-License-Identifier: Apache-2.0 |
| 2 | +// SPDX-FileCopyrightText: Copyright the Vortex contributors |
| 3 | + |
| 4 | +use std::hash::Hasher; |
| 5 | + |
| 6 | +use vortex::array::ArrayRef; |
| 7 | +use vortex::array::EmptyMetadata; |
| 8 | +use vortex::array::ExecutionCtx; |
| 9 | +use vortex::array::ExecutionStep; |
| 10 | +use vortex::array::Precision; |
| 11 | +use vortex::array::buffer::BufferHandle; |
| 12 | +use vortex::array::serde::ArrayChildren; |
| 13 | +use vortex::array::stats::StatsSetRef; |
| 14 | +use vortex::array::vtable; |
| 15 | +use vortex::array::vtable::ArrayId; |
| 16 | +use vortex::array::vtable::VTable; |
| 17 | +use vortex::array::vtable::ValidityVTableFromChild; |
| 18 | +use vortex::dtype::DType; |
| 19 | +use vortex::error::VortexResult; |
| 20 | +use vortex::session::VortexSession; |
| 21 | + |
| 22 | +use crate::encodings::norm::array::NormVectorArray; |
| 23 | + |
| 24 | +mod operations; |
| 25 | +mod validity; |
| 26 | + |
| 27 | +vtable!(NormVector); |
| 28 | + |
| 29 | +#[derive(Debug)] |
| 30 | +pub struct NormVector; |
| 31 | + |
| 32 | +impl VTable for NormVector { |
| 33 | + type Array = NormVectorArray; |
| 34 | + type Metadata = EmptyMetadata; |
| 35 | + type OperationsVTable = Self; |
| 36 | + type ValidityVTable = ValidityVTableFromChild; |
| 37 | + |
| 38 | + fn id(_array: &NormVectorArray) -> ArrayId { |
| 39 | + ArrayId::new_ref("vortex.tensor.norm_vector") |
| 40 | + } |
| 41 | + |
| 42 | + fn len(array: &NormVectorArray) -> usize { |
| 43 | + array.vector_array().len() |
| 44 | + } |
| 45 | + |
| 46 | + fn dtype(array: &NormVectorArray) -> &DType { |
| 47 | + array.vector_array().dtype() |
| 48 | + } |
| 49 | + |
| 50 | + fn stats(array: &NormVectorArray) -> StatsSetRef<'_> { |
| 51 | + array.vector_array().statistics() |
| 52 | + } |
| 53 | + |
| 54 | + fn array_hash<H: Hasher>(array: &NormVectorArray, state: &mut H, precision: Precision) { |
| 55 | + todo!() |
| 56 | + } |
| 57 | + |
| 58 | + fn array_eq(array: &NormVectorArray, other: &NormVectorArray, precision: Precision) -> bool { |
| 59 | + todo!() |
| 60 | + } |
| 61 | + |
| 62 | + fn nbuffers(array: &NormVectorArray) -> usize { |
| 63 | + todo!() |
| 64 | + } |
| 65 | + |
| 66 | + fn buffer(array: &NormVectorArray, idx: usize) -> BufferHandle { |
| 67 | + todo!() |
| 68 | + } |
| 69 | + |
| 70 | + fn buffer_name(array: &NormVectorArray, idx: usize) -> Option<String> { |
| 71 | + todo!() |
| 72 | + } |
| 73 | + |
| 74 | + fn nchildren(array: &NormVectorArray) -> usize { |
| 75 | + todo!() |
| 76 | + } |
| 77 | + |
| 78 | + fn child(array: &NormVectorArray, idx: usize) -> ArrayRef { |
| 79 | + todo!() |
| 80 | + } |
| 81 | + |
| 82 | + fn child_name(array: &NormVectorArray, idx: usize) -> String { |
| 83 | + todo!() |
| 84 | + } |
| 85 | + |
| 86 | + fn metadata(array: &NormVectorArray) -> VortexResult<Self::Metadata> { |
| 87 | + todo!() |
| 88 | + } |
| 89 | + |
| 90 | + fn serialize(metadata: Self::Metadata) -> VortexResult<Option<Vec<u8>>> { |
| 91 | + todo!() |
| 92 | + } |
| 93 | + |
| 94 | + fn deserialize( |
| 95 | + bytes: &[u8], |
| 96 | + _dtype: &DType, |
| 97 | + _len: usize, |
| 98 | + _buffers: &[BufferHandle], |
| 99 | + _session: &VortexSession, |
| 100 | + ) -> VortexResult<Self::Metadata> { |
| 101 | + todo!() |
| 102 | + } |
| 103 | + |
| 104 | + fn build( |
| 105 | + dtype: &DType, |
| 106 | + len: usize, |
| 107 | + metadata: &Self::Metadata, |
| 108 | + buffers: &[BufferHandle], |
| 109 | + children: &dyn ArrayChildren, |
| 110 | + ) -> VortexResult<NormVectorArray> { |
| 111 | + todo!() |
| 112 | + } |
| 113 | + |
| 114 | + fn with_children(array: &mut NormVectorArray, children: Vec<ArrayRef>) -> VortexResult<()> { |
| 115 | + todo!() |
| 116 | + } |
| 117 | + |
| 118 | + fn execute(array: &NormVectorArray, ctx: &mut ExecutionCtx) -> VortexResult<ExecutionStep> { |
| 119 | + todo!() |
| 120 | + } |
| 121 | +} |
0 commit comments