liujiwen-up commented on code in PR #31580:
URL: https://github.com/apache/superset/pull/31580#discussion_r1896656304
##########
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 uri.database and "." in uri.database:
+ current_catalog, _ = uri.database.split(".", 1)
+ else:
+ current_catalog = "internal"
+
+ # In Apache Doris, each catalog has an information_schema for BI tool
+ # compatibility. See: https://github.com/apache/doris/pull/28919
+ adjusted_database = ".".join(
+ [catalog or current_catalog or "", "information_schema"]
+ ).rstrip(".")
Review Comment:
@villebro Thanks for your advice. After in-depth testing with Doris, we
found that there is still a problem. The previous test only tested the case of
linking data sources. When operating on SQL Lab, it will also go to this
function and cannot use the information_schema library fixedly. When there is a
schema value, the user-provided schema should be used for querying. This
implementation is the correct behavior at present.
1. When linking data sources, the schema is empty and the information_schema
library is used uniformly
2. When the schema has a value, the schema value provided by the user is used
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]