rparsonsbb opened a new issue, #30612:
URL: https://github.com/apache/superset/issues/30612
### Bug description
When querying a SQL Server database via the meta database, tables with
`uniqueidentifier` columns are not able to be queries and throw `1002` errors.
The tables are able to be queries when connecting directly via a
`mssql+pymssql://` database connection.
Easy reproduction:
1. Create a few dummy tables in a sql server database:
```
-- Create the TestUsers table with a uniqueidentifier column
CREATE TABLE Users (
UserID UNIQUEIDENTIFIER DEFAULT NEWID() NOT NULL, -- uniqueidentifier
column
FirstName NVARCHAR(50) NOT NULL,
LastName NVARCHAR(50) NOT NULL,
Email NVARCHAR(100) NOT NULL
);
-- Create the TestProducts table without a uniqueidentifier column
CREATE TABLE Products (
ProductID INT IDENTITY(1,1) NOT NULL PRIMARY KEY, -- Auto-incrementing
integer column
ProductName NVARCHAR(100) NOT NULL,
Price DECIMAL(10, 2) NOT NULL
);
```
2. Add data
```
-- Insert 10 rows of dummy data into the Users table
INSERT INTO TestUsers (FirstName, LastName, Email)
VALUES
('John', 'Doe', '[email protected]'),
('Jane', 'Smith', '[email protected]'),
('Bob', 'Johnson', '[email protected]'),
('Alice', 'Williams', '[email protected]'),
('Tom', 'Brown', '[email protected]'),
('Nancy', 'Davis', '[email protected]'),
('Chris', 'Miller', '[email protected]'),
('Megan', 'Wilson', '[email protected]'),
('Luke', 'Moore', '[email protected]'),
('Emily', 'Taylor', '[email protected]');
-- Insert 10 rows of dummy data into the Products table
INSERT INTO TestProducts (ProductName, Price)
VALUES
('Laptop', 999.99),
('Smartphone', 699.99),
('Tablet', 299.99),
('Monitor', 199.99),
('Keyboard', 49.99),
('Mouse', 29.99),
('Headphones', 89.99),
('Smartwatch', 199.99),
('Printer', 149.99),
('Camera', 549.99);
```
3. Create the connection for the database in superset
4. Select from the SQL Lab using the MSSQL connection:


5. Select the data using the meta database:


I'm assuming that it has to do with how the meta database handles
`uniqueidentifier` types and a custom class might be needed, but would love
some insight before trying to tackle the PR.
### Screenshots/recordings
_No response_
### Superset version
master / latest-dev
### Python version
3.9
### Node version
16
### Browser
Chrome
### Additional context
_No response_
### Checklist
- [X] I have searched Superset docs and Slack and didn't find a solution to
my problem.
- [X] I have searched the GitHub issue tracker and didn't find a similar bug
report.
- [X] 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.
--
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]