private void transformProperties ( ) { //Gobblin does not accept the SQL query ends with semi-colon String query = getJobProps ( ) . getString ( GOBBLIN_QUERY_KEY , null ) ; if ( query == null ) { return ; } query = query . trim ( ) ; int idx = - 1 ; if ( ( idx = query . indexOf ( ' ' ) ) >= 0 ) { if ( idx < query . length ( ) - 1 ) { //Query string has been already trimmed and if index is not end of the query String, //it means there's more than one statement. throw new IllegalArgumentException ( GOBBLIN_QUERY_KEY + " should consist of one SELECT statement. " + query ) ; } query = query . substring ( 0 , idx ) ; getJobProps ( ) . put ( GOBBLIN_QUERY_KEY , query ) ; } }
Transform property to make it work for Gobblin .