datacleaner / DataCleaner

The premier open source Data Quality solution
GNU Lesser General Public License v3.0
599 stars 181 forks source link

Unknown type errors when creating a Postgres table from DC #977

Closed drexler42 closed 8 years ago

drexler42 commented 8 years ago

When creating a new table in the "Insert Into Table" component, I get many type errors. DataCleaner does not translate types to the correct Database types. STRING should be translated into TEXT for postgres. Number should be translated to NUMERIC, and so on. But this does not happen.

Unexpected error!

Message:
    org.apache.metamodel.MetaModelException: Could not execute create table statement: CREATE TABLE public.dffdfa (id STRING, given_name STRING, family_name STRING, company STRING, address_line STRING, post_code STRING, city STRING, country STRING, email STRING, birthdate STRING, gender STRING, job_title STRING, income_amount STRING, income_currency STRING): ERROR: type "string" does not exist
  Position: 32
Level:
    SEVERE
Stack Trace:
Could not execute create table statement: CREATE TABLE public.dffdfa (id STRING, given_name STRING, family_name STRING, company STRING, address_line STRING, post_code STRING, city STRING, country STRING, email STRING, birthdate STRING, gender STRING, job_title STRING, income_amount STRING, income_currency STRING): ERROR: type "string" does not exist Position: 32
    org.apache.metamodel.jdbc.JdbcUtils.wrapException(JdbcUtils.java:68)
    org.apache.metamodel.jdbc.JdbcCreateTableBuilder.execute(JdbcCreateTableBuilder.java:62)
    org.apache.metamodel.create.CreateTable.run(CreateTable.java:65)
    org.apache.metamodel.jdbc.JdbcDataContext.executeUpdate(JdbcDataContext.java:827)
    org.datacleaner.windows.CreateTableDialog.doCreateTable(CreateTableDialog.java:260)
    org.datacleaner.windows.CreateTableDialog$1.actionPerformed(CreateTableDialog.java:200)
    javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
    javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
    javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
    java.awt.Component.processMouseEvent(Component.java:6535)
    javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
    java.awt.Component.processEvent(Component.java:6300)
    java.awt.Container.processEvent(Container.java:2236)
    java.awt.Component.dispatchEventImpl(Component.java:4891)
    java.awt.Container.dispatchEventImpl(Container.java:2294)
    java.awt.Component.dispatchEvent(Component.java:4713)
    java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
    java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
    java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
    java.awt.Container.dispatchEventImpl(Container.java:2280)
    java.awt.Window.dispatchEventImpl(Window.java:2750)
    java.awt.Component.dispatchEvent(Component.java:4713)
    java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    java.awt.EventQueue.access$500(EventQueue.java:97)
    java.awt.EventQueue$3.run(EventQueue.java:709)
    java.awt.EventQueue$3.run(EventQueue.java:703)
    java.security.AccessController.doPrivileged(Native Method)
    java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    java.awt.EventQueue$4.run(EventQueue.java:731)
    java.awt.EventQueue$4.run(EventQueue.java:729)
    java.security.AccessController.doPrivileged(Native Method)
    java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
ERROR: type "string" does not exist Position: 32
    org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2198)
    org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1927)
    org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
    org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:561)
    org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:405)
    org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:333)
    org.apache.commons.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228)
    org.apache.commons.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228)
    org.apache.metamodel.jdbc.JdbcCreateTableBuilder.execute(JdbcCreateTableBuilder.java:59)
    org.apache.metamodel.create.CreateTable.run(CreateTable.java:65)
    org.apache.metamodel.jdbc.JdbcDataContext.executeUpdate(JdbcDataContext.java:827)
    org.datacleaner.windows.CreateTableDialog.doCreateTable(CreateTableDialog.java:260)
    org.datacleaner.windows.CreateTableDialog$1.actionPerformed(CreateTableDialog.java:200)
    javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
    javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
    javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
    java.awt.Component.processMouseEvent(Component.java:6535)
    javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
    java.awt.Component.processEvent(Component.java:6300)
    java.awt.Container.processEvent(Container.java:2236)
    java.awt.Component.dispatchEventImpl(Component.java:4891)
    java.awt.Container.dispatchEventImpl(Container.java:2294)
    java.awt.Component.dispatchEvent(Component.java:4713)
    java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
    java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
    java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
    java.awt.Container.dispatchEventImpl(Container.java:2280)
    java.awt.Window.dispatchEventImpl(Window.java:2750)
    java.awt.Component.dispatchEvent(Component.java:4713)
    java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    java.awt.EventQueue.access$500(EventQueue.java:97)
    java.awt.EventQueue$3.run(EventQueue.java:709)
    java.awt.EventQueue$3.run(EventQueue.java:703)
    java.security.AccessController.doPrivileged(Native Method)
    java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    java.awt.EventQueue$4.run(EventQueue.java:731)
    java.awt.EventQueue$4.run(EventQueue.java:729)
    java.security.AccessController.doPrivileged(Native Method)
    java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
kaspersorensen commented 8 years ago

Hmm I thought we had fixed this in MetaModel, but seems not.

kaspersorensen commented 8 years ago

See https://github.com/apache/metamodel/pull/76