COLLAS support #9
Replies: 2 comments 1 reply
-
There are few problems with COLLATE in Snowflake at this moment (as of 2022.06.24):
Specifically:
Since this feature is so problematic and unloved by Snowflake, I generally suggest to avoid it and consider alternatives. You may use If collation cannot be avoided due to some legacy reasons, you may set it globally as default for the whole account using parameter: https://docs.snowflake.com/en/sql-reference/parameters.html#label-default-ddl-collation |
Beta Was this translation helpful? Give feedback.
-
@minghungcho , you was right about I've implemented an initial support for collations in version
Please note, Snowflake cannot change collations on existing columns using ALTER TABLE. SnowDDL will likely try to rewrite tables due to collation mismatch. Please also note, parameter |
Beta Was this translation helpful? Give feedback.
-
Currently SnowDDL does not accept COLLATE for table column. Can this be allowed by expanding data_type_re = compile(r'^(?P<base_type>[a-z0-9_]+)(((?P\d+)(,(?P\d+))?))?$', IGNORECASE) to accept additional regex group for COLLATE?
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\envs\esg_data_cloud\lib\site-packages\snowddl\resolver\abc_resolver.py", line 115, in _process_tasks
result = f.result()
File "C:\ProgramData\Anaconda3\envs\esg_data_cloud\lib\concurrent\futures_base.py", line 437, in result
return self.__get_result()
File "C:\ProgramData\Anaconda3\envs\esg_data_cloud\lib\concurrent\futures_base.py", line 389, in __get_result
raise self._exception
File "C:\ProgramData\Anaconda3\envs\esg_data_cloud\lib\concurrent\futures\thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "C:\ProgramData\Anaconda3\envs\esg_data_cloud\lib\site-packages\snowddl\resolver\table.py", line 61, in compare_object
snow_cols = self._get_existing_columns(bp)
File "C:\ProgramData\Anaconda3\envs\esg_data_cloud\lib\site-packages\snowddl\resolver\table.py", line 246, in _get_existing_columns
type=DataType(r['type']),
File "C:\ProgramData\Anaconda3\envs\esg_data_cloud\lib\site-packages\snowddl\blueprint\data_type.py", line 91, in init
raise ValueError(f"Could not parse data type string [{data_type_str}]")
ValueError: Could not parse data type string [VARCHAR(12) COLLATE 'en-ci']
Beta Was this translation helpful? Give feedback.
All reactions