Merge branch 'NIFI-1010'

This commit is contained in:
Mark Payne 2015-10-23 14:39:16 -04:00
commit d63cd6bd2f
1 changed files with 5 additions and 1 deletions

View File

@ -59,6 +59,7 @@ import org.apache.avro.generic.GenericData;
import org.apache.avro.generic.GenericDatumWriter;
import org.apache.avro.generic.GenericRecord;
import org.apache.avro.io.DatumWriter;
import org.apache.commons.lang3.StringUtils;
/**
* JDBC / SQL common functions.
@ -120,7 +121,10 @@ public class JdbcCommon {
public static Schema createSchema(final ResultSet rs) throws SQLException {
final ResultSetMetaData meta = rs.getMetaData();
final int nrOfColumns = meta.getColumnCount();
final String tableName = meta.getTableName(1);
String tableName = meta.getTableName(1);
if (StringUtils.isBlank(tableName)) {
tableName = "NiFi_ExecuteSQL_Record";
}
final FieldAssembler<Schema> builder = SchemaBuilder.record(tableName).namespace("any.data").fields();