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

Remove useless explicit casts to string

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Reopened
    • Major
    • Resolution: Unresolved
    • Impala 2.5.0, Impala 2.6.0, Impala 2.7.0, Impala 2.8.0, Impala 2.9.0, Impala 2.10.0
    • None
    • Frontend
    • None
    • 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

        Issue Links

          Activity

            People

              bikramjeet.vig Bikramjeet Vig
              alex.behm Alexander Behm
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated: