Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 10-07-2021 08:37 AM
Hi,
I want the first letter to be a capital letter and the rest lower case:
UPPER(LEFT(fieldname,1))+LOWER(SUBSTRING(fieldname,2,LEN(fieldname))) AS fieldname
I keep getting this error:
Error while compiling statement: FAILED: ParseException line 25:10 cannot recognize input near 'LEFT' '(' 'fieldname' in function specification
Please help
Created 10-18-2021 06:06 AM
With hive query, please try
select concat(UPPER(SUBSTRING(fieldname,1,1)),LOWER(SUBSTRING(fieldname,2,LENGTH(fieldname)))) AS fieldname from ...
Created 10-21-2021 10:32 AM
Created 11-05-2021 06:34 AM
@Sam7 please try :
select concat(UPPER(SUBSTRING(fieldname,1,2)),LOWER(SUBSTRING(fieldname,3,LENGTH(fieldname)))) AS fieldname from ...
You can check the below document for the usage of substring()
https://cwiki.apache.org/confluence/display/hive/languagemanual+udf
Created 11-05-2021 07:50 AM
Thank you