<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:53:38 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>OpenDaylight JIRA</title>
    <link>https://jira.opendaylight.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.20.10</version>
        <build-number>820010</build-number>
        <build-date>22-06-2022</build-date>
    </build-info>


<item>
            <title>[YANGTOOLS-570] Support unique statement for enforcement and secondary indices </title>
                <link>https://jira.opendaylight.org/browse/YANGTOOLS-570</link>
                <project id="10188" key="YANGTOOLS">yangtools</project>
                    <description>&lt;p&gt;DataTree currently does not support enforcing &apos;unique&apos; statements, provide an implementation.&lt;/p&gt;

&lt;p&gt;The implementation will need to maintain ssecondary indices based on the these statements, so that the enforcement works correctly.&lt;/p&gt;

&lt;p&gt;Expose these secondary indices so that they can be used for queries.&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: All&lt;br/&gt;
Platform: All&lt;/p&gt;</environment>
        <key id="22990">YANGTOOLS-570</key>
            <summary>Support unique statement for enforcement and secondary indices </summary>
                <type id="10103" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10311&amp;avatarType=issuetype">New Feature</type>
                                            <priority id="1" iconUrl="https://jira.opendaylight.org/images/icons/priorities/blocker.svg">Highest</priority>
                        <status id="10003" iconUrl="https://jira.opendaylight.org/images/icons/status_generic.gif" description="">Confirmed</status>
                    <statusCategory id="2" key="new" colorName="blue-gray"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="rovarga">Robert Varga</reporter>
                        <labels>
                    </labels>
                <created>Wed, 13 Jan 2016 16:16:30 +0000</created>
                <updated>Thu, 18 Jan 2024 18:20:38 +0000</updated>
                                                            <fixVersion>14.0.0</fixVersion>
                                    <component>data-impl</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="43708" author="verthezpw" created="Mon, 23 May 2016 11:02:43 +0000"  >&lt;p&gt;I assume that the prerequisite is also that the &quot;unique&quot; statement is exposed by the YANG parser (e.g. in ListSchemaNode), which is currently not the case.  &lt;/p&gt;

&lt;p&gt;Will this also be fixed by this bug?  Or should a separate bug ticket be submitted?&lt;/p&gt;</comment>
                            <comment id="43709" author="pkajsa" created="Tue, 24 May 2016 06:43:46 +0000"  >&lt;p&gt;(In reply to Peter Verthez from comment #1)&lt;br/&gt;
&amp;gt; I assume that the prerequisite is also that the &quot;unique&quot; statement is&lt;br/&gt;
&amp;gt; exposed by the YANG parser (e.g. in ListSchemaNode), which is currently not&lt;br/&gt;
&amp;gt; the case.  &lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; Will this also be fixed by this bug?  Or should a separate bug ticket be&lt;br/&gt;
&amp;gt; submitted?&lt;/p&gt;

&lt;p&gt;Please create a separate bug with dependency to this bug. &lt;br/&gt;
Thanks.&lt;/p&gt;</comment>
                            <comment id="43710" author="verthezpw" created="Tue, 24 May 2016 06:51:19 +0000"  >&lt;p&gt;ok, &lt;a href=&quot;https://bugs.opendaylight.org/show_bug.cgi?id=5946&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://bugs.opendaylight.org/show_bug.cgi?id=5946&lt;/a&gt; submitted&lt;/p&gt;</comment>
                            <comment id="43711" author="rovarga" created="Wed, 25 May 2016 15:13:20 +0000"  >&lt;p&gt;From data management perspective, YANG defines two concepts which ensure a logical combination of leaves is unique.&lt;/p&gt;

&lt;p&gt;The key statement is equivalent to an SQL primary key. Each list entry must have a unique combination of leaves specified by the key statement argument. These leaves must be immediate part of the list entry. Also, much like a SQL primary key, it acts as an index, allowing quick access to specific entries &amp;#8211; which we achieve by storing list items in Maps keyed by NodeIdentifierWithPredicates.&lt;/p&gt;

&lt;p&gt;The unique statement is similar in that it defines a combination of leaves which has to be unique &amp;#8211; very much like an SQL UNIQUE constraint. There are two differences:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;every container/list can define multiple unique statements (as opposed to a single key)&lt;/li&gt;
	&lt;li&gt;leaves in a unique statement can target any descendant leaf&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Given the following model:&lt;/p&gt;

&lt;p&gt;    list foo {&lt;br/&gt;
         key bar;&lt;br/&gt;
         leaf bar;&lt;/p&gt;

&lt;p&gt;         container baz &lt;/p&gt;
{
             leaf baz;
         }

&lt;p&gt;         container qux &lt;/p&gt;
{
             leaf qux;
         }

&lt;p&gt;         unique &quot;baz/baz qux/qux&quot;;&lt;br/&gt;
    }&lt;/p&gt;


&lt;p&gt;the implementation challenge is to efficiently detect when a write to &apos;leaf baz&apos; triggers a constraint violation while allowing it to be over-written with the same value.&lt;/p&gt;

&lt;p&gt;A naive implementation would require a full scan of &apos;list bar&apos; to establish if there are any conflicts. This is obviously not feasible if the list has a million entries and most of them do not even have &apos;leaf baz&apos;.&lt;/p&gt;

&lt;p&gt;Hence our implementation needs to maintain a set of indices (Maps?) which will allow us to realize that a leaf is part of a unique statement and create the corresponding unique key. This will then need to be looked up to see if a conflicting entry exists.&lt;/p&gt;

&lt;p&gt;Note that this is a simplistic example, YANG does seem to allow for absolute paths to leaves and nested lists, which are bound to complicate the lookups. For an initial prototype we need to handle the case above and then we can evaluate how to extend it to full compliance.&lt;/p&gt;

&lt;p&gt;Once we have the indices working internally in the DataTree, we need to think about how to allow users to use them, as a common request from application developers is to read the list entry which matches a unique constraint &amp;#8211; e.g. they know the values of leaves in the unique statement without knowledge of the primary key.&lt;/p&gt;</comment>
                            <comment id="43712" author="pkajsa" created="Thu, 23 Jun 2016 11:41:47 +0000"  >&lt;p&gt;&lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/40145/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/40145/&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10000">
                    <name>Blocks</name>
                                                                <inwardlinks description="is blocked by">
                                        <issuelink>
            <issuekey id="23047">YANGTOOLS-627</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="23036">YANGTOOLS-616</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_11400" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10002" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>YANGTOOLS-194</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10208" key="com.atlassian.jira.plugin.system.customfieldtypes:textfield">
                        <customfieldname>External issue ID</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4955</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10201" key="com.atlassian.jira.plugin.system.customfieldtypes:url">
                        <customfieldname>External issue URL</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[https://bugs.opendaylight.org/show_bug.cgi?id=4955]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10206" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Issue Type</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10308"><![CDATA[New Feature]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i0281j:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>