db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Hillegas (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (DERBY-6256) Move the XmlVTI into the product.
Date Fri, 07 Jun 2013 19:44:20 GMT

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

Rick Hillegas edited comment on DERBY-6256 at 6/7/13 7:42 PM:
--------------------------------------------------------------

Attaching derby-6256-01-aa-move-XmlVTI-into-product.diff. This patch moves XmlVTI into the
product as described above.

Here is the header comment on this class:

/**
 * <p>
 * This is a VTI designed to read XML files which are structured like row sets.
 * This VTI takes the following arguments:
 * </p>
 *
 * <ul>
 * <li>xmlResourceName - An URL identifying an xml resource.</li>
 * <li>rowTag - The tag of the element which contains the row-structured content.</li>
 * <li>childTags - The attributes and descendant elements inside the row element which
should be treated as columns.</li>
 * </ul>
 *
 * <p>
 * Here is a sample declaration:
 * </p>
 *
 * <pre>
 * create function findbugs( xmlResourceName varchar( 32672 ), rowTag varchar( 32672 ), childTags
varchar( 32672 )... )
 * returns table
 * (
 *      className   varchar( 32672 ),
 *      bugCount    int
 * )
 * language java parameter style derby_jdbc_result_set no sql
 * external name 'org.apache.derby.vti.XmlVTI.xmlVTI';
 * </pre>
 *
 * <p>
 * ...and here is a sample invocation:
 * </p>
 *
 * <pre>
 * create view findbugs as
 * select *
 * from table
 * (
 *      findbugs
 *      (
 *          'file:///Users/me/static-analysis/findbugs.xml',
 *          'ClassStats',
 *          'class', 'bugs'
 *      )
 *  ) v;
 * 
 * select * from findbugs where bugCount != 0;
 * </pre>
 */


Touches the following files:

---------------

A       java/engine/org/apache/derby/vti/XmlVTI.java

Moves XmlVTI into the VTI package but does not expose it through the public api javadoc.

---------------

M       tools/jar/extraDBMSclasses.properties

Pulls XmlVTI into the engine jar file.

                
      was (Author: rhillegas):
    Attaching derby-6256-01-aa-move-XmlVTI-into-product.diff. This patch moves XmlVTI into
the product as described above.

Touches the following files:

---------------

A       java/engine/org/apache/derby/vti/XmlVTI.java

Moves XmlVTI into the VTI package but does not expose it through the public api javadoc.

---------------

M       tools/jar/extraDBMSclasses.properties

Pulls XmlVTI into the engine jar file.

                  
> Move the XmlVTI into the product.
> ---------------------------------
>
>                 Key: DERBY-6256
>                 URL: https://issues.apache.org/jira/browse/DERBY-6256
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL, Tools
>    Affects Versions: 10.11.0.0
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-6256-01-aa-move-XmlVTI-into-product.diff
>
>
> The XmlVTI under derbyDemo has been useful to me for many years. It has become even more
useful now that Derby supports varargs. That is because varargs make it very easy to declare
an XmlVTI. At this point, I think it is worth re-phrasing the XmlVTI in terms of varargs and
moving it into the product so that we can use it for internal table functions. There is no
rush to expose XmlVTI as part of Derby's public api, but we could consider doing that if other
people find this table function to be useful.
> The XmlVTI is a table function which turns an xml file into a tabular data set which
you can query via sql. When you declare an XmlVTI, you state the following arguments:
> 1) The url of an xml file.
> 2) The name of the element in the xml file which you want to treat as a record or row.
> 3) The names of the attributes and subelements of that record which you want to treat
as columns. Now that we have varargs, it is possible to represent this trailing argument as
a variable length argument list.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message