@Nullable @Override public String getSchemaToAdd() { Schema schema = viewSpec.getFormat().getSchema(); if (schema == null) { FormatSpecification format = viewSpec.getFormat(); RecordFormat<Object, Object> initializedFormat; try { initializedFormat = RecordFormats.createInitializedFormat(format); schema = initializedFormat.getSchema(); } catch (IllegalAccessException | InstantiationException | UnsupportedTypeException | ClassNotFoundException e) { LOG.debug("Exception: ", e); LOG.warn("Exception while determining schema for view {}. View {} will not contain schema as metadata.", viewId, viewId); } } return schema == null ? null : schema.toString(); } }
format.getSchema(), formatSpec.getSettings()); } catch (UnsupportedTypeException e) { throw new BadRequestException("Format " + formatName + " does not support the requested schema.");