Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-6260

Misleading 'NULL' string literal in expected results of E2E tests

    XMLWordPrintableJSON

Details

    • ghx-label-7

    Description

      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.

      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))
      

      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, 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 find.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jinchul Jin Chul Kim
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: