How can I pass a variable between 2 U-SQL scripts - azure

I am trying to filter values in a table using values in another table. Since USQL doesn't allow to use another table with the WHERE IN statement, my thoughts were to use a usql function to create a list of values and then pass that along to my main script.
Any ideas as to how I can pass the necessary variable? I would also be interested if there are other ways of aproaching this problem.

You should try to filter your dataset with SEMIJOIN OR ANTISEMIJOIN in USQL. Its the usql way dealing with IN/NOT IN
Check this

I ended up writing 2 c# functions as code behind to achieve what I want within a single script. The first function actually checks the input table for the values I need and creates a list. I use this function to declare a variable at the begining of my usql script. I then us this list as input to a second function that processes the values in my work table.
This is my current solution and it is working very well. I'm still new to U-SQL so if there is an easier way of doing this I would like to learn about it, so feel free to still contribute to this thread.

Related

Multiple API Queries in Power Query

I am new to Power Query and have just learned how to pull in data from an external API using it. The thing is, that I actually need to make multiple calls to the same API. For example:
http:://my-external-api.com/get-data/set-one?api_key=1234
http:://my-external-api.com/get-data/set-two?api_key=1234
http:://my-external-api.com/get-data/set-three?api_key=1234
Etc.
In theory, this is how I imagine accomplishing this:
Step #1: Create an array of all the sets of data I want for my api.
E.g., setData = ['set-one', 'set-two', 'set-three', ...]
Step #2: Create a URL with a variable in it.
E.g., url = "http:://my-external-api.com/get-data/" & setVar & "?api_key=1234"
Step #3: Loop through this array and URL variable, outputting the data into Power Query.
The thing is, being new to Power Query I do not know how to do this. I have learned a bit of the basics of M Code, but I still am having a hard time figuring out how to do this.
Any ideas?
Thanks.
List item
There are a few ways of looping in PQ ranging from recursive functions to List.Generate(). In this case, I would go with List.Generate() and there is an excellent guide here:
https://gorilla.bi/power-query/list-generate/

Is there a way to use variables in Cucumber Examples data table?

Basically, I was looking for a way to use some kind of Java variable in Cucumber Examples data table. So that post-execution, when a report is generated, I should be able to view the current value of variable used as part of a particular Step in place of the referenced data table cell.
Consider today's date or timestamp, for example, Since I do not want to hard code these variables. Without the use of variables, all scenarios looks the same.
What you are asking for isn't a good practice, just the opposite.
When the code depends on current datetime, it is a good practice to mock the current datetime for testing purpose.
You can either pass the current datetime as an argument, or to inject it.
When testing, you pass a hardcoded datetime, which would be a precondition of the test case.
When running the app in production, you pass the real current datetime.
Java has an useful type for mocking current datetime called Clock.
UPDATE:
Regardless to mock datetime or not, you cannot use variables in Cucumber scenarios because it has no sense. BDD is about providing concrete examples with concrete data. Variables used in scenario outline are just a way to put together multiple scenarios (one for each combination of values we give to variables in a datatable).

How to execute "Stored Procedure" Query in node-oracledb if we are not aware of stored procedure bind parameters?

All the examples in documentation were given with bind variables.But what if, we are going to execute the query(Stored Procedure) which has written by the user.(In this case we will not be aware of what are all the input and output parameters to bind).
I am able to execute all the basic ddl and dml queries. But how to execute stored procedure like queries and what will be the way of retrieving?
Will there be any luck if we use "db-oracle"?
Note: I am new to nodejs and node-oracle-db
Have a look at the following examples:
https://github.com/oracle/node-oracledb/blob/master/examples/plsqlfunc.js
https://github.com/oracle/node-oracledb/blob/master/examples/plsqlproc.js
Also, I don't understand why you would not be aware of the input and output parameters to bind to. It would have to be a VERY dynamic situation for that to be true. It would be similar to saying: we don't know the names of the columns of the table we need to query. I'm not saying it doesn't happen or that there aren't unusual circumstances where this could be an issue, just that it's highly unusual.
In either case, whether you don't know the inputs and outputs of stored procedures or even if you don't know the names of the columns, that's where data dictionary views come in. Try running the following queries to begin exploring the views that may be relevant to you:
For procedures:
select *
from all_procedures;
For arguments:
select *
from all_arguments;

Is it possible to have multiple data sources in coded ui test

I'm trying to set up a Coded UI test and have the desire to pull values from two separate data sources (in this case xml files). I have been doing this with just one data source many times but have a couple questions concerning multiple sources.
Is it possible to have two data sources for the same Coded UI test?
If so, how do you differentiate between them when reading values -
when using just one data source I use the
'this.TestContext.DataRow["blah"].toString();' method.
Thanks in advance for any help
erik
Finally found something (not sure how I missed it the first time) which indicates there can be only one TestMethod attribute per Test method (duh to me). So, I guess my refined question is; is there a way around that limitation? This is a long shot I know but would simplify things. Thanks again.
It is not possible to have more than one Data Source for Single Test, But if your test needs data to be read from two different sources then you can write your custom code to read values from external source in between the test.
i.e. You can have one Data source which controls the iteration of test and other one in your custom code to get value for each iteration of test.
We have tests here which read multiple data sources. You can put the connections to the data sources in a separate class (you can put them in the same function, just call the function once to open them) then reference the data sources from wherever you need them.
As for the [Test Method] issue, the same applies. You can place [Test Method] in the second class before the function with the data sources.

Creating a file that contains the set of inputs in pyqt

I have created a widget with a text bix, a combo box, a checkbox and some pushbottons. I wish to make a record of the set of input given everytime in a file. how do I do that ? Pls suggest.
The easiest and not that bad way imho is by reading the values and serializing them using json. You have to set/get the values individually for each input (with different calls). It's a breeze in fact. Personally, I have made my own 'serializing' function so I keep references to all objects in a list and that function loops the list serializing everything.
Depending on your needs and the complexity of your project you may need something different. Why don't you share some more details?
Best Regards.

Resources