You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "Quanlong Huang (Jira)" <ji...@apache.org> on 2021/02/21 08:03:00 UTC

[jira] [Commented] (IMPALA-10523) Impala-shell crash in printing error messages that contain UTF-8 characters

    [ https://issues.apache.org/jira/browse/IMPALA-10523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17287866#comment-17287866 ] 

Quanlong Huang commented on IMPALA-10523:
-----------------------------------------

Impalad.INFO shows the query failed as expected:
{code}
I0220 16:40:10.255962 31805 coordinator.cc:533] 6c4d64dec01254bc:d54107fd00000000] started execution on 1 backends for query_id=6c4d64dec01254bc:d54107fd00000000
I0220 16:40:10.256145 31808 status.cc:129] 6c4d64dec01254bc:d54107fd00000000] UDF ERROR: Bad date/time conversion format: yyyy年MM月dd日 
    @          0x1e26fa3  impala::Status::Status()
    @          0x27a0988  impala::RuntimeState::SetQueryStatus()
    @          0x279f925  impala_udf::FunctionContext::SetError()
    @          0x245fdc3  impala::datetime_parse_util::ReportBadFormat()
    @          0x2c6bb80  impala::CastFormatExpr::OpenEvaluator()
    @          0x2bf51c7  impala::ScalarExprEvaluator::Open()
    @          0x2bf5256  impala::ScalarExprEvaluator::Open()
    @          0x2ae2a35  impala::UnionNode::Open()
    @          0x2484a3d  impala::FragmentInstanceState::Open()
    @          0x2481048  impala::FragmentInstanceState::Exec()
    @          0x23cae49  impala::QueryState::ExecFInstance()
    @          0x23c924b  _ZZN6impala10QueryState15StartFInstancesEvENKUlvE_clEv
    @          0x23cd5bc  _ZN5boost6detail8function26void_function_obj_invoker0IZN6impala10QueryState15StartFInstancesEvEUlvE_vE6invokeERNS1_15function_bufferE
    @          0x227ccc5  boost::function0<>::operator()()
    @          0x28ddc27  impala::Thread::SuperviseThread()
    @          0x28e5bc4  boost::_bi::list5<>::operator()<>()
    @          0x28e5ae8  boost::_bi::bind_t<>::operator()()
    @          0x28e5aa9  boost::detail::thread_data<>::run()
    @          0x4122c51  thread_proxy
    @     0x7fe6f36816b9  start_thread
    @     0x7fe6f00ef4dc  clone
I0220 16:40:10.415930 31808 status.cc:65] 6c4d64dec01254bc:d54107fd00000000] Bad date/time conversion format: yyyy年MM月dd日 
    @          0x1e25bf0  impala::Status::Status()
    @          0x1e2b232  impala::Status::Status()
    @          0x2c6bbbc  impala::CastFormatExpr::OpenEvaluator()
    @          0x2bf51c7  impala::ScalarExprEvaluator::Open()
    @          0x2bf5256  impala::ScalarExprEvaluator::Open()
    @          0x2ae2a35  impala::UnionNode::Open()
    @          0x2484a3d  impala::FragmentInstanceState::Open()
    @          0x2481048  impala::FragmentInstanceState::Exec()
    @          0x23cae49  impala::QueryState::ExecFInstance()
    @          0x23c924b  _ZZN6impala10QueryState15StartFInstancesEvENKUlvE_clEv
    @          0x23cd5bc  _ZN5boost6detail8function26void_function_obj_invoker0IZN6impala10QueryState15StartFInstancesEvEUlvE_vE6invokeERNS1_15function_bufferE
    @          0x227ccc5  boost::function0<>::operator()()
    @          0x28ddc27  impala::Thread::SuperviseThread()
    @          0x28e5bc4  boost::_bi::list5<>::operator()<>()
    @          0x28e5ae8  boost::_bi::bind_t<>::operator()()
    @          0x28e5aa9  boost::detail::thread_data<>::run()
    @          0x4122c51  thread_proxy
    @     0x7fe6f36816b9  start_thread
    @     0x7fe6f00ef4dc  clone
I0220 16:40:10.554548 31808 query-state.cc:957] 6c4d64dec01254bc:d54107fd00000000] Instance completed. instance_id=6c4d64dec01254bc:d54107fd00000000 #in-flight=0 status=INTERNAL_ERROR: Bad date/time conversion format: yyyy年MM月dd日
I0220 16:40:10.554558 31806 coordinator.cc:747] ExecState: query id=6c4d64dec01254bc:d54107fd00000000 finstance=6c4d64dec01254bc:d54107fd00000000 on host=quanlong-OptiPlex-BJ (EXECUTING -> ERROR) status=Bad date/time conversion format: yyyy年MM月dd日
{code}

> Impala-shell crash in printing error messages that contain UTF-8 characters
> ---------------------------------------------------------------------------
>
>                 Key: IMPALA-10523
>                 URL: https://issues.apache.org/jira/browse/IMPALA-10523
>             Project: IMPALA
>          Issue Type: Bug
>            Reporter: Quanlong Huang
>            Assignee: Quanlong Huang
>            Priority: Critical
>
> Encounter a crash in impala-shell when playing around with a query:
> {code}
> [localhost:21050] default> select cast(now() as string format 'yyyy年MM月dd日');
> Query: select cast(now() as string format 'yyyy年MM月dd日')
> Query submitted at: 2021-02-20 16:40:09 (Coordinator: http://quanlong-OptiPlex-BJ:25000)
> Query progress can be monitored at: http://quanlong-OptiPlex-BJ:25000/query_plan?query_id=6c4d64dec01254bc:d54107fd00000000
> Traceback (most recent call last):
>   File "/home/quanlong/workspace/Impala/shell/impala_shell.py", line 2070, in <module>
>     impala_shell_main()
>   File "/home/quanlong/workspace/Impala/shell/impala_shell.py", line 2035, in impala_shell_main
>     shell.cmdloop(intro)
>   File "/home/quanlong/workspace/Impala/toolchain/toolchain-packages-gcc7.5.0/python-2.7.16/lib/python2.7/cmd.py", line 142, in cmdloop
>     stop = self.onecmd(line)
>   File "/home/quanlong/workspace/Impala/shell/impala_shell.py", line 697, in onecmd
>     return func(arg)
>   File "/home/quanlong/workspace/Impala/shell/impala_shell.py", line 1123, in do_select
>     return self._execute_stmt(query_str, print_web_link=True)
>   File "/home/quanlong/workspace/Impala/shell/impala_shell.py", line 1320, in _execute_stmt
>     print(e, file=sys.stderr)
> UnicodeEncodeError: 'ascii' codec can't encode character u'\u5e74' in position 44: ordinal not in range(128)
> {code}
> The crash point is in shell/impala_shell.py:1320
> {code:python}
> 1316     except QueryStateException as e:
> 1317       # an exception occurred while executing the query
> 1318       if self.last_query_handle is not None:
> 1319         self.imp_client.close_query(self.last_query_handle)
> 1320       print(e, file=sys.stderr)
> {code}
> Definition of QueryStateException in shell/shell_exceptions.py:
> {code:python}
>  28 class QueryStateException(Exception):
>  29   def __init__(self, value=""):
>  30     self.value = value
>  31 
>  32   def __str__(self):
>  33     return self.value
> {code}
> After IMPALA-9489, '{{value}}' of QueryStateException is in unicode type when using Python2, because we follow the "unicode sandwich" manner - "bytes on the outside, unicode on the inside, encode/decode at the edges". We should encode it to str using 'utf-8' encoding, instead of letting Python do this implicitly and fail.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org