Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
584 views
in Technique[技术] by (71.8m points)

hiveql - How do I repeatedly run a Hive query using each line of a multi line input as the parameter?

Using Hue, I've got a Hive query that will take an input (eg. an ID number) and return a record based on that. I need to handle multiple numbers to look up in one go (in serial or parallel) and collate the results (i.e. list the records for each, one after the other) so input might be:

1234567890
45345353
32423422
1323122
etc...

I've got access to Hue (which I'm supposed to use), Hive, Oozie and Beeline. How do I:

1.) extract the number for each line

2.) repeatedly call my HiveQL query passing in each number in turn

3.) supply the total output to the user in one go

I don't know Python if that's relevant but could attempt a shell script.

I'm guessing one way might be to get the multi-line user input via Oozie (can it prompt a user for input?), then pass that to a shell script which extracts the number from each line and uses beeline to repeatedly run my Hive query with the next number as the parameter?

Thanks

question from:https://stackoverflow.com/questions/65848791/how-do-i-repeatedly-run-a-hive-query-using-each-line-of-a-multi-line-input-as-th

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...