Here's the wikidoc for dropping columns with ALTER TABLE ... REPLACE
COLUMNS:  Add/Replace Columns
<https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-Add/ReplaceColumns>.
 But you'd still have to list 190 columns, so CTAS would be more direct.
AFAIK, HiveQL doesn't have syntax for DROP COLUMN.


-- Lefty


On Tue, Jul 1, 2014 at 6:27 AM, Sarfraz Ramay <sarfraz.ra...@gmail.com>
wrote:

> Hi,
>
> A workaround could be to create a table with all the columns and then drop
> the columns you don't need. Hope it helps.
>
> Regards,
> Sarfraz Rasheed Ramay (DIT)
> Dublin, Ireland.
>
>
> On Tue, Jul 1, 2014 at 5:20 AM, Szehon Ho <sze...@cloudera.com> wrote:
>
>> Why dont you just use CTAS (Create table as select), putting the 190
>> columns in the select part?  I guess you're maybe asking for any way to not
>> have to type all the columns, but I'm not aware of any.
>>
>>
>> https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-CreateTableAsSelect(CTAS)
>>
>>
>>
>> On Mon, Jun 30, 2014 at 2:54 AM, Chhaya Vishwakarma <
>> chhaya.vishwaka...@lntinfotech.com> wrote:
>>
>>>  Hi
>>>
>>>
>>>
>>>
>>>
>>> I have a Customer table with 200 columns I want to create another table
>>> from Customer table which should have only 190 columns.
>>>
>>> How can i skip few columns in hive from base table?
>>>
>>>
>>>
>>> Regards,
>>>
>>> Chhaya Vishwakarma
>>>
>>>
>>>
>>> ------------------------------
>>> The contents of this e-mail and any attachment(s) may contain
>>> confidential or privileged information for the intended recipient(s).
>>> Unintended recipients are prohibited from taking action on the basis of
>>> information in this e-mail and using or disseminating the information, and
>>> must notify the sender and delete it from their system. L&T Infotech will
>>> not accept responsibility or liability for the accuracy or completeness of,
>>> or the presence of any virus or disabling code in this e-mail"
>>>
>>
>>
>

Reply via email to