>From Wail Alkowaileet <[email protected]>: Attention is currently required from: Hussain Towaileb. Wail Alkowaileet has posted comments on this change. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17896 )
Change subject: [ASTERIXDB-3294][EXT]: Fail if there are conflicting types for computed fields ...................................................................... Patch Set 1: (2 comments) File asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/ExternalDataPrefix.java: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17896/comment/063c1feb_f112cbf2 PS1, Line 204: validateIfChildField Another possible solution: 1- Let's say we have: a.b.c: int as our first computed field 2- Create a Map<String, ATypeTag> existingFields 3- At first, existingFields is empty so a.b.c:int is allowed. 4- add the following to the map a: object a.b: object a.b.c: int 5- Let say a.b: int is the next field 6- We see that existingFields has 'a.b' and its type is object Let's take another example. Let say we want to add a.b.d: string -- You can see that a.b.d is not in existingFields. So it is allowed. -- The map after adding a.b.d will be: a: object a.b: object a.b.c: int a.b.d: string Also you can use the same map to detect duplicate fields. https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17896/comment/303105e0_fe26316e PS1, Line 211: existingName.length() This would throw an OutOfBoundException if both name and existingName are the same. -- To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17896 To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Change-Id: I936c7afbf7e95271ede2230c08c7841a27995a21 Gerrit-Change-Number: 17896 Gerrit-PatchSet: 1 Gerrit-Owner: Hussain Towaileb <[email protected]> Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-CC: Wail Alkowaileet <[email protected]> Gerrit-Attention: Hussain Towaileb <[email protected]> Gerrit-Comment-Date: Wed, 01 Nov 2023 17:08:02 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
