Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BugFix] Fix the bug where the es catalog cannot view the es6 table #30608

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
修改代码,判断es6的index的mappings有多个key的情况
Signed-off-by: yeyudefeng <yu.qiu@clife.cn>
  • Loading branch information
yeyudefeng committed Sep 11, 2023
commit 0c385cd25cc9be35a1c17a340e6ff427fbc1d014
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.TimeZone;

public class EsUtil {
Expand Down Expand Up @@ -231,7 +232,12 @@ private static JSONObject parseMappingsElement(String indexMapping) {
* @return
*/
private static JSONObject parsePropertiesRoot(JSONObject mappings) {
String element = mappings.keySet().iterator().next();
Set<String> keySet = mappings.keySet();
// 移除es6 动态模板导致的 mappings里面的json多的key
if (keySet.size() > 1) {
keySet.remove("_default_");
}
String element = keySet.iterator().next();
if (!"properties".equals(element)) {
// If type is not passed in takes the first type.
return (JSONObject) mappings.get(element);
Expand Down