@@ -182,8 +182,8 @@ def test_execute_select(self, superset_cursor):
182182 ret = superset_cursor .fetchall ()
183183 assert len (ret ) == 6
184184 assert [(d [0 ], d [1 ]) for d in superset_cursor .description ] == [
185- ("col_list" , None ),
186- ("A" , None ),
185+ ("col_list" , "TEXT" ),
186+ ("A" , "REAL" ),
187187 ]
188188
189189 def test_execute_nested_select (self , superset_cursor ):
@@ -285,11 +285,33 @@ def test_string_functions_select_2(self, superset_cursor):
285285
286286 superset_cursor .execute (
287287 """
288- SELECT "col_list_1", "col_list_1_replace", "col_map_B_1_upper", "col_map_B_1_lower" FROM (
288+ SELECT "col_list_1", "col_list_1_replace", "col_map_B_1_upper",
289+ "col_map_B_1_lower", "col_map_B_1_substr" FROM (
289290 SELECT col_list_1,
290291 lower(replace(col_map_B_1, '-', '_')) col_list_1_replace,
291292 UPPER(TRIM(col_map_B_1)) col_map_B_1_upper,
292- lower(col_map_B_1) col_map_B_1_lower
293+ lower(col_map_B_1) col_map_B_1_lower,
294+ SUBSTR(col_map_B_1, INSTR(col_map_B_1, '-')+1, 1) col_map_B_1_substr
295+ FROM (
296+ SELECT col_list[1] col_list_1, col_map.B[1] col_map_B_1
297+ FROM %s WHERE key_partition='row_1'
298+ ) WHERE col_list_1 = 'F'
299+ )
300+ ORDER BY "col_list_1" DESC
301+ """
302+ % TESTCASE04_TABLE
303+ )
304+ ret = superset_cursor .fetchall ()
305+ assert len (ret ) == 2
306+ assert ret [0 ] == ("F" , "f_2" , "F-2" , "f-2" , "2" )
307+
308+ def test_sqlean_string_functions (self , superset_cursor ):
309+ superset_cursor .execute (
310+ """
311+ SELECT "col_list_1", "col_map_B_part1", "col_map_B_part2" FROM (
312+ SELECT col_list_1,
313+ text_split(col_map_B_1, '-', 1) col_map_B_part1,
314+ text_split(col_map_B_1, '-', 2) col_map_B_part2
293315 FROM (
294316 SELECT col_list[1] col_list_1, col_map.B[1] col_map_B_1
295317 FROM %s WHERE key_partition='row_1'
@@ -301,7 +323,7 @@ def test_string_functions_select_2(self, superset_cursor):
301323 )
302324 ret = superset_cursor .fetchall ()
303325 assert len (ret ) == 2
304- assert ret [0 ] == ("F" , "f_2" , "F-2 " , "f- 2" )
326+ assert ret [0 ] == ("F" , "F " , "2" )
305327
306328 def test_sqlalchemy_execute_nested_select (self , superset_engine ):
307329 _ , conn = superset_engine
0 commit comments