Can you please help with Hive Query to get FirstName, MiddleName, LastName and Suffix from FullName in Hive. Thank you

0 votes
Can you please help with Hive Query to get FirstName, MiddleName,  LastName and Suffix from FullName in Hive. Thank you
May 15 in Big Data Hadoop by NAGALLA
• 120 points

retagged May 15 by Gitika 141 views

1 answer to this question.

0 votes

Hey,

You can get first name, middle name, last name and suffix from full name as follows:

Select 'full name' as col1, 

substring(col1 FROM1 FOR  POSITION(' ' IN col1)-1) as first_name,

 substring(col1 FROM POSITION(' ' IN col1)+1 as rest name, 

substring(rest_name from 1 FOR POSITION(' ' IN rest_name)-1 as middle_name, 

substring(rest_name from POSITION(' ' IN rest_name)+1)as last_name, 

substring(last_name from 1 FOR POSITION(' ' IN last_name)-1)as suffix;

If it works let me know.

answered May 15 by Gitika
• 25,300 points

edited May 15 by Gitika

Related Questions In Big Data Hadoop

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Hadoop: How to get the column name along with the output in Hive?

You can get the column names by ...READ MORE

answered Nov 20, 2018 in Big Data Hadoop by Omkar
• 67,290 points
188 views
0 votes
1 answer

How to create a parquet table in hive and store data in it from a hive table?

Please use the code attached below for ...READ MORE

answered Jan 28 in Big Data Hadoop by Omkar
• 67,290 points
1,229 views
0 votes
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,510 points
2,407 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,510 points
245 views
0 votes
10 answers

hadoop fs -put command?

put syntax: put <localSrc> <dest> copy syntax: copyFr ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Aditya
12,237 views
0 votes
1 answer

Hadoop dfs -ls command?

In your case there is no difference ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,240 points
898 views
0 votes
1 answer

How can you transfer data from hive to HDFS ?

Hey, Data in Hive tables reside on HDFS, ...READ MORE

answered May 16 in Big Data Hadoop by Gitika
• 25,300 points
57 views
0 votes
1 answer

What can you do with sqoop in Hadoop ecosystem?

Scoop came into scenario because there were tools ...READ MORE

answered Apr 8 in Big Data Hadoop by Gitika
• 25,300 points

edited Apr 8 by Gitika 71 views