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 109 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
• 19,720 points

edited May 15 by Gitika

Related Questions In Big Data Hadoop

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,120 points
138 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,120 points
731 views
0 votes
1 answer

I need to copy data from one HDFS to another HDFS. Can you help me do so?

I understood your issue. Let me help you ...READ MORE

answered May 16 in Big Data Hadoop by ravikiran
• 3,560 points
28 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,110 points
2,055 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,110 points
198 views
0 votes
10 answers

hadoop fs -put command?

copy command can be used to copy files ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Sujay
10,515 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
767 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
• 19,720 points
40 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
• 19,720 points

edited Apr 8 by Gitika 62 views