Search code examples
sqlimpala

Impala query: return only first x characters from a desired column


Is it possible to have a query only return the first 100 characters of a field?

For example, my original query is:

select text from my_table

But now I only want the first 100 characters in the column 'text', is this possible? Thanks!


Solution

  • select Strleft(text,100) from my_table
    

    http://www.cloudera.com/documentation/enterprise/5-8-x/topics/impala_string_functions.html