wuyunfeng commented on code in PR #11547:
URL: https://github.com/apache/doris/pull/11547#discussion_r939795388


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/EsExternalDataSource.java:
##########
@@ -166,7 +167,10 @@ public List<String> listDatabaseNames(SessionContext ctx) {
 
     @Override
     public List<String> listTableNames(SessionContext ctx, String dbName) {
-        return esRestClient.getIndexes();
+        List<String> indexes = 
esRestClient.getIndexes().stream().distinct().collect(Collectors.toList());

Review Comment:
   I think maybe package this line into esRestClient is better, provide 
`listTable` method



##########
fe/fe-core/src/main/java/org/apache/doris/datasource/EsExternalDataSource.java:
##########
@@ -37,14 +37,15 @@
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * External data source for elasticsearch
  */
 @Getter
 public class EsExternalDataSource extends ExternalDataSource {
 
-    public static final String DEFAULT_DB = "default";
+    public static final String DEFAULT_DB = "default_es_db";

Review Comment:
   can we use the  `cluster_name`_`uuid` for DB?



##########
fe/fe-core/src/main/java/org/apache/doris/external/elasticsearch/EsUtil.java:
##########
@@ -168,7 +171,7 @@ public static JSONObject getMappingProps(String 
sourceIndex, String indexMapping
         if (rootSchema == null) {
             properties = (JSONObject) mappings.get("properties");
             // Compatible es6 with no type passed in.
-            if (mappingType == null) {
+            if (mappingType == null && properties == null) {

Review Comment:
   && properties == null maybe not necessary, you check the context again
   



-- 
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

Reply via email to