You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@impala.apache.org by "Jinchul Kim (JIRA)" <ji...@apache.org> on 2017/11/29 02:36:00 UTC

[jira] [Created] (IMPALA-6260) Misleading 'NULL' string literal in expected results of E2E tests

Jinchul Kim created IMPALA-6260:
-----------------------------------

             Summary: Misleading 'NULL' string literal in expected results of E2E tests
                 Key: IMPALA-6260
                 URL: https://issues.apache.org/jira/browse/IMPALA-6260
             Project: IMPALA
          Issue Type: Bug
          Components: Infrastructure
            Reporter: Jinchul Kim


Our test framework always adds single quotes if the result type is string or char. It makes the potential problems.
1. The regression test cannot distinguish between 'NULL' string literal and NULL.
2. It makes a developer confuse because 'NULL' is totally different NULL.

When I look through the relevant code, I think the following code should be maintained.

{panel:title=tests/common/test_result_verifier.py}
def parse_result_rows(exec_result):
  ...
  for row in exec_result.data:
    ...
    for i in xrange(len(cols)):
      if col_types[i] == 'STRING' or col_types[i] == 'CHAR':
        col = cols[i].encode('unicode_escape')
        new_cols.append("'%s'" % col)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      else:
        new_cols.append(cols[i])
    result.append(','.join(new_cols))
{panel}

The problematic code was introduced with the commit ef48f65e. Please consider "how to distinguish NULL and 'NULL' string literal" when you fix this problem.

Dan Hecht mentioned [it might be a known issue|https://gerrit.cloudera.org/#/c/8629/4/testdata/workloads/functional-query/queries/QueryTest/exprs.test], so please mark it as a duplicate if you find a original ticket. I also tried to find it using the options(
i.e. project = IMPALA AND description ~ 'NULL' and component = Infrastructure), but I couldn't.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)