@@ -167,7 +167,7 @@ public Schema getSchema() throws SQLException {
167
167
executeInitQueries (connection , sourceConfig .getInitQueries ());
168
168
String query = sourceConfig .getImportQuery ();
169
169
if (!Strings .isNullOrEmpty (query )) {
170
- return loadSchemaFromDB (connection , query );
170
+ return loadSchemaFromDBwithQuery (connection , query );
171
171
} else if (!Strings .isNullOrEmpty (sourceConfig .getTableName ())) {
172
172
List <Schema .Field > fields = getSchemaReader ().getSchemaFields (connection , sourceConfig .getTableName ());
173
173
return Schema .recordOf ("schema" , fields );
@@ -177,7 +177,7 @@ public Schema getSchema() throws SQLException {
177
177
}
178
178
}
179
179
180
- private Schema getTableSchemaFromMetadata (Connection connection , String tableName ) throws SQLException {
180
+ private Schema loadSchemaFromDBwithTableName (Connection connection , String tableName ) throws SQLException {
181
181
DatabaseMetaData metaData = connection .getMetaData ();
182
182
183
183
String schema = null ;
@@ -207,7 +207,7 @@ private Schema getTableSchemaFromMetadata(Connection connection, String tableNam
207
207
}
208
208
209
209
210
- private Schema loadSchemaFromDB (Connection connection , String query ) throws SQLException {
210
+ private Schema loadSchemaFromDBwithQuery (Connection connection , String query ) throws SQLException {
211
211
Statement statement = connection .createStatement ();
212
212
statement .setMaxRows (1 );
213
213
if (query .contains ("$CONDITIONS" )) {
@@ -238,9 +238,9 @@ private Schema loadSchemaFromDB(Class<? extends Driver> driverClass)
238
238
String importQuery = sourceConfig .getImportQuery ();
239
239
String tableName = sourceConfig .getTableName ();
240
240
if (!Strings .isNullOrEmpty (importQuery )) {
241
- return loadSchemaFromDB (connection , importQuery );
241
+ return loadSchemaFromDBwithQuery (connection , importQuery );
242
242
} else {
243
- return getTableSchemaFromMetadata (connection , tableName );
243
+ return loadSchemaFromDBwithTableName (connection , tableName );
244
244
}
245
245
} catch (SQLException e ) {
246
246
// wrap exception to ensure SQLException-child instances not exposed to contexts without jdbc driver in classpath
0 commit comments