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

ASF subversion and git services commented on ASTERIXDB-3091:
------------------------------------------------------------

Commit 8982b10e7cfb93ba22d88ce252dbd99d93ad056a in asterixdb's branch 
refs/heads/master from Ian Maxon
[ https://gitbox.apache.org/repos/asf?p=asterixdb.git;h=8982b10e7c ]

[ASTERIXDB-3091][MTD] Make DROP TYPE derive correct names

- user model changes: no
- storage format changes: no
- interface changes: no

Details:

DROP TYPE tries to derive the dependent nested anonymous types
to drop by name. However, when we insert these, for missable
fields and nested collections, the base type is used rather than
the quantified or outer type to create the name. This happens to
work most of the time hence this was not noticed for a very long
time.
This patch just fixes the two cases by using the unquantified type
for missable fields of records, and the item type rather than the
collection type for collections.

Change-Id: I67f3ea5bbd9dd4f5f4b836e765f42ccc1d7b13ca
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17296
Integration-Tests: Jenkins <[email protected]>
Tested-by: Jenkins <[email protected]>
Reviewed-by: Ian Maxon <[email protected]>
Reviewed-by: Ali Alsuliman <[email protected]>


> Anonymous types are not always properly cleaned up on DROP TYPE
> ---------------------------------------------------------------
>
>                 Key: ASTERIXDB-3091
>                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-3091
>             Project: Apache AsterixDB
>          Issue Type: Bug
>          Components: MTD - Metadata
>    Affects Versions: 0.9.6, 0.9.7, 0.9.8, 0.9.9
>            Reporter: Michael J. Carey
>            Assignee: Ian Maxon
>            Priority: Critical
>         Attachments: Screen Shot 2022-11-27 at 11.27.26 PM.png
>
>
> Sometimes when a datatype with nested anonymous content is dropped the 
> anonymous types that the system creates in response to CREATE TYPE are left 
> behind - still present - after doing DROP TYPE on the offending type.  I just 
> saw this happen for the following type:
> CREATE TYPE UserType AS {
>    _oid: uuid,
>    user_id: string,
>    email: string,
>    name: { first: string?, last: string? },
>    address: { street: string?, city: string?,  state: string?, zip: int? }?,
>    categories: [ string ],
>    phone: [ { number: string?, kind: string? } ],
>    joined_date: string,
>    is_buyer: boolean,
>    is_seller: boolean
> };
> DROP TYPE UserType;
> I am able to reproduce this on the version of AsterixDB being used by my 
> CS220P class (which is only slightly behind master in the area of type-y 
> stuff).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to