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

Compatibility Issues with Aliyun MaxCompute after Upgrading Superset to 4.0 #28160

Open
3 tasks
Smallhi opened this issue Apr 20, 2024 · 0 comments
Open
3 tasks

Comments

@Smallhi
Copy link

Smallhi commented Apr 20, 2024

Bug description

We are currently utilizing Aliyun MaxCompute as our database specification. However, after our recent upgrade to Superset version 4.0, we have encountered several issues.

Superset appears to be incompatible with tables formatted as 'sales.dwd_user_action'. The existing datasets cannot be reached through Superset. However, by manually modifying the database entry to 'dwd_user_action', the table becomes accessible.

When attempting to create a dataset for the 'dwd_user_action' table, which contains a large number of columns, Superset fails with the following error message:
"The SQL is invalid and cannot be parsed. Unable to load columns for the selected table. Please select a different table."

Due to this being a production environment, I have temporarily made changes to the code in helpers.py, but this is not a sustainable solution.

We request assistance in resolving these compatibility issues. Your help would be greatly appreciated.

Thank you for your attention to this matter.

def get_query_str_extended(
        self,
        query_obj: QueryObjectDict,
        mutate: bool = True,
    ) -> QueryStringExtended:
        sqlaq = self.get_sqla_query(**query_obj)
        sql = self.database.compile_sqla_query(sqlaq.sqla_query)
        sql = self._apply_cte(sql, sqlaq.cte)
        try:
            if 'maxcompute' == self.db_engine_spec.engine:
                sql = sqlparse.format(sql, reindent=True)
            else:
                sql = SQLStatement(sql, engine=self.db_engine_spec.engine).format()
        except SupersetParseError:
            logger.warning("Unable to parse SQL to format it, passing it as-is"

How to reproduce the bug

  1. pip install pyodps
  2. use odps datasource
  3. import dataset
  4. we can't import table like 'sales.dwd_user_action' but 'dwd_user_action' is ok

Screenshots/recordings

No response

Superset version

4.0.0

Python version

3.9

Node version

16

Browser

Chrome

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant