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 2009/12/18 16:19:21 UTC

[jira] Created: (DERBY-4484) Add import/export support for UDTs.

Add import/export support for UDTs.
-----------------------------------

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


Import/export should work on UDTs.

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


[jira] Commented: (DERBY-4484) Add import/export support for UDTs.

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12828141#action_12828141 ] 

Knut Anders Hatlen commented on DERBY-4484:
-------------------------------------------

In UserDefinedTypeIdImpl, there's an error handler that looks like this:

+        } catch (Exception e) { throw new IllegalArgumentException( e.getMessage() ); }

Here, the stack trace of the original error is lost, and it's also not obvious to me that any error happening in that method must be because of an illegal argument. I'd suggest that this method is declared to throw StandardException instead (I think that's the only checked exception in the method) and the try/catch is removed. Alternatively, use iapi.error.PassThroughException instead of IllegalArgumentException so that the original exception and stack trace can be unwrapped by higher-level error handlers.

Similarly, I think this error handler in ColumnInfo.getUDTClassName()

+        catch (Exception e) { throw new SQLException( e.getMessage() ); }

should throw LoadError.unexpectedError(e) instead (for preservation of stack trace and SQLState).

> Add import/export support for UDTs.
> -----------------------------------
>
>                 Key: DERBY-4484
>                 URL: https://issues.apache.org/jira/browse/DERBY-4484
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.6.0.0
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-4484-01-ac-basicExportImport.diff
>
>
> Import/export should work on UDTs.

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


[jira] Commented: (DERBY-4484) Add import/export support for UDTs.

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

Rick Hillegas commented on DERBY-4484:
--------------------------------------

Tests passed cleanly for me on derby-4484-01-ac-basicExportImport.diff.

> Add import/export support for UDTs.
> -----------------------------------
>
>                 Key: DERBY-4484
>                 URL: https://issues.apache.org/jira/browse/DERBY-4484
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.6.0.0
>            Reporter: Rick Hillegas
>         Attachments: derby-4484-01-ac-basicExportImport.diff
>
>
> Import/export should work on UDTs.

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


[jira] Commented: (DERBY-4484) Add import/export support for UDTs.

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

Rick Hillegas commented on DERBY-4484:
--------------------------------------

Committed derby-4484-01-ac-basicExportImport.diff at subversion revision 905289.

> Add import/export support for UDTs.
> -----------------------------------
>
>                 Key: DERBY-4484
>                 URL: https://issues.apache.org/jira/browse/DERBY-4484
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.6.0.0
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-4484-01-ac-basicExportImport.diff
>
>
> Import/export should work on UDTs.

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


[jira] Closed: (DERBY-4484) Add import/export support for UDTs.

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

Rick Hillegas closed DERBY-4484.
--------------------------------

    Resolution: Fixed

> Add import/export support for UDTs.
> -----------------------------------
>
>                 Key: DERBY-4484
>                 URL: https://issues.apache.org/jira/browse/DERBY-4484
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.6.0.0
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-4484-01-ac-basicExportImport.diff, derby-4484-02-aa-exceptionHandling.diff
>
>
> Import/export should work on UDTs.

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


[jira] Updated: (DERBY-4484) Add import/export support for UDTs.

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

Rick Hillegas updated DERBY-4484:
---------------------------------

    Attachment: derby-4484-01-ac-basicExportImport.diff

Attaching derby-4484-01-ac-basicExportImport.diff. This adds basic support for exporting and importing UDT columns. UDTs can be exported and imported alongside other columns to/from a file. Regression tests are running.

This patch does NOT support dumping and retrieving UDT columns to/from a side file devoted to large objects--as can be done for LOBs and large binary columns. But that would be a useful next improvement.

In exporting a UDT column, it is serialized first to a byte array. Then that array is turned into a hex string just like a VARBINARY column. Importing the UDT reverses this process.

Touches the following files:

---------

M      java/engine/org/apache/derby/iapi/types/DataTypeDescriptor.java
M      java/engine/org/apache/derby/catalog/types/BaseTypeIdImpl.java
M      java/engine/org/apache/derby/catalog/types/UserDefinedTypeIdImpl.java
M      java/engine/org/apache/derby/impl/sql/compile/ValueNode.java

Type system support for UDTs was improved to make it possible to create a UDT descriptor from the schema qualified name of the type. The Import VTI needs this. Along the way, the ValueNode was improved to bind a classname to these UDT descriptors.

---------


M      java/engine/org/apache/derby/impl/load/ExportAbstract.java
M      java/engine/org/apache/derby/impl/load/ColumnInfo.java
M      java/engine/org/apache/derby/impl/load/Import.java
M      java/engine/org/apache/derby/impl/load/ImportResultSetMetaData.java
M      java/engine/org/apache/derby/impl/load/ImportAbstract.java

Changes to export and import to allow UDT columns in exported files. The import machinery is a little tricky because it relies on a VTI, whose metadata descriptions had to be improved.


---------

M      java/engine/org/apache/derby/impl/sql/compile/CreateTableNode.java

The ImportExportTest uncovered some flaws in CREATE TABLE AS which prevented us from creating a table's shape from a query if one of the result columns was of UDT type. Fixed in this patch.


---------

M      java/testing/org/apache/derbyTesting/functionTests/tests/lang/UDTTest.java
M      java/testing/org/apache/derbyTesting/functionTests/tests/tools/ImportExportTest.java

Regression tests for basic export/import of UDT columns.

---------


> Add import/export support for UDTs.
> -----------------------------------
>
>                 Key: DERBY-4484
>                 URL: https://issues.apache.org/jira/browse/DERBY-4484
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.6.0.0
>            Reporter: Rick Hillegas
>         Attachments: derby-4484-01-ac-basicExportImport.diff
>
>
> Import/export should work on UDTs.

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


[jira] Commented: (DERBY-4484) Add import/export support for UDTs.

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12828180#action_12828180 ] 

Knut Anders Hatlen commented on DERBY-4484:
-------------------------------------------

Thanks for making these changes, Rick. I didn't realize that adding a throws declaration to UserDefinedTypeIdImpl's constructor would affect so many files... But the changes look good to me. +1 to commit if the regression tests still pass.

> Add import/export support for UDTs.
> -----------------------------------
>
>                 Key: DERBY-4484
>                 URL: https://issues.apache.org/jira/browse/DERBY-4484
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.6.0.0
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-4484-01-ac-basicExportImport.diff, derby-4484-02-aa-exceptionHandling.diff
>
>
> Import/export should work on UDTs.

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


[jira] Updated: (DERBY-4484) Add import/export support for UDTs.

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

Rick Hillegas updated DERBY-4484:
---------------------------------

    Attachment: derby-4484-02-aa-exceptionHandling.diff

Thanks, Knut. Those are good suggestions. Attaching derby-4484-02-aa-exceptionHandling.diff, which makes those changes. Touches the following files:

M      java/engine/org/apache/derby/impl/load/ColumnInfo.java
M      java/engine/org/apache/derby/impl/sql/compile/JavaValueNode.java
M      java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
M      java/engine/org/apache/derby/impl/sql/catalog/SYSCOLUMNSRowFactory.java
M      java/engine/org/apache/derby/impl/sql/catalog/SYSALIASESRowFactory.java
M      java/engine/org/apache/derby/impl/sql/catalog/SYSCOLPERMSRowFactory.java
M      java/engine/org/apache/derby/impl/sql/catalog/SYSSTATISTICSRowFactory.java
M      java/engine/org/apache/derby/impl/sql/catalog/SYSSEQUENCESRowFactory.java
M      java/engine/org/apache/derby/impl/sql/catalog/SYSROUTINEPERMSRowFactory.java
M      java/engine/org/apache/derby/impl/sql/catalog/SYSVIEWSRowFactory.java
M      java/engine/org/apache/derby/impl/sql/catalog/SYSTABLEPERMSRowFactory.java
M      java/engine/org/apache/derby/impl/sql/catalog/SYSCHECKSRowFactory.java
M      java/engine/org/apache/derby/impl/sql/catalog/SYSFILESRowFactory.java
M      java/engine/org/apache/derby/impl/sql/catalog/SYSTABLESRowFactory.java
M      java/engine/org/apache/derby/impl/sql/catalog/SYSKEYSRowFactory.java
M      java/engine/org/apache/derby/impl/sql/catalog/SYSDEPENDSRowFactory.java
M      java/engine/org/apache/derby/impl/sql/catalog/SYSSCHEMASRowFactory.java
M      java/engine/org/apache/derby/impl/sql/catalog/SYSROLESRowFactory.java
M      java/engine/org/apache/derby/impl/sql/catalog/SYSFOREIGNKEYSRowFactory.java
M      java/engine/org/apache/derby/impl/sql/catalog/SYSTRIGGERSRowFactory.java
M      java/engine/org/apache/derby/impl/sql/catalog/SYSPERMSRowFactory.java
M      java/engine/org/apache/derby/impl/sql/catalog/SYSSTATEMENTSRowFactory.java
M      java/engine/org/apache/derby/impl/sql/catalog/SYSCONGLOMERATESRowFactory.java
M      java/engine/org/apache/derby/impl/sql/catalog/SystemColumnImpl.java
M      java/engine/org/apache/derby/iapi/sql/dictionary/CatalogRowFactory.java
M      java/engine/org/apache/derby/iapi/types/TypeId.java
M      java/engine/org/apache/derby/iapi/types/DataTypeDescriptor.java
M      java/engine/org/apache/derby/iapi/types/JSQLType.java
M      java/engine/org/apache/derby/catalog/types/UserDefinedTypeIdImpl.java

> Add import/export support for UDTs.
> -----------------------------------
>
>                 Key: DERBY-4484
>                 URL: https://issues.apache.org/jira/browse/DERBY-4484
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.6.0.0
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-4484-01-ac-basicExportImport.diff, derby-4484-02-aa-exceptionHandling.diff
>
>
> Import/export should work on UDTs.

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


[jira] Commented: (DERBY-4484) Add import/export support for UDTs.

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

Rick Hillegas commented on DERBY-4484:
--------------------------------------

Thanks, Knut. The tests ran cleanly for me. Committed derby-4484-02-aa-exceptionHandling.diff at subversion revision 905472.

> Add import/export support for UDTs.
> -----------------------------------
>
>                 Key: DERBY-4484
>                 URL: https://issues.apache.org/jira/browse/DERBY-4484
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.6.0.0
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-4484-01-ac-basicExportImport.diff, derby-4484-02-aa-exceptionHandling.diff
>
>
> Import/export should work on UDTs.

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


[jira] Updated: (DERBY-4484) Add import/export support for UDTs.

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

Rick Hillegas updated DERBY-4484:
---------------------------------

    Issue & fix info: [Patch Available]

> Add import/export support for UDTs.
> -----------------------------------
>
>                 Key: DERBY-4484
>                 URL: https://issues.apache.org/jira/browse/DERBY-4484
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.6.0.0
>            Reporter: Rick Hillegas
>         Attachments: derby-4484-01-ac-basicExportImport.diff
>
>
> Import/export should work on UDTs.

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


[jira] Updated: (DERBY-4484) Add import/export support for UDTs.

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

Rick Hillegas updated DERBY-4484:
---------------------------------

    Component/s: SQL

> Add import/export support for UDTs.
> -----------------------------------
>
>                 Key: DERBY-4484
>                 URL: https://issues.apache.org/jira/browse/DERBY-4484
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.6.0.0
>            Reporter: Rick Hillegas
>
> Import/export should work on UDTs.

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


[jira] Assigned: (DERBY-4484) Add import/export support for UDTs.

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

Rick Hillegas reassigned DERBY-4484:
------------------------------------

    Assignee: Rick Hillegas

> Add import/export support for UDTs.
> -----------------------------------
>
>                 Key: DERBY-4484
>                 URL: https://issues.apache.org/jira/browse/DERBY-4484
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.6.0.0
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-4484-01-ac-basicExportImport.diff
>
>
> Import/export should work on UDTs.

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