Source:
public void initialize(Configuration conf, Properties tbl) throws SerDeException { try { LOGGER.trace("Initializing the SerDe"); if (tbl.containsKey(JdbcStorageConfig.DATABASE_TYPE.getPropertyName())) { final boolean hive_query_execution = tbl.containsKey(Constants.HIVE_JDBC_QUERY); Configuration tableConfig = JdbcStorageConfigManager.convertPropertiesToConfiguration(tbl); DatabaseAccessor dbAccessor = DatabaseAccessorFactory.getAccessor(tableConfig); columnNames = dbAccessor.getColumnNames(tableConfig); numColumns = columnNames.size(); List<String> hiveColumnNames; if (hive_query_execution) { hiveColumnNames = columnNames; final List<String> columnTypes = dbAccessor.getColumnTypes(tableConfig); hiveColumnTypeArray = new String [columnTypes.size()]; hiveColumnTypeArray = columnTypes.toArray (hiveColumnTypeArray); } else { String[] hiveColumnNameArray = parseProperty(tbl.getProperty(serdeConstants.LIST_COLUMNS), ","); if (numColumns != hiveColumnNameArray.length) { throw new SerDeException("Expected " + numColumns + " columns. Table definition has " + hiveColumnNameArray.length + " columns"); } hiveColumnNames = Arrays.asList(hiveColumnNameArray); hiveColumnTypeArray = parseProperty(tbl.getProperty(serdeConstants.LIST_COLUMN_TYPES), ":"); if (hiveColumnTypeArray.length == 0) { throw new SerDeException("Received an empty Hive column type definition"); } } List<ObjectInspector> fieldInspectors = new ArrayList<ObjectInspector>(numColumns); for (int i = 0; i < numColumns; i++) { PrimitiveTypeInfo ti = TypeInfoFactory.getPrimitiveTypeInfo(hiveColumnTypeArray[i]); ObjectInspector oi = PrimitiveObjectInspectorFactory.getPrimitiveJavaObjectInspector(ti); fieldInspectors.add(oi); } objectInspector = ObjectInspectorFactory.getStandardStructObjectInspector(hiveColumnNames, fieldInspectors); row = new ArrayList<Object>(numColumns); } } catch (Exception e) { LOGGER.error("Caught exception while initializing the SqlSerDe", e); throw new SerDeException(e); } }

Target:
public void initialize(Configuration conf, Properties tbl) throws SerDeException { try { LOGGER.trace("Initializing the SerDe"); if (tbl.containsKey(JdbcStorageConfig.DATABASE_TYPE.getPropertyName())) { final boolean hiveQueryExecution = tbl.containsKey(Constants.HIVE_JDBC_QUERY); Configuration tableConfig = JdbcStorageConfigManager.convertPropertiesToConfiguration(tbl); DatabaseAccessor dbAccessor = DatabaseAccessorFactory.getAccessor(tableConfig); columnNames = dbAccessor.getColumnNames(tableConfig); numColumns = columnNames.size(); List<String> hiveColumnNames; if (hiveQueryExecution) { hiveColumnNames = columnNames; final List<String> columnTypes = dbAccessor.getColumnTypes(tableConfig); hiveColumnTypeArray = new String[columnTypes.size()]; hiveColumnTypeArray = columnTypes.toArray(hiveColumnTypeArray); } else { String[] hiveColumnNameArray = parseProperty(tbl.getProperty(serdeConstants.LIST_COLUMNS), ","); if (numColumns != hiveColumnNameArray.length) { throw new SerDeException("Expected " + numColumns + " columns. Table definition has " + hiveColumnNameArray.length + " columns"); } hiveColumnNames = Arrays.asList(hiveColumnNameArray); hiveColumnTypeArray = parseProperty(tbl.getProperty(serdeConstants.LIST_COLUMN_TYPES), ":"); if (hiveColumnTypeArray.length == 0) { throw new SerDeException("Received an empty Hive column type definition"); } } List<ObjectInspector> fieldInspectors = new ArrayList<ObjectInspector>(numColumns); for (int i = 0; i < numColumns; i++) { PrimitiveTypeInfo ti = TypeInfoFactory.getPrimitiveTypeInfo(hiveColumnTypeArray[i]); ObjectInspector oi = PrimitiveObjectInspectorFactory.getPrimitiveJavaObjectInspector(ti); fieldInspectors.add(oi); } objectInspector = ObjectInspectorFactory.getStandardStructObjectInspector(hiveColumnNames, fieldInspectors); row = new ArrayList<Object>(numColumns); } } catch (Exception e) { LOGGER.error("Caught exception while initializing the SqlSerDe", e); throw new SerDeException(e); } }