stalary commented on code in PR #9583: URL: https://github.com/apache/doris/pull/9583#discussion_r911516109
########## fe/fe-core/src/main/java/org/apache/doris/external/elasticsearch/EsUtil.java: ########## @@ -87,12 +93,129 @@ public static JSONObject getJsonObject(JSONObject jsonObject, String key, int fr } } + /** + * Get boolean field, if parse error throw DdlException. + **/ public static boolean getBoolean(Map<String, String> properties, String name) throws DdlException { String property = properties.get(name).trim(); try { return Boolean.parseBoolean(property); } catch (Exception e) { - throw new DdlException(String.format("fail to parse %s, %s = %s, `%s` should be like 'true' or 'false', value should be double quotation marks", name, name, property, name)); + throw new DdlException(String.format( + "fail to parse %s, %s = %s, `%s` should be like 'true' or 'false'," + + " value should be double quotation marks", + name, name, property, name)); + } + } + + /** + * Parse the required field information from the json. + * + * @param searchContext the current associated column searchContext + * @param indexMapping the return value of _mapping + */ + public static void resolveFields(SearchContext searchContext, String indexMapping) throws DorisEsException { + JSONObject properties = + getMappingProps(searchContext.sourceIndex(), searchContext.esTable().getName(), indexMapping, + searchContext.type()); + for (Column col : searchContext.columns()) { + String colName = col.getName(); + // if column exists in Doris Table but no found in ES's mapping, we choose to ignore this situation? Review Comment: done. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org