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

Remove useless explicit casts to string

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Impala 2.5.0, Impala 2.6.0, Impala 2.7.0, Impala 2.8.0, Impala 2.9.0, Impala 2.10.0
    • Fix Version/s: Impala 2.12.0
    • Component/s: Frontend
    • Labels:
    • Epic Color:
      ghx-label-4

      Description

      Some BI tools like to generate expressions that look like this:

      cast(numeric_col as string) = '123456'
      

      Casting and comparing as string is expensive and we should convert such expressions to:

      numeric_col = 123456
      

      Such transformations may be applicable in other situations as well. We should be careful about transforming inequality predicates because the string and numeric comparison might not always be equivalent. For example, the following transformation would be wrong:

      cast(numeric_col as string) = '0123456'
      

      is not equivalent to

      numeric_col = 123456
      

        Attachments

          Activity

            People

            • Assignee:
              bikramjeet.vig Bikramjeet Vig
              Reporter:
              alex.behm Alexander Behm
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: