@@ -167,7 +167,7 @@ public Schema getSchema() throws SQLException {
167167 executeInitQueries (connection , sourceConfig .getInitQueries ());
168168 String query = sourceConfig .getImportQuery ();
169169 if (!Strings .isNullOrEmpty (query )) {
170- return loadSchemaFromDB (connection , query );
170+ return loadSchemaFromDBwithQuery (connection , query );
171171 } else if (!Strings .isNullOrEmpty (sourceConfig .getTableName ())) {
172172 List <Schema .Field > fields = getSchemaReader ().getSchemaFields (connection , sourceConfig .getTableName ());
173173 return Schema .recordOf ("schema" , fields );
@@ -177,7 +177,7 @@ public Schema getSchema() throws SQLException {
177177 }
178178 }
179179
180- private Schema getTableSchemaFromMetadata (Connection connection , String tableName ) throws SQLException {
180+ private Schema loadSchemaFromDBwithTableName (Connection connection , String tableName ) throws SQLException {
181181 DatabaseMetaData metaData = connection .getMetaData ();
182182
183183 String schema = null ;
@@ -207,7 +207,7 @@ private Schema getTableSchemaFromMetadata(Connection connection, String tableNam
207207 }
208208
209209
210- private Schema loadSchemaFromDB (Connection connection , String query ) throws SQLException {
210+ private Schema loadSchemaFromDBwithQuery (Connection connection , String query ) throws SQLException {
211211 Statement statement = connection .createStatement ();
212212 statement .setMaxRows (1 );
213213 if (query .contains ("$CONDITIONS" )) {
@@ -238,9 +238,9 @@ private Schema loadSchemaFromDB(Class<? extends Driver> driverClass)
238238 String importQuery = sourceConfig .getImportQuery ();
239239 String tableName = sourceConfig .getTableName ();
240240 if (!Strings .isNullOrEmpty (importQuery )) {
241- return loadSchemaFromDB (connection , importQuery );
241+ return loadSchemaFromDBwithQuery (connection , importQuery );
242242 } else {
243- return getTableSchemaFromMetadata (connection , tableName );
243+ return loadSchemaFromDBwithTableName (connection , tableName );
244244 }
245245 } catch (SQLException e ) {
246246 // wrap exception to ensure SQLException-child instances not exposed to contexts without jdbc driver in classpath
0 commit comments