@@ -2534,12 +2534,37 @@ def test_execute_command_sets_complex_type_fields_correctly(
25342534 def test_col_to_description (self ):
25352535 test_cases = [
25362536 ("variant_col" , {b"Spark:DataType:SqlName" : b"VARIANT" }, "variant" ),
2537+ (
2538+ "geometry_col" ,
2539+ {b"Spark:DataType:SqlName" : b"GEOMETRY(0)" },
2540+ "geometry" ,
2541+ ),
2542+ (
2543+ "geography_col" ,
2544+ {b"Spark:DataType:SqlName" : b"GEOGRAPHY(4326)" },
2545+ "geography" ,
2546+ ),
2547+ (
2548+ "geometry_any_col" ,
2549+ {b"Spark:DataType:SqlName" : b"geometry(ANY)" },
2550+ "geometry" ,
2551+ ),
2552+ (
2553+ "unqualified_geography_col" ,
2554+ {b"Spark:DataType:SqlName" : b"GEOGRAPHY" },
2555+ "geography" ,
2556+ ),
25372557 ("normal_col" , {}, "string" ),
25382558 (
25392559 "weird_field" ,
25402560 {b"Spark:DataType:SqlName" : b"Some unexpected value" },
25412561 "string" ,
25422562 ),
2563+ (
2564+ "malformed_geometry_col" ,
2565+ {b"Spark:DataType:SqlName" : b"GEOMETRY(" },
2566+ "string" ,
2567+ ),
25432568 ("missing_field" , None , "string" ), # None field case
25442569 ]
25452570
@@ -2575,12 +2600,27 @@ def test_hive_schema_to_description(self):
25752600 [
25762601 ("regular_col" , ttypes .TTypeId .STRING_TYPE ),
25772602 ("variant_col" , ttypes .TTypeId .STRING_TYPE ),
2603+ ("geometry_col" , ttypes .TTypeId .STRING_TYPE ),
2604+ ("geography_col" , ttypes .TTypeId .STRING_TYPE ),
25782605 ],
25792606 [
25802607 ("regular_col" , {}),
25812608 ("variant_col" , {b"Spark:DataType:SqlName" : b"VARIANT" }),
2609+ (
2610+ "geometry_col" ,
2611+ {b"Spark:DataType:SqlName" : b"GEOMETRY(0)" },
2612+ ),
2613+ (
2614+ "geography_col" ,
2615+ {b"Spark:DataType:SqlName" : b"GEOGRAPHY(4326)" },
2616+ ),
2617+ ],
2618+ [
2619+ ("regular_col" , "string" ),
2620+ ("variant_col" , "variant" ),
2621+ ("geometry_col" , "geometry" ),
2622+ ("geography_col" , "geography" ),
25822623 ],
2583- [("regular_col" , "string" ), ("variant_col" , "variant" )],
25842624 ),
25852625 (
25862626 [("regular_col" , ttypes .TTypeId .STRING_TYPE )],
0 commit comments