@@ -94,11 +94,7 @@ public Schema getSchema() {
94
94
// take pre-defined fixed schema
95
95
JsonArray schemaArray = jobKeys .getOutputSchema ();
96
96
setRowFilter (schemaArray );
97
- try {
98
- avroSchema = fromJsonSchema (schemaArray );
99
- } catch (Exception e ) {
100
- throw new RuntimeException ("Error converting Json schema to Avro schema" , e );
101
- }
97
+ avroSchema = fromJsonSchema (schemaArray );
102
98
} else {
103
99
avroSchema = processInputStream (0 ) ? avroExtractorKeys .getAvroOutputSchema ()
104
100
: createMinimumAvroSchema ();
@@ -149,11 +145,7 @@ public GenericRecord readRecord(GenericRecord reuse) {
149
145
GenericRecord row = extractDataField (getNext ());
150
146
AvroSchemaBasedFilter avroSchemaBasedFilter = (AvroSchemaBasedFilter ) rowFilter ;
151
147
if (avroSchemaBasedFilter != null ) {
152
- try {
153
- row = avroSchemaBasedFilter .filter (row );
154
- } catch (Exception e ) {
155
- throw new RuntimeException ("Error filtering row" , e );
156
- }
148
+ row = avroSchemaBasedFilter .filter (row );
157
149
}
158
150
return addDerivedFields (row );
159
151
}
@@ -387,9 +379,8 @@ private String processDerivedFieldSource(GenericRecord row, String name, Map<Str
387
379
* Utility method to convert JsonArray schema to avro schema
388
380
* @param schema of JsonArray type
389
381
* @return avro schema
390
- * @throws UnsupportedDateTypeException unsupported type exception
391
382
*/
392
- private Schema fromJsonSchema (JsonArray schema ) throws UnsupportedDateTypeException {
383
+ private Schema fromJsonSchema (JsonArray schema ){
393
384
return AvroSchemaUtils .fromJsonSchema (schema , state );
394
385
}
395
386
@@ -487,12 +478,6 @@ private boolean isArrayOfRecord(Object payload) {
487
478
* @return avro schema
488
479
*/
489
480
private Schema createMinimumAvroSchema () {
490
- Schema schema ;
491
- try {
492
- schema = fromJsonSchema (createMinimumSchema ());
493
- } catch (UnsupportedDateTypeException e ) {
494
- throw new IllegalStateException ("Should not get here since the minimum schema only contains supported types" );
495
- }
496
- return schema ;
481
+ return fromJsonSchema (createMinimumSchema ());
497
482
}
498
483
}
0 commit comments