Forum: Managing VoltDB

Post: DB schema on-the-fly update

DB schema on-the-fly update
alessandro.portosa
Dec 11, 2014
Hi all,
I'm playing with VoltDB Community Edition v5 and trying to integrate it into a project of data analysis. But a problem went out: unsupported DROP TABLE statement. VoltDB documentation states that it is possible to update a schema on-the-fly by using voltadmin, but I always got the following message:

ERROR: "@UpdateApplicationCatalog" procedure call failed.
ERROR:   Status: -2
ERROR:   Information: Cluster is configured to use AdHoc DDL to change application schema.  Use of @UpdateApplicationCatalog is forbidden.


Should I enable the "on-the-fly" feature into the description.xml, or it is only available in the Enterprise edition?

Many thanks,
Alessandro.
pzhao
Dec 11, 2014
Alessandro,

Thanks for your question. It seems that you have our release of community voltdb from github. You are correct, Voltdb will 'on the fly' update the catalog with the @updateapplicationcatalog procedure pre v5. This is not a enterprise edition feature.

Options:
You could build version 4.9 in github with tag voltdb-4.9 which documentation will reflect. @updateapplicationcatalog will work properly.
In v5, we are allowing users to create empty database and applying adhoc statements, ie 'drop table...' via sqlcmd.
Lastly, in deployment file, you can add schema="catalog" in cluster element to start voltdb, which accepts catalogs and @updateapplicationcatalog stored procedure.

Let me know if there are further issues.
alessandro.portosa
Dec 15, 2014
Really thanks pzhao. I just tried to execuete a "DROP TABLE" via sqlcmd and it worked like a charme.

My intention is to integrate a similar "drop table" statement by coding with Java, and it will be easier and more clear to recall something like
ClientResponse client.updateApplicationCatalog( File catalog-file, File deployment-file)
instead of involve the sqlcmd command.

Could you stress a bit more the following sentence?
Lastly, in deployment file, you can add schema="catalog" in cluster element to start voltdb, which accepts catalogs and @updateapplicationcatalog stored procedure.
It seems to me that this is strictly connected...
pzhao
Dec 15, 2014
Alessandro,

In order for you to use the updateApplicationCatalog method in java, you'd need to modify your deployment. Sorry but not being clear about how to modify it.

In the deployment file, find the cluster element similar to this:
<cluster hostcount="1" kfactor="0" />
Then append the schema attribute:
<cluster hostcount="1" kfactor="0" schema="catalog" />

This will start voltdb in catalog mode. When you start/restart voltdb, you should be able to use the updateapplicationcatalog via java/sqlcmd.
Please be aware then when you turn this mode on, drop sql commands will no longer work.

Peter
hnoor
Mar 27, 2015
This is not a enterprise edition feature.
Options:
You could build version 4.9 in github with tag voltdb-4.9 which documentation will reflect. @updateapplicationcatalog will work properly.
jhugg
Mar 27, 2015
You can do what Peter (pzhao) said and change the deployment to use the older, update application catalog mode in 5.0 community edition.

But it might be easier just to use a native Java client to send the "DROP TABLE foo" command to the database by calling:

clientInstance.callProcedure("@AdHoc", "drop table foo;");

You can also use JDBC and just send the statement directly as well.