databricks-sql-cli icon indicating copy to clipboard operation
databricks-sql-cli copied to clipboard

dont support all the Chinese character in the sql file

Open zhangzuolin16 opened this issue 2 years ago • 0 comments

dears,

there is a bug to exeucte a sql file by databricks-sql-cli when the sql file contiains some Chinese character. for example: those two sql file: test.zip

the test1.sql will be execute success, but the test2.sql will be failed to execute,

the error message as below: Traceback (most recent call last): File "C:\Program Files\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Program Files\Python310\lib\runpy.py", line 86, in run_code exec(code, run_globals) File "C:\Program Files\Python310\Scripts\dbsqlcli.exe_main.py", line 7, in File "C:\Program Files\Python310\lib\site-packages\click\core.py", line 1130, in call return self.main(*args, **kwargs) File "C:\Program Files\Python310\lib\site-packages\click\core.py", line 1055, in main rv = self.invoke(ctx) File "C:\Program Files\Python310\lib\site-packages\click\core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) File "C:\Program Files\Python310\lib\site-packages\click\core.py", line 760, in invoke return __callback(*args, **kwargs) File "C:\Program Files\Python310\lib\site-packages\dbsqlcli\main.py", line 735, in cli query = f.read() File "C:\Program Files\Python310\lib\encodings\cp1252.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 18: character maps to

zhangzuolin16 avatar Sep 21 '23 07:09 zhangzuolin16