@@ -49,7 +49,9 @@ def test_cast_with_comparison():
49
49
)
50
50
51
51
52
- @pytest .mark .parametrize ("dtype" , ["string" , "timestamp" , "date" , "decimal(18, 0)" ])
52
+ @pytest .mark .parametrize (
53
+ "dtype" , ["string" , "timestamp" , "date" , "decimal(18, 0)" , "varchar(255)" ]
54
+ )
53
55
def test_cast_to_data_type (dtype : str ):
54
56
sql = f"""INSERT INTO tab1
55
57
SELECT cast(col1 as { dtype } ) AS col1
@@ -60,7 +62,9 @@ def test_cast_to_data_type(dtype: str):
60
62
)
61
63
62
64
63
- @pytest .mark .parametrize ("dtype" , ["string" , "timestamp" , "date" , "decimal(18, 0)" ])
65
+ @pytest .mark .parametrize (
66
+ "dtype" , ["string" , "timestamp" , "date" , "decimal(18, 0)" , "varchar(255)" ]
67
+ )
64
68
def test_nested_cast_to_data_type (dtype : str ):
65
69
sql = f"""INSERT INTO tab1
66
70
SELECT cast(cast(col1 AS { dtype } ) AS { dtype } ) AS col1
@@ -78,7 +82,9 @@ def test_nested_cast_to_data_type(dtype: str):
78
82
)
79
83
80
84
81
- @pytest .mark .parametrize ("dtype" , ["string" , "timestamp" , "date" , "decimal(18, 0)" ])
85
+ @pytest .mark .parametrize (
86
+ "dtype" , ["string" , "timestamp" , "date" , "decimal(18, 0)" , "varchar(255)" ]
87
+ )
82
88
def test_cast_to_data_type_with_case_when (dtype : str ):
83
89
sql = f"""INSERT INTO tab1
84
90
SELECT cast(case when col1 > 0 then col2 else col3 end as { dtype } ) AS col1
0 commit comments