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

Naveen Gangam commented on HIVE-23804:
--------------------------------------

[~aditya-shah] While the patch addresses the issue going forward, I don't think 
it addresses the backward compatibility issue for existing releases. Users 
planning on upgrading do not have a release to upgrade to that would contain 
this fix (we will not be re-releasing 3.0) and users that have already upgraded 
and are seeing this issue, they will not see this fix as the schema would have 
already been upgraded and schematool run is a no-op (and they will have to have 
newer release bits containing this fix).

so I think 
* we will need to fix this in the upgrade path from 3.2-to-4.0 not in 
2.3-to-3.0 upgrade path.
* alter table set DEFAULT only affects new rows. The existing metadata will 
still have no default value. So to fix this, users will have to run an "update" 
on the tables to set all rows with null value to the 'default' value. We can 
automatically do this by including this update query in the upgrade scripts but 
I generally don't like 'altering' user metadata without an option to opt out. 
So lets leave this out of the scripts but update documentation on what to run 
after an upgrade.
* Have you tested the alter query against all DBs? Alter table has varying 
syntax across DBs and some might not even throw errors on incorrect syntax. 
Please post details of your testing (output from SQL clients would be very 
helpful)
* Also I dont see a fix for the hive-schema-4.0.0.postgres.sql file. Was this 
omitted on purpose? 

Thanks


> Adding defaults for Columns Stats table in the schema to make them backward 
> compatible
> --------------------------------------------------------------------------------------
>
>                 Key: HIVE-23804
>                 URL: https://issues.apache.org/jira/browse/HIVE-23804
>             Project: Hive
>          Issue Type: Sub-task
>    Affects Versions: 2.1.1, 2.3.7
>            Reporter: Aditya Shah
>            Assignee: Aditya Shah
>            Priority: Major
>         Attachments: HIVE-23804.patch
>
>
> Since the table/part column statistics tables have added a new `CAT_NAME` 
> column with `NOT NULL` constraint in version >3.0.0, queries to analyze 
> statistics break for Hive versions <3.0.0 when used against an upgraded DB. 
> One such miss is handled in HIVE-21739.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to