Writer Directives

The directives processed by the Netezza Spatial writer are listed below. The suffixes shown are prefixed by the current <Writer_Keyword> in a mapping file.

By default, the <Writer_Keyword> for the Netezza Spatial reader is NETEZZA_SPATIAL; the <Writer_Keyword> for the Netezza reader is NETEZZA.

DATASET, USER_NAME, PASSWORD, BEGIN_SQL{n}, END_SQL{n}

The DATASET, USER_NAME, PASSWORD, BEGIN_SQL{n}, and END_SQL{n} directives operate in the same manner as they do for the Netezza readers.

The remaining writer-specific directives are discussed in the following sections.

DEF

Each Netezza table must be defined before it can be written. The general form of a Netezza definition statement is:

NETEZZA_SPATIAL_DEF <tableName>	\
   [netezza_type <type>]		\
   [netezza_overwrite_table <YES|NO|TRUNCATE>] 		\
   [netezza_update_key_columns <column>[,<column>]...] 		\
   [netezza_delete_key_columns <column>[,<column>]...] 		\
   [netezza_geometry_column <geometry>]	\
   [netezza_multi_geometry <YES|NO|FIRST_FEATURE>]		\
   [netezza_geometry_column_width <width>]		\

Note that some of these parameters are only applicable when writing spatial data.

The DEF line allows complete control of the table that will be created. If the table already exists, DEF line parameters specific to table creation will be ignored.

If the specified table does not exist, then the field names and types are used to first create the table. In any case, if a <fieldType> is given, it may be any field type supported by the target database.

The Netezza Spatial writer will use the netezza_geometry_column parameter to set the name of a geometry column in a table. If the netezza_geometry_column parameter is not specified, then a default column name of THE_GEOM will be used for the geometry column

The configuration parameters present on the definition line are described in the following table:

Parameter

Contents

netezza_type

This specifies the type of geometry for features to be written to the destination table.

When appending to an existing table, if the value of this parameter is incompatible with the geometry column type of the spatial column in the existing table, expect translation failure.

When inserting a geometry, if the type of the geometry is incompatible with the value of this parameter, expect translation failure.

netezza_overwrite_table

This parameter can be set to YES|NO|TRUNCATE.

  • YES: the table will be dropped if it exists, and then created.
  • NO: The table will be created if it does not exist.
  • TRUNCATE: The table will be created if it does not exist. If the table exists, all the rows from the table will be deleted.

netezza_update_key_columns

This parameter instructs the Netezza writer to perform UPDATE operations on the table.

The argument is a comma-separated list of column names. These column names are used to match the same-named attributes on an input feature against rows in the destination table. Matching rows in the destination table will be updated by the attribute values of the input feature.

For example:

netezza_update_key_columns ID,NAME

If this parameter and netezza_delete_key_columns are both supplied, translation fails.

netezza_delete_key_
columns

This parameter instructs the Netezza writer to perform DELETE operations on the table.

The argument is a comma-separated list of column names. These column names are used to match the same-named attributes on an input feature against rows in the destination table. Matching rows in the destination table will be deleted.

For example:

netezza_delete_key_columns ID,NAME

If this parameter and netezza_update_key_columns are both supplied, translation fails.

netezza_geometry_column

This parameter can be used to specify the name of a spatial column. If it is not specified, the default name of THE_GEOM will be used.

netezza_multi_geometry

This parameter is a modifier for the DEF line parameter netezza_type when its value is one of netezza_point, netezza_linestring, or netezza_polygon. This parameter can cause these netezza_type values to be treated as MULTIPOINT, MULTILINESTRING, and MULTIPOLYGON, respectively.

Below, the behavior of this parameter is described in the context of netezza_type = netezza_point.

If this parameter is set to YES, then all incoming points will be written out as MULTIPOINT geometries. All single level point collections will be written out as MULTIPOINT geometries. All nested point collections will be written out as GEOMETRYCOLLECTIONs.

If this parameter is set to NO, then all incoming points will be written out as POINT geometries. All incoming collections of points, including nested point collections, will be flattened and written out, one row per point.

If this parameter is set to FIRST_FEATURE, the first input feature determines whether this parameter is set to YES or NO. If the first input feature is a point collection, then this parameter is set to YES. If the first input feature is a point, then this parameter is set to NO.

Geometry type mismatches result in translation failure. See documentation for netezza_type above for details.

Note: This parameter is ignored if netezza_type is set to netezza_geometry.

netezza_geometry_column_width

This specifies a fixed width for the geometry column. Any feature whose geometry is larger than this size will be dropped. If this parameter is not specified, then on insertion the geometry column width will be automatically expanded in size, as needed, up to the maximum size of 64000 bytes.

Required/Optional

Required

TRANSACTION_INTERVAL

This directive defines the number of features to be placed in each transaction before a transaction is committed to the database.

Parameter

Contents

<transaction_interval>

The number of features in a single transaction.

Default: 100000

Mapping File Syntax

NETEZZA_SPATIAL_TRANSACTION_INTERVAL 5000

ABORT_ON_BAD_DATA

Netezza cannot recover from a database error; features that are already written in the current translation will be dropped when a database error occurs. A database error can occur because of an invalid geometry or a database constraint violation. All database errors must result in translation failure. Therefore, this directive does not affect behavior on database errors.

Some forms of bad data can be pre-validated and thus not incur database errors. For example, FME can detect out-of-range numeric values before writing them to the database. FME can also detect some types of invalid geometries prior to writing. In these cases, this directive will allow the user to either reject these bad features, or fail translation.

Required/Optional

Optional

Values

YES | NO (default)

Mapping File Syntax

NETEZZA_SPATIAL_ABORT_ON_BAD_DATA YES