[ 
https://issues.apache.org/jira/browse/MAHOUT-731?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13049130#comment-13049130
 ] 

Daniel Xiaodan Zhou commented on MAHOUT-731:
--------------------------------------------

I think so too. The only different between SQL92 implementation and PostgreSQL 
is in setPreference(): SQL92 uses SELECT to test whether a record exists, and 
use INSERT or UPDATE accordingly. PostgreSQL simply INSERT first, in case of 
DUPLICATE KEY catches the exception (with a special exception ID) and UPDATE. 
Arguably this is a little faster than SQL92. 

My view is to have SQL92 as base class, and PostgreSQL as subclass that only 
overrides setPreference(). In fact, the PostgreSQL implementation is also quite 
identical to MySQL implementation too. Further refactoring is to pull up the 
set of SQL statements as a member method getDefaultSQL() into 
AbstractJDBCDataModel. This removes duplicate code in MySQL/Postgre/SQL92 too.

If you think this is fine, I can do the refactoring. Do you think it's OK to 
check in this patch first for archival purpose? 

Also, I'm not sure whether it's OK to use "@author" in Javadoc. Not so many 
classes in Taste have that...

> Add SQL92JDBCDataModel
> ----------------------
>
>                 Key: MAHOUT-731
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-731
>             Project: Mahout
>          Issue Type: New Feature
>          Components: Collaborative Filtering
>    Affects Versions: 0.6
>            Reporter: Daniel Xiaodan Zhou
>            Assignee: Sean Owen
>              Labels: drupal_integration
>             Fix For: 0.6
>
>         Attachments: SQL92.patch
>
>
> I'm thinking to work on a patch that adds SQL92JDBCDataModel based on the 
> sample code of PostgreSQLJDBCDataModel. This class will only use standard 
> SQL92. It won't be high performance, but would have maximum compatibility to 
> other popular DBMS, such as Oracle, SQLlite, etc. This is quite important to 
> Drupal/Mahout integration.
> Before I actually write the code, is there any suggestions or concerns? 
> Thanks!

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to