[ 
https://issues.apache.org/jira/browse/HIVE-21897?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16868085#comment-16868085
 ] 

Mithun Radhakrishnan commented on HIVE-21897:
---------------------------------------------

bq. SerDe is for a table, and not for a partition.

Pardon me, but wouldn't a SerDe be exercised per partition?

{code:sql}
CREATE TABLE foobar ( foo STRING, bar STRING ) PARTITIONED BY (dt STRING) 
STORED AS TEXTFILE;
ALTER TABLE foobar ADD PARTITION ( dt='1' ); -- SerDe == LazySimpleSerDe.
ALTER TABLE foobar SET FILEFORMAT ORCFILE;
ALTER TABLE foobar ADD PARTITION ( dt='2' ); -- SerDe == OrcSerDe.
{code}

{{foobar(dt='1')}} should use {{LazySimpleSerDe}}, while {{foobar(dt='2')}} 
would use {{OrcSerDe}}, when each is read.

> Setting serde / serde properties for partitions
> -----------------------------------------------
>
>                 Key: HIVE-21897
>                 URL: https://issues.apache.org/jira/browse/HIVE-21897
>             Project: Hive
>          Issue Type: Bug
>          Components: Hive
>    Affects Versions: 3.1.1
>            Reporter: Miklos Gergely
>            Assignee: Ashutosh Chauhan
>            Priority: Major
>             Fix For: 4.0.0
>
>
> According to 
> [https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-AddSerDeProperties]
>  the SerDe and the SerDe properties can be set for a partition too, so
>  
> {code:java}
> ALTERT TABLE table PARTITION (partition_col='partition_value') SET SERDE 
> 'serde.class.name';{code}
> Is a valid statement. In fact it is not rejected, but it is not doing 
> anything at all. The execution is successful, everything remains the same. 
> The same is true for setting the serde properties:
> {code:java}
> ALTER TABLE table PARTITION (partition_col='partition_value') SET 
> SERDEPROPERTIES ('property_name'='property_value');{code}
> is also a valid statement, and not doing anything.
> I suggest to modify the parser, and reject these statements. SerDe is for a 
> table, and not for a partition.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to