chore: upgrade rust toolchain to latest nightly (#2049)

* chore: upgrade rust toolchain to latest nightly

* rebase develop

* update rust toolchain in ci
This commit is contained in:
LFC
2023-08-08 15:17:51 +08:00
committed by GitHub
parent 7d0d8dc6e3
commit 46fa3eb629
127 changed files with 551 additions and 339 deletions

View File

@@ -278,23 +278,19 @@ impl_new_concrete_type_functions!(
impl ConcreteDataType {
pub fn timestamp_second_datatype() -> Self {
ConcreteDataType::Timestamp(TimestampType::Second(TimestampSecondType::default()))
ConcreteDataType::Timestamp(TimestampType::Second(TimestampSecondType))
}
pub fn timestamp_millisecond_datatype() -> Self {
ConcreteDataType::Timestamp(TimestampType::Millisecond(
TimestampMillisecondType::default(),
))
ConcreteDataType::Timestamp(TimestampType::Millisecond(TimestampMillisecondType))
}
pub fn timestamp_microsecond_datatype() -> Self {
ConcreteDataType::Timestamp(TimestampType::Microsecond(
TimestampMicrosecondType::default(),
))
ConcreteDataType::Timestamp(TimestampType::Microsecond(TimestampMicrosecondType))
}
pub fn timestamp_nanosecond_datatype() -> Self {
ConcreteDataType::Timestamp(TimestampType::Nanosecond(TimestampNanosecondType::default()))
ConcreteDataType::Timestamp(TimestampType::Nanosecond(TimestampNanosecondType))
}
/// Returns the time data type with `TimeUnit`.
@@ -323,17 +319,15 @@ impl ConcreteDataType {
}
pub fn interval_month_day_nano_datatype() -> Self {
ConcreteDataType::Interval(IntervalType::MonthDayNano(
IntervalMonthDayNanoType::default(),
))
ConcreteDataType::Interval(IntervalType::MonthDayNano(IntervalMonthDayNanoType))
}
pub fn interval_year_month_datatype() -> Self {
ConcreteDataType::Interval(IntervalType::YearMonth(IntervalYearMonthType::default()))
ConcreteDataType::Interval(IntervalType::YearMonth(IntervalYearMonthType))
}
pub fn interval_day_time_datatype() -> Self {
ConcreteDataType::Interval(IntervalType::DayTime(IntervalDayTimeType::default()))
ConcreteDataType::Interval(IntervalType::DayTime(IntervalDayTimeType))
}
pub fn timestamp_datatype(unit: TimeUnit) -> Self {

View File

@@ -202,19 +202,19 @@ mod tests {
fn test_as_arrow_datatype() {
assert_eq!(
ArrowDataType::Time32(ArrowTimeUnit::Second),
TimeSecondType::default().as_arrow_type()
TimeSecondType.as_arrow_type()
);
assert_eq!(
ArrowDataType::Time32(ArrowTimeUnit::Millisecond),
TimeMillisecondType::default().as_arrow_type()
TimeMillisecondType.as_arrow_type()
);
assert_eq!(
ArrowDataType::Time64(ArrowTimeUnit::Microsecond),
TimeMicrosecondType::default().as_arrow_type()
TimeMicrosecondType.as_arrow_type()
);
assert_eq!(
ArrowDataType::Time64(ArrowTimeUnit::Nanosecond),
TimeNanosecondType::default().as_arrow_type()
TimeNanosecondType.as_arrow_type()
);
}
}

View File

@@ -66,16 +66,10 @@ impl TryFrom<u64> for TimestampType {
/// - 9: nanosecond
fn try_from(value: u64) -> Result<Self, Self::Error> {
match value {
SECOND_VARIATION => Ok(TimestampType::Second(TimestampSecondType::default())),
MILLISECOND_VARIATION => Ok(TimestampType::Millisecond(
TimestampMillisecondType::default(),
)),
MICROSECOND_VARIATION => Ok(TimestampType::Microsecond(
TimestampMicrosecondType::default(),
)),
NANOSECOND_VARIATION => {
Ok(TimestampType::Nanosecond(TimestampNanosecondType::default()))
}
SECOND_VARIATION => Ok(TimestampType::Second(TimestampSecondType)),
MILLISECOND_VARIATION => Ok(TimestampType::Millisecond(TimestampMillisecondType)),
MICROSECOND_VARIATION => Ok(TimestampType::Microsecond(TimestampMicrosecondType)),
NANOSECOND_VARIATION => Ok(TimestampType::Nanosecond(TimestampNanosecondType)),
_ => InvalidTimestampPrecisionSnafu { precision: value }.fail(),
}
}

View File

@@ -342,7 +342,7 @@ mod tests {
fn test_binary_vector_builder() {
let input = BinaryVector::from_slice(&[b"world", b"one", b"two"]);
let mut builder = BinaryType::default().create_mutable_vector(3);
let mut builder = BinaryType.create_mutable_vector(3);
builder.push_value_ref(ValueRef::Binary("hello".as_bytes()));
assert!(builder.try_push_value_ref(ValueRef::Int32(123)).is_err());
builder.extend_slice_of(&input, 1, 2).unwrap();

View File

@@ -360,7 +360,7 @@ mod tests {
fn test_boolean_vector_builder() {
let input = BooleanVector::from_slice(&[true, false, true]);
let mut builder = BooleanType::default().create_mutable_vector(3);
let mut builder = BooleanType.create_mutable_vector(3);
builder.push_value_ref(ValueRef::Boolean(true));
assert!(builder.try_push_value_ref(ValueRef::Int32(123)).is_err());
builder.extend_slice_of(&input, 1, 2).unwrap();

View File

@@ -68,7 +68,7 @@ mod tests {
fn test_date_vector_builder() {
let input = DateVector::from_slice([1, 2, 3]);
let mut builder = DateType::default().create_mutable_vector(3);
let mut builder = DateType.create_mutable_vector(3);
builder.push_value_ref(ValueRef::Date(Date::new(5)));
assert!(builder.try_push_value_ref(ValueRef::Int32(123)).is_err());
builder.extend_slice_of(&input, 1, 2).unwrap();

View File

@@ -88,7 +88,7 @@ mod tests {
DateTime::new(3),
]);
let mut builder = DateTimeType::default().create_mutable_vector(3);
let mut builder = DateTimeType.create_mutable_vector(3);
builder.push_value_ref(ValueRef::DateTime(DateTime::new(5)));
assert!(builder.try_push_value_ref(ValueRef::Int32(123)).is_err());
builder.extend_slice_of(&input, 1, 2).unwrap();

View File

@@ -58,7 +58,7 @@ impl From<NullArray> for NullVector {
impl Vector for NullVector {
fn data_type(&self) -> ConcreteDataType {
ConcreteDataType::Null(NullType::default())
ConcreteDataType::Null(NullType)
}
fn vector_type_name(&self) -> String {
@@ -269,7 +269,7 @@ mod tests {
#[test]
fn test_null_vector_builder() {
let mut builder = NullType::default().create_mutable_vector(3);
let mut builder = NullType.create_mutable_vector(3);
builder.push_null();
assert!(builder.try_push_value_ref(ValueRef::Int32(123)).is_err());