feat: impl timestamp type, value and vectors (#226)

* wip: impl timestamp data type

* add timestamp vectors

* adapt to recent changes to vector module

* fix all unit test

* rebase develop

* fix slice

* change default time unit to millisecond

* add more tests

* fix some CR comments

* fix some CR comments

* fix clippy

* fix some cr comments

* fix some CR comments

* fix some CR comments

* remove time unit in LogicalTypeId::Timestamp
This commit is contained in:
Lei, Huang
2022-09-09 11:43:30 +08:00
committed by GitHub
parent 82dfe78321
commit 9366e77407
46 changed files with 1003 additions and 192 deletions

View File

@@ -15,6 +15,7 @@ use datatypes::arrow::{
},
};
use datatypes::data_type::ConcreteDataType;
use datatypes::prelude::Value;
use datatypes::value::OrderedFloat;
use datatypes::{
value,
@@ -850,7 +851,9 @@ pub fn pyobj_try_to_typed_val(
}
}
ConcreteDataType::List(_) => unreachable!(),
ConcreteDataType::Date(_) | ConcreteDataType::DateTime(_) => todo!(),
ConcreteDataType::Date(_)
| ConcreteDataType::DateTime(_)
| ConcreteDataType::Timestamp(_) => todo!(),
}
} else if is_instance::<PyNone>(&obj, vm) {
// if Untyped then by default return types with highest precision
@@ -906,6 +909,7 @@ pub fn val_to_pyobj(val: value::Value, vm: &VirtualMachine) -> PyObjectRef {
// is `Date` and `DateTime` supported yet? For now just ad hoc into PyInt
value::Value::Date(v) => vm.ctx.new_int(v.val()).into(),
value::Value::DateTime(v) => vm.ctx.new_int(v.val()).into(),
Value::Timestamp(v) => vm.ctx.new_int(v.value()).into(),
value::Value::List(_) => unreachable!(),
}
}