Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Special holiday offer! You and a friend can attend FabCon with a BOGO code. Supplies are limited. Register now.

Reply
kye1
New Member

About Pipeline Query

Hi Team,

I met a problem that when I use Lookup from Fabric Pipeline, linking lakehouse and I can't find the "Query" even I choose Table.
The case is that I create a table to be the watermark to do increamental load but cant find "Query" when using Lookup in Pipeline.
Please help. Thank you guys.

Best Regards,
Kye

1 ACCEPTED SOLUTION
v-tsaipranay
Community Support
Community Support

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.

View solution in original post

12 REPLIES 12
Haseeb9
New Member

 

 

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 🚀

v-tsaipranay
Community Support
Community Support

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.

Thank you @v-tsaipranay 

Srisakthi
Super User
Super User

Hi @kye1 ,

 

There is an option in Copy activity , are you looking for something like this?

Srisakthi_0-1764761794371.png

 

Regards,

Srisakthi

Hi @Srisakthi  ,
Yes , I am looking for this T-SQL Query option in Look-up activity

v-tsaipranay
Community Support
Community Support

Hi @kye1 ,

 

We haven’t received an update from you in some time. Could you please let us know if the issue has been resolved?
If you still require support, please let us know, we are happy to assist you.

 

Thank you.

Hi @v-tsaipranay ,
The priority of this job seems to lower. So I didn't continue. I will update when I keep finding something. Thanks.

v-tsaipranay
Community Support
Community Support

Hi @kye1 ,

Thank you for reaching out to the Microsoft Fabric Community Forum.

 

Could you please let us know if the issue has been resolved? I wanted to check if you had the opportunity to review the information provided by  @NandanHegde and @tayloramy  . If you still require support, please let us know, we are happy to assist you.

 

Thank you.

kye1crystal
Frequent Visitor

Thanks @tayloramy  and @NandanHegde. You guys do help me a lot

Glad it was helpful 🙂




----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com
NandanHegde
Super User
Super User

You can use Azure SQL Db connector and connect to the lakehouse via SQL anlaytics endpoint and then use look up activity and query 




----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com
tayloramy
Community Champion
Community Champion

Hi @kye1

 

THe Lookup activity does not support queries for lakehouses, only Tables and Files. 

 

 I recommend you vote for this idea: Query a lakehouse using LookUP Activity - Microsoft Fabric Community

 

If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.

If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.

Helpful resources

Announcements
December Fabric Update Carousel

Fabric Monthly Update - December 2025

Check out the December 2025 Fabric Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors