how to pass an external property into a hive udf - hive

I am writing a hive UDF in which I have to call an REST API and return an array of String. I have written the function with hardcoded REST API url. But now to make the endpoint configurable I want to take the host property out and put it in a config. Is it possible? If yes, then how can pass this?

Can you do change your UDF to take the host as part of its input, and then use variable substitution in Hive:
SET host=todayshosturl
SELECT TRANSFORM ${hiveconf:host}, line
USING 'python myudf.py' AS (line)
FROM
yourtable;

Related

Passing parameters while calling a scenario from another feature flie in karate?

I know how to call specific scenario from another feature file and pass parameters along. But is there a way I can do it while checking for condition using 'if'?
For instance:
* if (role=="SME"||role=="BA") karate.call('classpath:rough/utility.feature#checkDisabled'){element: #(elem)}
If this is the wrong implementation as what I get from the console. Please suggest me a way how can i achieve this in karate?
Thanks
When you use karate.call() put the second argument inside the round brackets. This is pure JS and "Karate-style" embedded expressions will not work.
* if (role=="SME"||role=="BA") karate.call('classpath:rough/utility.feature#checkDisabled', {element: elem})
Please take some time to read this part of the docs: https://github.com/karatelabs/karate#call-vs-read

Needed: Excel function that accepts Power Automate Desktop "List" as function parameter

I'm trying to get a function working that will accept a Power Automate Desktop "List" as a function parameter. I believe the documentation compares a list to a one-dimensional array but when try and pass a list as a function parameter it fails. Passing the List item by item - i.e., List[0], List[1] works but is obviously not ideal.
Has anyone a solution for this? Would be helping a brother out! Cheers
You have to pass a delimiter (e.g. ",", "$" etc.) separated string from Cloud Flow and then use Split() function to create array from string input inside Desktop Flow. There is no other way as of now
From Cloud Flow :- "4141431,4342342,4323243"
Inside Desktop Flow :- Input1.Split(",")

Access FlowVar dynamically in DataWeave

I'm trying to access a FlowVar name dynamically in DataWeave.
For example:
I have a flowVars named taxInfo123. This is a linked list and my applicant.ApplicantID = 123
In my dataweave, I want to access this dynamically. Something like the following:
"TaxInfo": flowVars.'taxInfo'+applicant.ApplicantID map ((taxIdentificationDetail , indexOfTaxIdentificationDetail) -> {
This obviously doesn't work, and I'm hoping this is possible and I just need the correct syntax.
If you need to dynamically create the variable name, you can use the flowVars[key] syntax instead of the flowVars.key syntax. In your scenario:
"TaxInfo": flowVars[('taxInfo' ++ (flowVars.applicant.ApplicantID as :string))]
I assumed applicant was also a flowVar but you could just as easily use payload.applicant.ApplicantID or whatever your situation calls for. I also assumed it was a number so I had to cast it as a string.
When you use this syntax you want to make sure you wrap the key expression in parenthesis so it is evaluated first and then the flowVar is resolved.
So to summarize:
If you know the variable name is 'taxInfo123' -
flowVars.taxInfo123 or flowVars[taxInfo123] are both valid
If you need to create the variable name dynamically -
flowVars[(expression)]
Hope that helps!
Forming the variable name needs append operator like ++. Please go through the MuleSoft documentation for Dataweave operators to get better understanding of how much flexiblity is possible in Dataweave.
https://docs.mulesoft.com/mule-user-guide/v/3.8/dataweave-operators

How to pass array of struct(User defined data type) as an input to call procedure in mule

In my project we have a requirement where we have to insert an array of struct as an input parameter.How i can achieve that.
I don't want to use the approach suggested here
https://dzone.com/articles/passing-java-arrays-in-oracle-stored-procedure-fro
I want to use the inbuilt objects given in mule.
we have to insert an array of struct as an input parameter
Where you want to insert this array ?
array of struct
can we consider the User defined data type as POJOs ( just java object?) ?
I want to use the inbuilt objects given in mule.
As I can see in the link, the example use Java + Mule component. Should I guess that you want to avoid Java code?
Please, elaborate your use case... hard to replicate

changing the parameter value in IparameterInspector WCF RESTful

I am trying to change the value of the parameter in IParameterInspector while doing the validation. The parameters that are string, works fine. But I need int as parameters. and if the parameter is not supplied in the RESTful call, I need to default it.
If the url does not contain anything for int parameter, it fails. However, in the same case of string parameter, if its not supplied, it takes the default values.
I use querystring format for passing the parameters. and I am just trying to run it on the browser.
Is there any way for this to work? or do I need to make all the parameters as string.
Thanks in Advance!
You need to make the parameters string. This will be fixed in the next version of the WCF Web APIS http://wcf.codeplex.com