Zizzipupp
Zizzipupp

Reputation: 1361

Azure Data Factory: trivial SQL query in Data Flow returns nothing

I am experimenting with Data Flows in Azure Data Factory.

I have:

  1. Set up a LinkedService to a SQL Server db. This db only has 2 tables.
  2. The two tables are called "dummy_data_table1" and "dummy_data_table1" and are registered as Datasets
  3. The ADF is copying data from these 2 tables, and in the Data Flow they are called "source1" and "source2"

However, when I select a source, go to Source options, and change Input from Table to Query and enter a simple query, it returns 0 columns (there are 11 columns in dummy_data_table1). I suspect my syntax is wrong, but how should I change it?

Hopefully this screenshot will help. enter image description here

Upvotes: 1

Views: 842

Answers (1)

Zizzipupp
Zizzipupp

Reputation: 1361

The problem was not the syntax. The problem was that the data flow could not recognize "dummy_data_table1" because it didn't refer to anything known. To make it work, I had to:

  1. Enable Data Flow Debug (at the top of the page, not visible in my screenshot)
  2. Once that's enabled, I had to click on "import projection" to import the schema of my table

Once this is done, the table name and fields are all automatically recognized and can be referenced to in the query just like one would do in SQL Server.

Source: https://learn.microsoft.com/en-us/azure/data-factory/data-flow-source#import-schema

Upvotes: 2

Related Questions