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

ImpalaODBC: SQLNumResultCols() incorrectly returns zero when SELECT statement starts with a WITH subquery

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Impala 2.1
    • None
    • None
    • Tested version: ClouderaImpalaODBC-2.5.23.1024-1.x86_64
      Platform: RH Linux 6.5 64-bit
      Impala: v2.1.0
      CDH: 5.3

    Description

      Incorrect results are returned when using the SQLNumResultCols() ODBC call to determine the number of columns in the result set and the query begins with a WITH xxx AS subquery clause. Moving the subquery into the FROM list makes the function work correctly. Call is made immediately following a SQLExecute() call.

      Reproducible test case:

      • Use default schema
      • The following query will return 0 from SQLNumResultCols() call:

      WITH wibble AS ( select * from sample_08)
      select * from
      wibble,
      sample_07
      where wibble.code=sample_07.code

      • This rewritten version of the SQL returns 8 (correct)

      select * from
      ( select * from sample_08) wibble,
      sample_07
      where wibble.code=sample_07.code

      Attachments

        Activity

          People

            shashmi Syed A. Hashmi
            morlej_impala_9d5c James Morle
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: