File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
src/databricks/sql/backend/sea/utils Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,14 @@ def _convert_decimal(
5050 return result
5151
5252
53+ def _get_type_name (thrift_type_id : int ) -> str :
54+ type_name = ttypes .TTypeId ._VALUES_TO_NAMES [thrift_type_id ]
55+ type_name = type_name .lower ()
56+ if type_name .endswith ("_type" ):
57+ type_name = type_name [:- 5 ]
58+ return type_name
59+
60+
5361class SqlType :
5462 """
5563 SQL type constants based on Thrift TTypeId values.
@@ -58,14 +66,6 @@ class SqlType:
5866 after normalize_sea_type_to_thrift processing (lowercase, without _TYPE suffix).
5967 """
6068
61- @staticmethod
62- def _get_type_name (thrift_type_id : int ) -> str :
63- type_name = ttypes .TTypeId ._VALUES_TO_NAMES [thrift_type_id ]
64- type_name = type_name .lower ()
65- if type_name .endswith ("_type" ):
66- type_name = type_name [:- 5 ]
67- return type_name
68-
6969 # Numeric types
7070 TINYINT = _get_type_name (ttypes .TTypeId .TINYINT_TYPE )
7171 SMALLINT = _get_type_name (ttypes .TTypeId .SMALLINT_TYPE )
You can’t perform that action at this time.
0 commit comments