From c8d24315487d27cf1cc5937816d86835ffa68f3e Mon Sep 17 00:00:00 2001 From: Shalin Shekhar Mangar Date: Mon, 7 Sep 2009 09:01:10 +0000 Subject: [PATCH] SOLR-1348 -- Support binary field type in convertType logic in JdbcDataSource git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@812045 13f79535-47bb-0310-9956-ffa450edef68 --- contrib/dataimporthandler/CHANGES.txt | 5 ++++- .../org/apache/solr/handler/dataimport/JdbcDataSource.java | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/contrib/dataimporthandler/CHANGES.txt b/contrib/dataimporthandler/CHANGES.txt index 16594d94667..c6093fa964b 100644 --- a/contrib/dataimporthandler/CHANGES.txt +++ b/contrib/dataimporthandler/CHANGES.txt @@ -150,7 +150,10 @@ New Features 35.SOLR-1235: disallow period (.) in entity names (noble) -36.SOLR-1234: Multiple DIH does not work because all of them write to dataimport.properties. Use the handler name as the properties file name (noble) +36.SOLR-1234: Multiple DIH does not work because all of them write to dataimport.properties. + Use the handler name as the properties file name (noble) + +37.SOLR-1348: Support binary field type in convertType logic in JdbcDataSource (shalin) Optimizations ---------------------- diff --git a/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/JdbcDataSource.java b/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/JdbcDataSource.java index b394f70451d..fafdbdf21c9 100644 --- a/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/JdbcDataSource.java +++ b/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/JdbcDataSource.java @@ -89,6 +89,8 @@ public class JdbcDataSource extends fieldNameVsType.put(n, Types.DATE); else if ("boolean".equals(t)) fieldNameVsType.put(n, Types.BOOLEAN); + else if ("binary".equals(t)) + fieldNameVsType.put(n, Types.BLOB); else fieldNameVsType.put(n, Types.VARCHAR); } @@ -307,6 +309,9 @@ public class JdbcDataSource extends case Types.BOOLEAN: result.put(colName, resultSet.getBoolean(colName)); break; + case Types.BLOB: + result.put(colName, resultSet.getBytes(colName)); + break; default: result.put(colName, resultSet.getString(colName)); break;