Replies: 9 comments
-
|
Hey there, @ishirvani! I'm here to help you with any bugs, questions, or contributions you have. Let's tackle this together! 😊 I found a similar unsolved discussion regarding the integration of SQL Server Analysis Services (SSAS) with Apache Superset. You can check it out here: Add Support for SQL Server Analysis Services (SSAS) Connection with MDX Query Execution, Dimension Management, Pivot Tables, and Domain User Login [1]. To enhance Apache Superset to support SSAS with features like MDX query execution, dimension and database management, pivot table functionalities, and domain user login, you would need to create a new DB engine spec for SSAS. Here is a high-level approach:
Here is a simplified example of what the new DB engine spec might look like: # superset/db_engine_specs/ssas.py
from superset.db_engine_specs.base import BaseEngineSpec
class SSASEngineSpec(BaseEngineSpec):
engine = 'ssas'
engine_name = 'SQL Server Analysis Services'
@classmethod
def execute(cls, cursor, query, **kwargs):
# Implement MDX query execution logic
cursor.execute(query)
return cursor.fetchall()
@classmethod
def get_dimensions(cls, cursor):
# Implement logic to fetch dimensions
cursor.execute("SELECT * FROM $system.DISCOVER_DIMENSIONS")
return cursor.fetchall()
@classmethod
def get_databases(cls, cursor):
# Implement logic to fetch databases
cursor.execute("SELECT * FROM $system.DISCOVER_CATALOGS")
return cursor.fetchall()
# Add more methods as needed to support other functionalities
# superset/config.py
from superset.db_engine_specs.ssas import SSASEngineSpec
DATABASES = {
'ssas': SSASEngineSpec,
# other database specs
}For domain user login, you can configure LDAP authentication in the # When using LDAP Auth, setup the LDAP server
AUTH_LDAP_SERVER = "ldap://ldapserver.new"This is a simplified example, and the actual implementation would require more detailed handling of SSAS-specific features and integration points [2][3][4]. |
Beta Was this translation helpful? Give feedback.
-
|
Hello, I am working on adding support for SQL Server Analysis Services (SSAS) to Apache Superset, with the goal of connecting via domain user authentication and ensuring that once connected, the user can view the full set of data, including databases and dimensions. Here’s what I’ve done so far: Creating a new DB engine spec: I’ve implemented an initial version of a custom engine spec for SSAS that includes MDX query execution and fetching metadata like dimensions and databases. Here’s the implementation I’ve started with: python class SSASEngineSpec(BaseEngineSpec): Integrating domain user authentication: My goal is to connect to SSAS using domain user credentials (via Kerberos or LDAP). I want to ensure that once the domain user is authenticated, they can view the entire dataset (databases and dimensions) available in SSAS. Testing and displaying data: After the successful connection, the user should be able to explore the SSAS databases and dimensions through Superset's interface, including using MDX queries. I would like some guidance on: How to correctly configure the SSAS connection in Superset for domain user authentication, ensuring that it works with Kerberos or LDAP. Thank you for your support. |
Beta Was this translation helpful? Give feedback.
-
|
To correctly configure the SSAS connection in Apache Superset for domain user authentication using Kerberos or LDAP, and ensure the connection is fully registered and usable, follow these steps: 1. Install the Required Database DriverEnsure you have the necessary driver for SSAS. Since SSAS is not explicitly listed, you may need to find a compatible SQLAlchemy dialect and Python driver for SSAS. 2. Configure Kerberos AuthenticationIn the {
"auth_method": "kerberos",
"auth_params": {
"service_name": "superset",
"config": "/path/to/krb5.config"
}
}Ensure you have the pip install trino[kerberos]3. Configure LDAP AuthenticationIf you prefer LDAP, you will need to configure it similarly in the 4. Register the ConnectionAfter configuring the authentication, register the connection through the Superset web UI:
5. Display the Entire SSAS DataOnce the connection is successfully tested and saved, Superset should be able to display all databases and dimensions available in SSAS to the authenticated user. Example Configuration for Kerberos in the
|
Beta Was this translation helpful? Give feedback.
-
|
Here's the final version with a request for community help at the end: Title: Issue with loading SSASEngineSpec - "Could not load database driver: SSASEngineSpec" Hi Apache Superset team, I am working on adding support for SQL Server Analysis Services (SSAS) to Superset. I have implemented a new class called The code I implemented:from typing import Any, Optional
from datetime import datetime
from superset.db_engine_specs.base import BaseEngineSpec
class SSASEngineSpec(BaseEngineSpec):
engine = "ssas"
engine_name = "SQL Server Analysis Services"
@classmethod
def execute(cls, cursor: Any, query: str, **kwargs: Any) -> Any:
cursor.execute(query)
return cursor.fetchall()
@classmethod
def get_dimensions(cls, cursor: Any) -> list[tuple[Any, ...]]:
cursor.execute("SELECT * FROM $system.DISCOVER_DIMENSIONS")
return cursor.fetchall()
@classmethod
def get_databases(cls, cursor: Any) -> list[tuple[Any, ...]]:
cursor.execute("SELECT * FROM $system.DISCOVER_CATALOGS")
return cursor.fetchall()
@classmethod
def convert_dttm(cls, target_type: str, dttm: datetime) -> Optional[str]:
return f"'{dttm.isoformat()}'"
@classmethod
def fetch_data(cls, cursor: Any, limit: Optional[int] = None) -> list[tuple[Any, ...]]:
if not cursor.description:
return []
return super().fetch_data(cursor, limit)My questions:
Additionally, I am trying to connect to SSAS using the following connection string format: Does this format look correct for SSAS connections in Superset? I would greatly appreciate any guidance or documentation on resolving this error. Help from the community:If anyone in the community has experience integrating SSAS with Superset, your input would be incredibly valuable. Any code samples, documentation, or suggestions to help resolve this issue would benefit not just me, but other developers looking to add SSAS support to Superset as well. Thank you for your time and assistance! |
Beta Was this translation helpful? Give feedback.
-
|
To resolve the "Could not load database driver: SSASEngineSpec" error when adding support for SQL Server Analysis Services (SSAS) to Apache Superset, ensure that the 1. Define the SSASEngineSpec ClassEnsure that you have a class 2. Register the SSASEngineSpecMake sure that the Example ImplementationDefine the SSASEngineSpec Class# superset/db_engine_specs/ssas.py
from typing import Any, Optional
from datetime import datetime
from superset.db_engine_specs.base import BaseEngineSpec
class SSASEngineSpec(BaseEngineSpec):
engine = "ssas"
engine_name = "SQL Server Analysis Services"
@classmethod
def execute(cls, cursor: Any, query: str, **kwargs: Any) -> Any:
cursor.execute(query)
return cursor.fetchall()
@classmethod
def get_dimensions(cls, cursor: Any) -> list[tuple[Any, ...]]:
cursor.execute("SELECT * FROM $system.DISCOVER_DIMENSIONS")
return cursor.fetchall()
@classmethod
def get_databases(cls, cursor: Any) -> list[tuple[Any, ...]]:
cursor.execute("SELECT * FROM $system.DISCOVER_CATALOGS")
return cursor.fetchall()
@classmethod
def convert_dttm(cls, target_type: str, dttm: datetime) -> Optional[str]:
return f"'{dttm.isoformat()}'"
@classmethod
def fetch_data(cls, cursor: Any, limit: Optional[int] = None) -> list[tuple[Any, ...]]:
if not cursor.description:
return []
return super().fetch_data(cursor, limit)Register the SSASEngineSpecEnsure the # superset/db_engine_specs/__init__.py
from pathlib import Path
import pkgutil
from importlib import import_module
from superset.db_engine_specs.base import BaseEngineSpec
def load_engine_specs() -> list[type[BaseEngineSpec]]:
engine_specs: list[type[BaseEngineSpec]] = []
# Load standard engines
db_engine_spec_dir = str(Path(__file__).parent)
for module_info in pkgutil.iter_modules([db_engine_spec_dir], prefix="."):
module = import_module(module_info.name, package=__name__)
engine_specs.extend(
getattr(module, attr)
for attr in module.__dict__
if is_engine_spec(getattr(module, attr))
)
# Manually add SSASEngineSpec if not using entry points
from superset.db_engine_specs.ssas import SSASEngineSpec
engine_specs.append(SSASEngineSpec)
# Load additional engines from external modules
for ep in entry_points(group="superset.db_engine_specs"):
try:
engine_spec = ep.load()
except Exception: # pylint: disable=broad-except
logger.warning("Unable to load Superset DB engine spec: %s", ep.name)
continue
engine_specs.append(engine_spec)
return engine_specsConnection String FormatThe connection string format for SSAS should be verified against the specific driver you are using. A common format might look like: Ensure that the driver you are using supports this format and that all necessary parameters are included. By ensuring that the |
Beta Was this translation helpful? Give feedback.
-
|
Title: "Could not load database driver: SSASEngineSpec" after defining and registering custom engine for SSAS Body: I am facing an issue with adding support for SQL Server Analysis Services (SSAS) to Apache Superset. Despite following the necessary steps to define and register the Error: What I've Done:
Logs:Here are some relevant log entries when attempting to test the connection: Request:I have confirmed that Thank you! |
Beta Was this translation helpful? Give feedback.
-
|
Are you still working on this? I've moved it from a Bug/Issue to an Idea/Discussion. PR still welcomed if you want to pursue this! |
Beta Was this translation helpful? Give feedback.
-
|
@ishirvani can you give a status on this attempt at SSAS MDX ? |
Beta Was this translation helpful? Give feedback.
-
|
I also would be interested to use superset on SSAS |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Apache Superset currently lacks native support for SQL Server Analysis Services (SSAS), a popular OLAP (Online Analytical Processing) platform. Integrating SSAS into Superset with support for MDX (Multidimensional Expressions) queries, dimension and database management, pivot table functionalities, and domain user login would greatly enhance its analytical capabilities.
Motivation
Adding these features to Superset will provide several benefits:
Proposed Solution
Connection Support:
MDX Query Execution:
Dimension and Database Management:
Pivot Table Functionality:
Domain User Login:
Documentation and User Guide:
Testing:
Additional Context
Steps to Implement
Thank you for considering this feature request. Implementing these enhancements will provide significant value to users who depend on SSAS for their business intelligence needs and wish to leverage Apache Superset for advanced analytics.
iman shirvani
Originally posted by @ishirvani in #30182
Beta Was this translation helpful? Give feedback.
All reactions