mirror of https://github.com/apache/lucene.git
SOLR-6165: DataImportHandler should write BigInteger and BigDecimal values as strings
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1604543 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e98bcb8254
commit
ad3200b726
|
@ -94,6 +94,9 @@ Bug Fixes
|
||||||
|
|
||||||
* SOLR-6095 : SolrCloud cluster can end up without an overseer with overseer roles (Noble Paul, Shalin Mangar)
|
* SOLR-6095 : SolrCloud cluster can end up without an overseer with overseer roles (Noble Paul, Shalin Mangar)
|
||||||
|
|
||||||
|
* SOLR-6165: DataImportHandler should write BigInteger and BigDecimal values as strings.
|
||||||
|
(Anand Sengamalai via shalin)
|
||||||
|
|
||||||
Other Changes
|
Other Changes
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,8 @@ import org.slf4j.LoggerFactory;
|
||||||
import javax.naming.InitialContext;
|
import javax.naming.InitialContext;
|
||||||
import javax.naming.NamingException;
|
import javax.naming.NamingException;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.BigInteger;
|
||||||
import java.sql.*;
|
import java.sql.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
|
@ -313,8 +315,14 @@ public class JdbcDataSource extends
|
||||||
for (String colName : colNames) {
|
for (String colName : colNames) {
|
||||||
try {
|
try {
|
||||||
if (!convertType) {
|
if (!convertType) {
|
||||||
// Use underlying database's type information
|
// Use underlying database's type information except for BigDecimal and BigInteger
|
||||||
result.put(colName, resultSet.getObject(colName));
|
// which cannot be serialized by JavaBin/XML. See SOLR-6165
|
||||||
|
Object value = resultSet.getObject(colName);
|
||||||
|
if (value instanceof BigDecimal || value instanceof BigInteger) {
|
||||||
|
result.put(colName, value.toString());
|
||||||
|
} else {
|
||||||
|
result.put(colName, value);
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue