Forum Discussion
About Pipeline Query
- Anonymous8 months ago
Hi kye1crystal ,
Thank you for clarifying. The T-SQL Query option shown in your screenshot is only available in the Copy Data activity when using the Lakehouse SQL analytics endpoint.
For the Lookup activity, this option isn't supported with Lakehouse connections. Lookup can reference only Tables or Files, which is why you don't see the query textbox.
If you want to run a query as part of your Lookup logic, you can use the Azure SQL Database connector and connect it to the Lakehouse SQL analytics endpoint. This way, Lookup will support T-SQL queries.
I hope this explains the behavior.
Thank you.
In Fabric Data Pipeline β Lookup activity:
When you connect Lakehouse and select Table
Fabric does NOT show a βQueryβ option
π Because Lookup with Lakehouse only supports table-level access, not custom SQL queries.
Important Limitation (Key Point)
π΄ Lookup activity in Fabric does NOT support SQL queries on Lakehouse tables
Thatβs why:
You only see Table
No Query textbox appears
You cannot write SELECT MAX(watermark) directly
---
How to Handle Watermark for Incremental Load (Correct Ways)
β Option 1: Use Lakehouse Table with Single Row
Best & simplest approach.
Design your watermark table like this:
watermark_value
2024-12-01 00:00:00
Then in Lookup:
Source: Lakehouse
Table: watermark_table
First row only: β enabled
You can access it using:
@activity('Lookup_Watermark').output.firstRow.watermark_value
β No query needed
β Fully supported
---
β Option 2: Use Notebook activity (Recommended for flexibility)
If you need:
MAX()
filtering
complex logic
Then:
1. Use Notebook activity
2. Run Spark SQL:
SELECT MAX(watermark_value) AS watermark FROM watermark_table
3. Return the value
4. Use it in the pipeline via notebook output
β Most flexible
β Best practice for complex logic
---
β Option 3: Use Warehouse instead of Lakehouse
If your watermark table is in a Fabric Warehouse:
Lookup β Source = Warehouse
You will see βQueryβ
You can write SQL normally
---
Summary (Quick Answer)
Scenario Query Visible?
Lakehouse + Lookup β No
Warehouse + Lookup β Yes
Notebook + Lakehouse β Yes
---
Recommended Architecture for Incremental Load
β Watermark table = 1 row only
β Use Lookup (table) OR Notebook
β Do not expect SQL Query option in Lakehouse Lookup
How you want to update watermark
Iβll design the exact incremental pipeline flow for you step by step π