Source:
<code>private List<ElasticsearchColumn> buildColumns(ElasticsearchTableDescription tableDescription) { List<ElasticsearchColumn> columns = new ArrayList<>(); TransportClient client = clients.get(tableDescription.getClusterName()); verify(client != null, "TransportClient should not be null"); for (String index : getIndices(tableDescription)) { try { GetMappingsRequest mappingsRequest = new GetMappingsRequest().types(tableDescription.getType()); if (!isNullOrEmpty(index)) { mappingsRequest.indices(index); } ImmutableOpenMap<String, ImmutableOpenMap<String, MappingMetaData>> mappings = client.admin() .indices() .getMappings(mappingsRequest) .actionGet(timeout.toMillis()) .getMappings(); Iterator<String> indexIterator = mappings.keysIt(); while (indexIterator.hasNext()) { MappingMetaData mappingMetaData = mappings.get(indexIterator.next()).get(tableDescription.getType()); JsonNode rootNode = objecMapper.readTree(mappingMetaData.source().uncompressed()); JsonNode mappingNode = rootNode.get(tableDescription.getType()); JsonNode propertiesNode = mappingNode.get("properties"); List<String> lists = new ArrayList<>(); JsonNode metaNode = mappingNode.get("_meta"); if (metaNode != null) { JsonNode arrayNode = metaNode.get("lists"); if (arrayNode != null && arrayNode.isArray()) { ArrayNode arrays = (ArrayNode) arrayNode; for (int i = 0; i < arrays.size(); i++) { lists.add(arrays.get(i).textValue()); } } } populateColumns(propertiesNode, lists, columns); } } catch (IOException e) { <START> throw new PrestoException(ELASTIC_SEARCH_MAPPING_REQUEST_ERROR, e); <END> } } return columns; }</code><technical_language>IOException thrown if MappingMetaData is valid json, right? (populateColumns throw, forget update signature). rename this error code sth ELASTIC_SEARCH_CORRUPTED_MAPPING_MEDATA, do think</technical_language>

Target:
private List<ElasticsearchColumn> buildColumns(ElasticsearchTableDescription tableDescription) { List<ElasticsearchColumn> columns = new ArrayList<>(); TransportClient client = clients.get(tableDescription.getClusterName()); verify(client != null, "client is null"); for (String index : getIndices(tableDescription)) { try { GetMappingsRequest mappingsRequest = new GetMappingsRequest().types(tableDescription.getType()); if (!isNullOrEmpty(index)) { mappingsRequest.indices(index); } ImmutableOpenMap<String, ImmutableOpenMap<String, MappingMetaData>> mappings = client.admin() .indices() .getMappings(mappingsRequest) .actionGet(timeout.toMillis()) .getMappings(); Iterator<String> indexIterator = mappings.keysIt(); while (indexIterator.hasNext()) { MappingMetaData mappingMetaData = mappings.get(indexIterator.next()).get(tableDescription.getType()); JsonNode rootNode = objecMapper.readTree(mappingMetaData.source().uncompressed()); JsonNode mappingNode = rootNode.get(tableDescription.getType()); JsonNode propertiesNode = mappingNode.get("properties"); List<String> lists = new ArrayList<>(); JsonNode metaNode = mappingNode.get("_meta"); if (metaNode != null) { JsonNode arrayNode = metaNode.get("lists"); if (arrayNode != null && arrayNode.isArray()) { ArrayNode arrays = (ArrayNode) arrayNode; for (int i = 0; i < arrays.size(); i++) { lists.add(arrays.get(i).textValue()); } } } populateColumns(propertiesNode, lists, columns); } } catch (IOException e) { throw new PrestoException(ELASTICSEARCH_CORRUPTED_MAPPING_METADATA, e); } } return columns; }