Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9105109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T02:01:17+00:00 2026-06-17T02:01:17+00:00

While the documentation specifies how one can substitute a variable, it does not seam

  • 0

While the documentation specifies how one can substitute a variable, it does not seam to support lists.

I have a query that needs to run for each day of a month, so I want to do something like this:

for day in days:
  ALTER TABLE foo ADD PARTITION(${day=hiveconf:day});

Is there a way to do this without! using some kind of scripting language like python/bash.

I have a python implementation, but it need to start a new hive process for each query. Besides being ugly, this has bad performance for small queries because of the hive start-up-time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T02:01:18+00:00Added an answer on June 17, 2026 at 2:01 am

    There’s not really a great way to do this, and I’m pretty certain there’s no way at all to do it without a secondary scripting language. But it’s not too painful in something like bash:

    hive_script=foo.hql
    if [ -e "$hive_script" ]
    then
        rm $hive_script
    fi
    days="1 2 3 4 5"
    for day in $days
    do
        echo "ALTER TABLE foo ADD PARTITION(day=$day);" >> $hive_script
    done
    hive -f $hive_script
    rm $hive_script
    

    Same strategy could be used in python: have the script generate all of the commands you want to execute, writing them to the same file. Then just execute that file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is one (typical?) example taken from the List.addAll doc that does not seem
I'm new to Java, and while reading documentation so far I can't find any
While I'm busy here reading the FastCGI documentation (yeah, reading the 'friendly' manual), does
While searching for some functions in C++ standard library documentation I read that push
I have always used the mouseover event, but while reading the jQuery documentation I
While debugging and keep pressing F5, if the source code does not exist, eclipse
Adobe's documentation for the AMF format does not seem to actually specify the structure
I have a content observer that should be notified when one of the contacts
So I'm using the excellent Ancestry gem But while the documentation seems very complete
While browsing MSDN documentation, you may come across this gem: TextBox.Watermark. Awesome! I've been

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.