Dropping a Netezza Analytics model

The result of most of Netezza’s analytic functions are a series of tables.  The tables produced vary from function to function.  We schedule jobs to run the analytic functions and want to reuse the same model name so that our business intelligence tools can simply query the resulting tables.  Identifying the tables and dropping them manually is an option; so is using symbolic links and generating a new model every day.

Instead, Netezza provides a very easy way to do clean up an existing model using their drop_model function.  It takes a single parameter:model.  For example:

FOO(ADMIN)=> call nza..arule('model=mbasket,
                              intable=pos_txn_dtl,
                              tid=customerid,
                              item=productid,
                              support=10,
                              supportType=absolute,
                              maxsetsize=3);
ERROR:  The view NZA_META_PRIV_MBASKET already exists. Choose another model name.

Here my analytic function failed because the model already existed.  To remove all of the results this previous execution created I run the following:

FOO(ADMIN)=> call nza..drop_model('model=mbasket');
NOTICE:  Dropped: MBASKET
 DROP_MODEL
------------
 t
(1 row)

Now I can rerun my analytic function without having to worry about existing tables.

Advertisements
This entry was posted in administration, analytics, General and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s