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 73 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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
• 14,910 points

edited May 15 by Gitika

Related Questions In Big Data Hadoop

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
• 66,910 points
102 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
• 66,910 points
388 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
• 2,360 points
22 views
0 votes
1 answer

How Impala is fast compared to Hive in terms of query response?

Impala provides faster response as it uses MPP(massively ...READ MORE

answered Mar 21, 2018 in Big Data Hadoop by nitinrawat895
• 9,490 points
200 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
• 9,490 points
1,845 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
• 9,490 points
159 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
9,155 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,260 points
656 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
• 14,910 points
28 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
• 14,910 points

edited Apr 8 by Gitika 55 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.