You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "betodealmeida (via GitHub)" <gi...@apache.org> on 2025/01/06 16:47:17 UTC

Re: [PR] feat(doris): add catalog support for Apache Doris [superset]

betodealmeida commented on code in PR #31580:
URL: https://github.com/apache/superset/pull/31580#discussion_r1904387290


##########
superset/db_engine_specs/doris.py:
##########
@@ -245,17 +248,45 @@ def adjust_engine_params(
         catalog: Optional[str] = None,
         schema: Optional[str] = None,
     ) -> tuple[URL, dict[str, Any]]:
-        database = uri.database
-        if schema and database:
-            schema = parse.quote(schema, safe="")
-            if "." in database:
-                database = database.split(".")[0] + "." + schema
-            else:
-                database = "internal." + schema
-            uri = uri.set(database=database)
-
+        if catalog:
+            pass
+        elif uri.database and "." in uri.database:
+            catalog, _ = uri.database.split(".", 1)
+        else:
+            catalog = "internal"
+
+        # In Apache Doris, each catalog has an information_schema for BI tool
+        # compatibility. See: https://github.com/apache/doris/pull/28919
+        schema = schema or "information_schema"
+        database = ".".join([catalog or "", schema])

Review Comment:
   Looks like the `catalog or ""` is not needed here, since `catalog` has to be a string (if a `None` is passed then it's a string either from line 254 or 256). So if it is falsy, it has to be an empty string already.
   
   ```suggestion
           database = ".".join([catalog, schema])
   ```



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org