diff --git a/locustdb-derive/src/reify_types.rs b/locustdb-derive/src/reify_types.rs index c7a68934..9b6292a0 100644 --- a/locustdb-derive/src/reify_types.rs +++ b/locustdb-derive/src/reify_types.rs @@ -202,6 +202,7 @@ fn types(t: &Ident) -> Option> { "IntegerNoU64" => Some(vec![Type::U8, Type::U16, Type::U32, Type::I64]), "NumberNoU64" => Some(vec![Type::U8, Type::U16, Type::U32, Type::I64, Type::F64]), "Integer" => Some(vec![Type::U8, Type::U16, Type::U32, Type::U64, Type::I64]), + "Number" => Some(vec![Type::U8, Type::U16, Type::U32, Type::U64, Type::I64, Type::F64]), "Float" => Some(vec![Type::F64]), "NullableInteger" => Some(vec![Type::NullableU8, Type::NullableU16, Type::NullableU32, Type::NullableI64]), "NullableFloat" => Some(vec![Type::NullableF64]), diff --git a/src/engine/operators/assemble_nullable.rs b/src/engine/operators/assemble_nullable.rs index 00669baa..9382c804 100644 --- a/src/engine/operators/assemble_nullable.rs +++ b/src/engine/operators/assemble_nullable.rs @@ -17,8 +17,9 @@ impl<'a, T: VecData> VecOperator<'a> for AssembleNullable { fn inputs(&self) -> Vec> { vec![self.data.any(), self.present.any()] } fn outputs(&self) -> Vec> { vec![self.nullable_data.any()] } - fn can_stream_input(&self, _: usize) -> bool { true } - fn can_stream_output(&self, _: usize) -> bool { true } + // TODO: make streaming again? + fn can_stream_input(&self, _: usize) -> bool { false } + fn can_stream_output(&self, _: usize) -> bool { false } fn allocates(&self) -> bool { true } fn display_op(&self, _: bool) -> String { format!("nullable({}, {})", self.data, self.present) } } diff --git a/src/engine/operators/lz4_decode.rs b/src/engine/operators/lz4_decode.rs index d88e99f8..99b62125 100644 --- a/src/engine/operators/lz4_decode.rs +++ b/src/engine/operators/lz4_decode.rs @@ -11,7 +11,7 @@ pub struct LZ4Decode<'a, T> { pub has_more: bool, } -impl<'a, T: GenericIntVec> VecOperator<'a> for LZ4Decode<'a, T> { +impl<'a, T: VecData + Default + 'static> VecOperator<'a> for LZ4Decode<'a, T> { fn execute(&mut self, _: bool, scratchpad: &mut Scratchpad<'a>) -> Result<(), QueryError> { let mut decoded = scratchpad.get_mut(self.decoded); let len = lz4::decode(&mut self.reader, &mut decoded); @@ -23,7 +23,7 @@ impl<'a, T: GenericIntVec> VecOperator<'a> for LZ4Decode<'a, T> { } fn init(&mut self, _: usize, batch_size: usize, scratchpad: &mut Scratchpad<'a>) { - scratchpad.set(self.decoded, vec![T::zero(); batch_size]); + scratchpad.set(self.decoded, vec![T::default(); batch_size]); let encoded = scratchpad.get_pinned(self.encoded); self.reader = Box::new(lz4::decoder(encoded)); } diff --git a/src/engine/operators/vector_operator.rs b/src/engine/operators/vector_operator.rs index 2723ed66..e2f7af5b 100644 --- a/src/engine/operators/vector_operator.rs +++ b/src/engine/operators/vector_operator.rs @@ -433,7 +433,7 @@ pub mod operator { let reader: Box = Box::new(&[] as &[u8]); reify_types! { "lz4_decode"; - decoded: Integer; + decoded: Number; Ok(Box::new(LZ4Decode::<'a, _> { encoded, decoded, decoded_len, reader, has_more: true })) } }