Error using TDGeoImport to load shapefile

Extensibility

Error using TDGeoImport to load shapefile

I am using the Geospatial Import-Export Utility (v1.6) for TD 13.0 to load shapefiles to Teradata.  When I run the utility to import a shapefile I get an error that says:

Importing layer MyLayer to table MyLayer... com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata Database] [TeraJDBC 14.00.00.13] [Error 6910] [SQLState HY000] UDT ''ST_GEOMETRY'' is a Distinct type, which can not be initialized through a NEW specification.

After attempting to run the utility and receiving this error, the table is present but no data has been loaded.  I am able to replicate this error in SQL Assistance when I attempt to run:

INSERT INTO mydb.MyLayer

VALUES (1, NEW ST_GEOMETRY('POINT(100 30)'));

When I remove the "NEW ST_GEOMETRY" and parenthesis around the POINT statement in the statement above it runs just fine.

Any ideas what is causing the error when I run the TDGeoImport utility? 

Thanks!!!

2 REPLIES
Teradata Employee

Re: Error using TDGeoImport to load shapefile

I experience a similar but not identical problem with the TDGeoImportExport tool. I experienced a similar bug under this link. I think such kind of problems should be reported to customer support to take into considerations when releasing some fixes in the next release of the tool.

Anyway, your problem makes sense as the NEW constructor for ST_Geometry UDT requires the format to be similar to the following

VALUES (1, NEW ST_Geometry('ST_POINT', 1E3, 3E2));

Or as you have said you can just pass the WKT format you have mentioned removing the ST_Geometry constructor call, which passes the WKT in CLOB format to the Teradata Database (both ways are supported but with the correct syntax of course!)

Anyway, please report this to the support team.

Teradata Employee

Re: Error using TDGeoImport to load shapefile

I must note however, that the format you have mentioned is also supported using VARCHAR(64000) constructors (i.e. your NEW statement should be supported) like the following:

VALUES (1, NEW ST_GEOMETRY('POINT(100 30)'));

When I run the above statements with TD13.0 it works fine with me! The error you get is also weird for me because ST_Geometry is an instantiable UDT (can be instantiated using NEW in a normal fashion) which contradicts the message you are getting (at least this is how I understand it, which now doesn't make sense to me).

Please make sure that you are running the tool on your Teradata system which should be TD13 and NOT TD12, otherwise I’m a little clueless now...