1

I need load some text from one file and choose specific records from another where one of second file columns is equalt to text loaded from first file.

I'm trying with something like that but actually it doesn't work.

@countryName =
    EXTRACT City string
    FROM "/TestCatalog/test.txt"
    USING Extractors.Text();

@result =
    SELECT CityName,
           Temperature,
           MeasurmentDate
    FROM @readEmployee
    WHERE CityName IN(@countryName);

What is the best way to pass some parameters to where expression ( readed from another file in azure data lake ) ?

2 Answers 2

2

Variables in U-SQL which are assigned to with EXTRACT or SEELCT are rowsets, rather than scalar variables. Therefore use SEMIJOIN to do this, for example:

@output =
    SELECT re.CityName,
           re.Temperature,
           re.MeasurmentDate
    FROM @readEmployee AS re
            SEMIJOIN @countryName AS c ON re.CityName == c.City;
Sign up to request clarification or add additional context in comments.

5 Comments

It's works perfect, but maybe you know what can I do if i want select for example Temperature that is bigger than first value from loaded row and lower than second value loaded row.
Can you provide some sample data and expected results? Probably as a separate question ...
In my txt file i want put two variables ( maybe date or some int/double ). Then i want use this value to specific range of intresting parameter like temperature or measurmentdate.
I want create something similiar to this: Select CityName,Temperature,MeasurmentDate where Temperature > par1 nad Temeprature <par2
Sorry, it's really not clear to me from those comments what you want. Please post a separate question with sample data and expected results. I am sure someone will be able to help you.
0

EXTRACT this other file into another rowset, and JOIN both rowsets together.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.