Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
324 views
in Technique[技术] by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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://docs.microsoft.com/en-us/azure/data-factory/data-flow-source#import-schema


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...