You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Rick Hillegas (JIRA)" <ji...@apache.org> on 2007/10/12 22:36:50 UTC

[jira] Created: (DERBY-3129) Create Demo code, showing how to create and use table functions.

Create Demo code, showing how to create and use table functions.
----------------------------------------------------------------

                 Key: DERBY-3129
                 URL: https://issues.apache.org/jira/browse/DERBY-3129
             Project: Derby
          Issue Type: Improvement
    Affects Versions: 10.4.0.0
            Reporter: Rick Hillegas


Create some useful, sample table functions.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (DERBY-3129) Create Demo code, showing how to create and use table functions.

Posted by "Rick Hillegas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3129?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Hillegas reassigned DERBY-3129:
------------------------------------

    Assignee: Rick Hillegas

> Create Demo code, showing how to create and use table functions.
> ----------------------------------------------------------------
>
>                 Key: DERBY-3129
>                 URL: https://issues.apache.org/jira/browse/DERBY-3129
>             Project: Derby
>          Issue Type: Improvement
>          Components: Demos/Scripts
>    Affects Versions: 10.4.0.0
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>
> Create some useful, sample table functions.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-3129) Create Demo code, showing how to create and use table functions.

Posted by "John H. Embretsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3129?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12545047 ] 

John H. Embretsen commented on DERBY-3129:
------------------------------------------

As mentioned in DERBY-3225, I don't think vtis/README is suitable for -bin distributions as-is, basically because build.xml files are not included (by default) in -bin distributions. The README says:

<quote>
To build the code, invoke the vti-demo build target in the
top level build script. To build the javadoc, invoke the demodocs
target in the top level build script.
</quote>

> Create Demo code, showing how to create and use table functions.
> ----------------------------------------------------------------
>
>                 Key: DERBY-3129
>                 URL: https://issues.apache.org/jira/browse/DERBY-3129
>             Project: Derby
>          Issue Type: Improvement
>          Components: Demos/Scripts
>    Affects Versions: 10.4.0.0
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-3129-02-buildfix-aa.diff, derby-3129-sampleTableFunctions-aa.diff, derby-3129-sampleTableFunctions-ab.diff
>
>
> Create some useful, sample table functions.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (DERBY-3129) Create Demo code, showing how to create and use table functions.

Posted by "Rick Hillegas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3129?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Hillegas closed DERBY-3129.
--------------------------------

    Resolution: Fixed

> Create Demo code, showing how to create and use table functions.
> ----------------------------------------------------------------
>
>                 Key: DERBY-3129
>                 URL: https://issues.apache.org/jira/browse/DERBY-3129
>             Project: Derby
>          Issue Type: Improvement
>          Components: Demos/Scripts
>    Affects Versions: 10.4.1.3
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-3129-02-buildfix-aa.diff, derby-3129-03-lineList.diff, derby-3129-04-propertyFileParsing.diff, derby-3129-05-propertyFileContinuationLines.diff, derby-3129-sampleTableFunctions-aa.diff, derby-3129-sampleTableFunctions-ab.diff
>
>
> Create some useful, sample table functions.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-3129) Create Demo code, showing how to create and use table functions.

Posted by "John H. Embretsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3129?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12535200 ] 

John H. Embretsen commented on DERBY-3129:
------------------------------------------

I applied the patch and took the vtiDemo.sql script for a quick test drive. Although I probably didn't get half of what these sample table functions are able to do and how they work during my brief encounter, my impression is that they demonstrate some very useful and powerful features!

Is this demo supposed to be included in our (future) released bin-distributions? If so, more detailed instructions for compiling the Java classes and running the demo should be included, as well as references to more information/documentation (I probably didn't have to mention this, but I did it just in case... ;) ).

For Derby developers the demo seems to work fine, at least after tuning the SQL script a little (paths, urls) and making sure the MySQL example database is available as expected. A minor inconvenience was that MySQL calls this database "world" [1], not "worlddb" as the URLs in the script say, so I had to do another round of changing the MySQL connection URLs (or recreate the db in MySQL).

I also found a minor inconsistency when changing the paths to the derby trunk: The script comments say that it assumes to find the derby code at '/opt/DerbyTrunk', but the script also referred to './trunk' at one point (at line 144, in the query for "how active were the committers in 2006?"). After updating all path references to trunk, everything went fine.

Well done!

[1]: http://dev.mysql.com/doc/world-setup/en/world-setup.html

> Create Demo code, showing how to create and use table functions.
> ----------------------------------------------------------------
>
>                 Key: DERBY-3129
>                 URL: https://issues.apache.org/jira/browse/DERBY-3129
>             Project: Derby
>          Issue Type: Improvement
>          Components: Demos/Scripts
>    Affects Versions: 10.4.0.0
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-3129-sampleTableFunctions-aa.diff
>
>
> Create some useful, sample table functions.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-3129) Create Demo code, showing how to create and use table functions.

Posted by "Rick Hillegas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3129?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Hillegas updated DERBY-3129:
---------------------------------

    Component/s: Demos/Scripts

> Create Demo code, showing how to create and use table functions.
> ----------------------------------------------------------------
>
>                 Key: DERBY-3129
>                 URL: https://issues.apache.org/jira/browse/DERBY-3129
>             Project: Derby
>          Issue Type: Improvement
>          Components: Demos/Scripts
>    Affects Versions: 10.4.0.0
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>
> Create some useful, sample table functions.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-3129) Create Demo code, showing how to create and use table functions.

Posted by "Rick Hillegas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3129?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Hillegas updated DERBY-3129:
---------------------------------

    Attachment: derby-3129-05-propertyFileContinuationLines.diff

Attaching derby-3129-05-propertyFileContinuationLines.diff. This makes the following changes:

1) Make the property-file reading VTI handle continuation lines

2) Adjust the message column in that VTI so that the "=" is not included

3) Fix a typo in the script which runs that VTI

4) Also make the script select all of the columns from that VTI, not just the messageID column.

Committed at subversion revision 617170.

> Create Demo code, showing how to create and use table functions.
> ----------------------------------------------------------------
>
>                 Key: DERBY-3129
>                 URL: https://issues.apache.org/jira/browse/DERBY-3129
>             Project: Derby
>          Issue Type: Improvement
>          Components: Demos/Scripts
>    Affects Versions: 10.4.0.0
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-3129-02-buildfix-aa.diff, derby-3129-03-lineList.diff, derby-3129-04-propertyFileParsing.diff, derby-3129-05-propertyFileContinuationLines.diff, derby-3129-sampleTableFunctions-aa.diff, derby-3129-sampleTableFunctions-ab.diff
>
>
> Create some useful, sample table functions.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-3129) Create Demo code, showing how to create and use table functions.

Posted by "Rick Hillegas (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3129?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12537134 ] 

Rick Hillegas commented on DERBY-3129:
--------------------------------------

Committed derby-3129-sampleTableFunctions-ab.diff at subversion revision 587652.

> Create Demo code, showing how to create and use table functions.
> ----------------------------------------------------------------
>
>                 Key: DERBY-3129
>                 URL: https://issues.apache.org/jira/browse/DERBY-3129
>             Project: Derby
>          Issue Type: Improvement
>          Components: Demos/Scripts
>    Affects Versions: 10.4.0.0
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-3129-sampleTableFunctions-aa.diff, derby-3129-sampleTableFunctions-ab.diff
>
>
> Create some useful, sample table functions.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-3129) Create Demo code, showing how to create and use table functions.

Posted by "Rick Hillegas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3129?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Hillegas updated DERBY-3129:
---------------------------------

    Attachment: derby-3129-02-buildfix-aa.diff

Committed derby-3129-02-buildfix-aa.diff. This is meant to fix the build problems introduced by the previous submission. The previous submission caused the build to fail when run from a Java 6 environment. This is because JDBC4 introduces additional methods into the ResultSet interface implemented by demo classes--those methods are not implemented in the demo.

> Create Demo code, showing how to create and use table functions.
> ----------------------------------------------------------------
>
>                 Key: DERBY-3129
>                 URL: https://issues.apache.org/jira/browse/DERBY-3129
>             Project: Derby
>          Issue Type: Improvement
>          Components: Demos/Scripts
>    Affects Versions: 10.4.0.0
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-3129-02-buildfix-aa.diff, derby-3129-sampleTableFunctions-aa.diff, derby-3129-sampleTableFunctions-ab.diff
>
>
> Create some useful, sample table functions.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-3129) Create Demo code, showing how to create and use table functions.

Posted by "Rick Hillegas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3129?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Hillegas updated DERBY-3129:
---------------------------------

    Attachment: derby-3129-03-lineList.diff

Attaching derby-3129-03-lineList.diff and committing it at subversion revision 601492. This adds another demo vti: LineListVTI. This vti just reads a text file and turns each line into a row with a single column containing the line's trimmed contents.

> Create Demo code, showing how to create and use table functions.
> ----------------------------------------------------------------
>
>                 Key: DERBY-3129
>                 URL: https://issues.apache.org/jira/browse/DERBY-3129
>             Project: Derby
>          Issue Type: Improvement
>          Components: Demos/Scripts
>    Affects Versions: 10.4.0.0
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-3129-02-buildfix-aa.diff, derby-3129-03-lineList.diff, derby-3129-sampleTableFunctions-aa.diff, derby-3129-sampleTableFunctions-ab.diff
>
>
> Create some useful, sample table functions.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-3129) Create Demo code, showing how to create and use table functions.

Posted by "Rick Hillegas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3129?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Hillegas updated DERBY-3129:
---------------------------------

    Attachment: derby-3129-sampleTableFunctions-aa.diff

Attaching derby-3129-sampleTableFunctions-aa.diff. This contains
useful, sample table functions for

1) making a table out of a property file

2) making a table out of an XML file

3) making tables out of subversion logs, apache web server logs, and
JIRA reports.

In addition, this demo provides machinery for declaring and refreshing
paramaterized subscriptions to data from foreign SQL databases.

Touches the following files:

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

A      java/demo/vtis/java/org/apache/derbyDemo/vtis/core/VTITemplate.java
A      java/demo/vtis/java/org/apache/derbyDemo/vtis/core/StringColumnVTI.java

Ancestor classes of most of the table functions in this demo. These
classes factor out most of the boilerplate code needed for table
functions.

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


A      java/demo/vtis/java/org/apache/derbyDemo/vtis/core/VTIHelper.java
A      java/demo/vtis/java/org/apache/derbyDemo/vtis/example/VTIs.java

Machinery showing how Annotations help  abstract out some of the
routine chores of creating table functions.

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

A      java/demo/vtis/java/org/apache/derbyDemo/vtis/core/XmlVTI.java
A      java/demo/vtis/java/org/apache/derbyDemo/vtis/core/XMLRow.java
A      java/demo/vtis/java/org/apache/derbyDemo/vtis/example/ApacheServerLogVTI.java
A      java/demo/vtis/java/org/apache/derbyDemo/vtis/example/DerbyJiraReportVTI.java

Machinery for making a table out of an XML file plus sample table
functions wrapping apache web server logs and JIRA reports.

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

A      java/demo/vtis/java/org/apache/derbyDemo/vtis/core/FlatFileVTI.java
A      java/demo/vtis/java/org/apache/derbyDemo/vtis/example/SubversionLogVTI.java
A      java/demo/vtis/java/org/apache/derbyDemo/vtis/example/PropertyFileVTI.java

Machinery for tabularizing a text file of records plus sample table
functions wrapping subversion logs and property files.

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

A      java/demo/vtis/java/org/apache/derbyDemo/vtis/core/QueryVTIHelper.java
A      java/demo/vtis/java/org/apache/derbyDemo/vtis/core/QueryRow.java

Machinery for creating a table function out of a query against a
foreign database.

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

A      java/demo/vtis/java/org/apache/derbyDemo/vtis/snapshot/Subscription.java
A      java/demo/vtis/java/org/apache/derbyDemo/vtis/snapshot/SnapshotQuery.java
A      java/demo/vtis/java/org/apache/derbyDemo/vtis/snapshot/SubscriptionSignature.java
A      java/demo/vtis/java/org/apache/derbyDemo/vtis/example/WorldDBSnapshot.java

Machinery for declaring/refreshing parameterized subscriptions of
foreign data plus an example subscription to the MySQL sample "world"
database.

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

A      java/demo/vtis/vtiDemo.sql
A      java/demo/vtis/data/svn_log.txt
A      java/demo/vtis/data/DerbyJiraReport.xml
A      java/demo/vtis/data/ApacheServerLog.xml
A      java/demo/vtis/README

Script, data, and instructions explaining how to build and use this
demo code.

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

M      java/demo/build.xml
M      build.xml

Build machinery.


> Create Demo code, showing how to create and use table functions.
> ----------------------------------------------------------------
>
>                 Key: DERBY-3129
>                 URL: https://issues.apache.org/jira/browse/DERBY-3129
>             Project: Derby
>          Issue Type: Improvement
>          Components: Demos/Scripts
>    Affects Versions: 10.4.0.0
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-3129-sampleTableFunctions-aa.diff
>
>
> Create some useful, sample table functions.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-3129) Create Demo code, showing how to create and use table functions.

Posted by "Rick Hillegas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3129?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Hillegas updated DERBY-3129:
---------------------------------

    Attachment: derby-3129-sampleTableFunctions-ab.diff

Thanks for taking a look at this patch, John! I have attached a second rev, derby-3129-sampleTableFunctions-ab.diff. This patch makes some changes:

1) Splits the vtiDemo.sql script into two scripts. The first, demoFileVtis.sql, tests the file-based VTIs which don't depend on having a MySQL installation. The second script, demoForeignDbmsVtis.sql tests the machinery which depends on a MySQL installation.

2) Thanks for catching the lingering reference to a relative path in the first script. I have fixed this.

3) Thanks for pointing out that the MySQL database name was confusing. I have changed the second script to expect that the database will be named "world" as you recommended.

4) I added a bit more verbiage to the README file.


> Create Demo code, showing how to create and use table functions.
> ----------------------------------------------------------------
>
>                 Key: DERBY-3129
>                 URL: https://issues.apache.org/jira/browse/DERBY-3129
>             Project: Derby
>          Issue Type: Improvement
>          Components: Demos/Scripts
>    Affects Versions: 10.4.0.0
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-3129-sampleTableFunctions-aa.diff, derby-3129-sampleTableFunctions-ab.diff
>
>
> Create some useful, sample table functions.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-3129) Create Demo code, showing how to create and use table functions.

Posted by "Dyre Tjeldvoll (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3129?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12559460#action_12559460 ] 

Dyre Tjeldvoll commented on DERBY-3129:
---------------------------------------

Hi Rick, can this issue be resolved/closed, now?

> Create Demo code, showing how to create and use table functions.
> ----------------------------------------------------------------
>
>                 Key: DERBY-3129
>                 URL: https://issues.apache.org/jira/browse/DERBY-3129
>             Project: Derby
>          Issue Type: Improvement
>          Components: Demos/Scripts
>    Affects Versions: 10.4.0.0
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-3129-02-buildfix-aa.diff, derby-3129-03-lineList.diff, derby-3129-sampleTableFunctions-aa.diff, derby-3129-sampleTableFunctions-ab.diff
>
>
> Create some useful, sample table functions.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-3129) Create Demo code, showing how to create and use table functions.

Posted by "Rick Hillegas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3129?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Hillegas updated DERBY-3129:
---------------------------------

    Attachment: derby-3129-04-propertyFileParsing.diff

Attaching derby-3129-04-propertyFileParsing.diff. This prevents the property file vti from choking on lines which don't have an "=" in them. Committed at subversion revision 615953.

> Create Demo code, showing how to create and use table functions.
> ----------------------------------------------------------------
>
>                 Key: DERBY-3129
>                 URL: https://issues.apache.org/jira/browse/DERBY-3129
>             Project: Derby
>          Issue Type: Improvement
>          Components: Demos/Scripts
>    Affects Versions: 10.4.0.0
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-3129-02-buildfix-aa.diff, derby-3129-03-lineList.diff, derby-3129-04-propertyFileParsing.diff, derby-3129-sampleTableFunctions-aa.diff, derby-3129-sampleTableFunctions-ab.diff
>
>
> Create some useful, sample table functions.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.