You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Yue Guan <pi...@gmail.com> on 2012/08/31 22:53:50 UTC

variable substitution doesn't for table name?

Hi, there

Is variable substitution good for tables? This is what I tried:

set table_name=test_table;
explain select * from ${hiveconf:table_name};

FAILED: Parse Error: line 1:22 cannot recognize input '$' in join source

So I just want to confirm that variable substitution is only good for
column names?

Thank you

Re: variable substitution doesn't for table name?

Posted by Yue Guan <pi...@gmail.com>.
I'm using Hive 0.7.0. Yeah, this is out of my expectation.

On Fri, Aug 31, 2012 at 5:05 PM, Edward Capriolo <ed...@gmail.com> wrote:
> No. Variable substitution works for anything. Likely your version of hive is
> old and does not support this at all.
>
>
> On Friday, August 31, 2012, Yue Guan <pi...@gmail.com> wrote:
>> Hi, there
>>
>> Is variable substitution good for tables? This is what I tried:
>>
>> set table_name=test_table;
>> explain select * from ${hiveconf:table_name};
>>
>> FAILED: Parse Error: line 1:22 cannot recognize input '$' in join source
>>
>> So I just want to confirm that variable substitution is only good for
>> column names?
>>
>> Thank you
>>

Re: variable substitution doesn't for table name?

Posted by Edward Capriolo <ed...@gmail.com>.
No. Variable substitution works for anything. Likely your version of hive
is old and does not support this at all.

On Friday, August 31, 2012, Yue Guan <pi...@gmail.com> wrote:
> Hi, there
>
> Is variable substitution good for tables? This is what I tried:
>
> set table_name=test_table;
> explain select * from ${hiveconf:table_name};
>
> FAILED: Parse Error: line 1:22 cannot recognize input '$' in join source
>
> So I just want to confirm that variable substitution is only good for
> column names?
>
> Thank you
>