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

Issue while creating chart for Solr #14

Open
rohitpawar2811 opened this issue Dec 27, 2023 · 3 comments
Open

Issue while creating chart for Solr #14

rohitpawar2811 opened this issue Dec 27, 2023 · 3 comments

Comments

@rohitpawar2811
Copy link
Contributor

This query is generated by Superset and is causing errors. After fetching data, we prepare columns and types in the SolrTableReflection class.

However, in the logic for extracting tables, it extracts the name of the alias ['virtual_table']. Subsequently, using the alias name, it calls the /admin/luke API and encounters an error because there is no collection available with the alias virtual_table.

The problematic query is:

SELECT pd AS pd,
       pn AS pn
FROM
  (SELECT productId AS pd,
          productName AS pn
   FROM enterpriseSearch) AS virtual_table
LIMIT 10;
@rohitpawar2811
Copy link
Contributor Author

rohitpawar2811 commented Dec 27, 2023

@aadel
Solution: I believe we need to modify the table-extracting logic in SolrTableReflection so that it extracts the table_name after the FROM clause, rather than the alias name. This adjustment will help prevent this error.

@rohitpawar2811
Copy link
Contributor Author

rohitpawar2811 commented Dec 27, 2023

Can you explain the exact use case of the SolrTableReflection class and why we are iterating over tables here?
In the case of a simple SELECT * FROM table_name, we wouldn't iterate over the loop. Are we handling aliases or Cross Join support use case

for table in tables:
if table not in SolrTableReflection.table_metadata_cache:
session = SolrTableReflection.connection._session

@aadel
Copy link
Owner

aadel commented Dec 27, 2023

Solution: I believe we need to modify the table-extracting logic in SolrTableReflection so that it extracts the table_name after the FROM clause, rather than the alias name. This adjustment will help prevent this error.

Hi @rohitpawar2811 Yes, I think this relates to issue #16 since the library does not currently support Solr aliases.

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

2 participants