Skip to content

Anydata join / exclude / include - #923

Merged
jgebal merged 11 commits into
developfrom
fix/anydata_join_syntax
Jun 5, 2019
Merged

jgebal merged 11 commits into
developfrom
fix/anydata_join_syntax

Conversation

@lwasylow

Copy link
Copy Markdown
Member

Fixes #912
Address issue of using a full type name in include / exclude / join_by on collections compare.
Now we are using only attributes names as previously.

We are treating refcursor as extra wrapping layer so when filtering a columns we need to make sure that a root name of collection / object name type is added to the filter to allow as properly use filter on cursor information.

@lwasylow lwasylow added this to the v3.1.7 milestone May 12, 2019
@lwasylow lwasylow changed the title Initial checkin Anydata join / exclude / include May 17, 2019
Comment thread source/core/ut_utils.pkb
return l_valid_name;
end;

function add_prefix(a_list ut_varchar2_list, a_prefix varchar2, a_connector varchar2 := '/') return ut_varchar2_list is

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about having add_prefix function for individual elements to avoid duplicating the below logic in 3 places:

        case 
          when self.is_anydata = 1 then
            l_prefix||'/'||trim (leading '/' from fl.column_value)
          else
            fl.column_value
          end

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch

@lwasylow lwasylow May 24, 2019

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually that causes an issue due to SQL context switch and min grant user.
We will need to grant execute to public and get a public synonym on utils.

@jgebal

jgebal commented May 24, 2019

Copy link
Copy Markdown
Member

It would be great to enhance documentation for extended data comparison with 1-2 examples for exclude/include with use of ANYDATA.convertCollection.

Comment thread source/expectations/data_values/ut_cursor_details.tpb Outdated
@pesse

pesse commented May 24, 2019

Copy link
Copy Markdown
Member

Never used it so far - maybe I should.
What's the benefit compared to cursor comparison? I remember to have tried comparing collections based on rowtypes and had problems with it...

@lwasylow

Copy link
Copy Markdown
Member Author

Never used it so far - maybe I should.
What's the benefit compared to cursor comparison? I remember to have tried comparing collections based on rowtypes and had problems with it...

You don't have to wrap a collection into cursor and then use a fancy include / exclude option to compare elements or object. An extra abstraction layer, underneath is still a cursor compare but accessing a nested elements directly to avoid an wrapping into long XML path.

lwasylow and others added 6 commits May 24, 2019 08:50
Adding a new attribute filterpath that is used for filtering cursor in anydata / refcursor.
This value will be different from cursor in anydata as we skip root element.
Adding a new attribute filterpath that is used for filtering cursor in anydata / refcursor.
This value will be different from cursor in anydata as we skip root element.
@lwasylow

Copy link
Copy Markdown
Member Author

That's working however using a complex string manipulation. To simplify method the new attribute of filter path can be added but a diff sql will have to be changed to use a cursor details instead of xml extract

@jgebal
jgebal merged commit 6e7f35c into develop Jun 5, 2019
@jgebal
jgebal deleted the fix/anydata_join_syntax branch June 5, 2019 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

exclude / join_by on collections

3 participants