woosuk.ro created IMPALA-14687:
----------------------------------

             Summary: SIGSEGV in TopNNode when using uuid() function in ORDER 
BY clause
                 Key: IMPALA-14687
                 URL: https://issues.apache.org/jira/browse/IMPALA-14687
             Project: IMPALA
          Issue Type: Bug
          Components: Backend
    Affects Versions: Impala 4.4.0
            Reporter: woosuk.ro


**Summary**
Using `uuid()` function with ORDER BY ... LIMIT causes SIGSEGV crash. Both 
direct usage and aliased usage result in crashes, though at different code 
paths.

**Scenario 1: Direct ORDER BY uuid()**
{code:sql}
SELECT * FROM some_table ORDER BY uuid() LIMIT 3;
{code}

Crash stack trace:
{code}
Thread 985 (crashed)
 0  libc.so.6 + 0x16b080
    rdi = 0x302d353230328b40  (corrupted pointer - looks like string data)
 1  impalad!impala::TopNNode::Open [topn-node.cc : 352]
{code}

**Scenario 2: Aliased uuid() in ORDER BY**
{code:sql}
SELECT *, uuid() AS random_id 
FROM some_table 
ORDER BY random_id 
LIMIT 3;
{code}

Crash stack trace:
{code}
Thread 1147 (crashed)
 0  0x7f210923d7a5
 1  impalad!impala::RowBatch::RowBatch [row-batch.cc : 60]
 2  impalad!impala::TopNNode::Open [topn-node.cc : 352]
{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to