microsoft / azuredatastudio

Azure Data Studio is a data management and development tool with connectivity to popular cloud and on-premises databases. Azure Data Studio supports Windows, macOS, and Linux, with immediate capability to connect to Azure SQL and SQL Server. Browse the extension library for more database support options including MySQL, PostgreSQL, and MongoDB.
https://learn.microsoft.com/sql/azure-data-studio
MIT License
7.51k stars 883 forks source link

Fabric Warehouse - "queryinsights" views breaking database project build #25271

Open VitalyMCT opened 5 months ago

VitalyMCT commented 5 months ago

Type: Bug

Fabric Warehouses include 3 SQL views:

Additional details around these views are at Query insights in Fabric data warehousing

The extension imports these views into the database project. This causes the build to break due to invalid references, with errors similar to the below:

"Build error SQL71501: SqlView: [queryinsights].[exec_requests_history] has an unresolved reference to object [queryinsights].[fabric_query_starting]"

One workaround is to remove these views from the project, however, this just pushes the issue downstream: they will be picked up in the comparison results of the next deployment.

image

We can attempt to work around that by switching off the corresponding comparison option, but that's too global of a setting, as it would also impact all other (non-system) schemas:

image

I am unsure as to the most elegant solution for this issue. Perhaps some kind of a special exclusion rule around the "queryinsights" schema during both import and comparison operations?

Additional 3rd party confirmation of the same issue at Updates about Database Projects for Microsoft Fabric:

image

Extension version: 1.4.1 Azure Data Studio version: azuredatastudio 1.47.1 (b6f7beb01f92adaa4b79b6b6f3ac704e95cafe6e, 2024-01-10T02:15:02.628Z) OS version: Windows_NT x64 10.0.22631 Restricted Mode: No Preview Features: Enabled Modes:

System Info |Item|Value| |---|---| |CPUs|12th Gen Intel(R) Core(TM) i7-1280P (20 x 1997)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|31.61GB (15.05GB free)| |Process Argv|| |Screen Reader|no| |VM|0%|
hsalaun commented 5 months ago

Hi,

I'm facing the same issue. Did you try your proposed workaround ? If I uncheck the "Drop objects not in source", these objects stay in the schema compare.

VitalyMCT commented 5 months ago

@hsalaun Which "proposed workaround" are you referring to?

hsalaun commented 5 months ago

The one you propose when you say : "We can attempt to work around that by switching off the corresponding comparison option"

It doesn't have any effect on my schema compare. The queryinsights views are still there.

VitalyMCT commented 5 months ago

The intent of that option is to work after the schema compare stage. Here's its description from the extension:

image

As I mentioned in the original post, playing around with this option is not going to solve the issue around these views messing up the deployment. It needs to be handled cleanly, probably via a collaboration between the Azure Data Studio and Fabric teams.

icdevpeople commented 3 months ago

Came across these issues today - guessing theres no further update yet?

VitalyMCT commented 3 months ago

@corivera Would it be possible to please get an update?