org.apache.mahout.cf.taste.impl.model
Class MySQLJDBCIDMigrator
java.lang.Object
org.apache.mahout.cf.taste.impl.model.AbstractIDMigrator
org.apache.mahout.cf.taste.impl.model.AbstractJDBCIDMigrator
org.apache.mahout.cf.taste.impl.model.MySQLJDBCIDMigrator
- All Implemented Interfaces:
- Refreshable, IDMigrator, UpdatableIDMigrator
public final class MySQLJDBCIDMigrator
- extends AbstractJDBCIDMigrator
An implementation for MySQL. The following statement would create a table suitable for use with this class:
CREATE TABLE taste_id_migration (
long_id BIGINT NOT NULL PRIMARY KEY,
string_id VARCHAR(255) NOT NULL UNIQUE
)
Separately, note that in a MySQL database, the following function calls will convert a string value into a
numeric value in the same way that the standard implementations in this package do. This may be useful in
writing SQL statements for use with
AbstractJDBCDataModel
subclasses which convert string
column values to appropriate numeric values -- though this should be viewed as a temporary arrangement
since it will impact performance:
cast(conv(substring(md5([column name]), 1, 16),16,10) as signed)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MySQLJDBCIDMigrator
public MySQLJDBCIDMigrator(DataSource dataSource)
MySQLJDBCIDMigrator
public MySQLJDBCIDMigrator(DataSource dataSource,
String mappingTable,
String longIDColumn,
String stringIDColumn)
Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.