cast_type Error
@@ -43,13 +43,23 @@ fn test_cast_function() -> Result<()> {
expect: Series::new(vec![4i8, 3, 2, 4]),
error: "",
},
+ Test {
+ name: "cast-string-to-int16-passed",
+ display: "CAST",
+ nullable: false,
+ columns: vec![Series::new(vec!["4", "3", "2", "4"]).into()],
+ func: CastFunction::create("toint16".to_string(), DataType::Int8),
+ cast_type: DataType::Int16,
+ expect: Series::new(vec![4i16, 3, 2, 4]),
+ error: "",
+ },
Test {
name: "cast-string-to-int32-passed",
display: "CAST",
nullable: false,
columns: vec![Series::new(vec!["4", "3", "2", "4"]).into()],
func: CastFunction::create("toint32".to_string(), DataType::Int8),
- cast_type: DataType::Int8,
+ cast_type: DataType::Int32,
expect: Series::new(vec![4i32, 3, 2, 4]),
error: "",
},
@@ -59,7 +69,7 @@ fn test_cast_function() -> Result<()> {
nullable: false,
columns: vec![Series::new(vec!["4", "3", "2", "4"]).into()],
func: CastFunction::create("toint64".to_string(), DataType::Int8),
- cast_type: DataType::Int8,
+ cast_type: DataType::Int64,
expect: Series::new(vec![4i64, 3, 2, 4]),
error: "",
},
