how to set app name for SparkR? - sparkr

Does any one know how to set the application name for a SparkR job? I can not find the relevant api at all. The sample code shows the availability of spark after loading the SparkR lib.
library(SparkR)
sparkR.session()
after that you can make the spark.lapply(...) call. How do you set the app name using the spark variable?

The application name is set with the appName argument of sparkR.session(); from the docs:
sparkR.session(master = "", appName = "SparkR",
sparkHome = Sys.getenv("SPARK_HOME"), sparkConfig = list(),
sparkJars = "", sparkPackages = "", enableHiveSupport = TRUE, ...)

Related

Trouble to access azure containers from Azure/databricks

I am having trouble to access Azure container from Azure/Databricks.
I follow instructions from this tuto, so I started to create my container and generate sas.
Then on a databricks notebook I delivered the following command
dbutils.fs.mount( source = endpoint_source, mount_point = mountPoint_folder, extra_configs = {config : sas})
where I replace endppoint_source, mountPoint_folder, sas by the following
container_name = "containertobesharedwithdatabricks"
storage_account_name = "atabricksstorageaccount"
storage_account_url = storage_account_name + ".blob.core.windows.net"
sas = "?sv=2021-06-08&ss=bfqt&srt=o&sp=rwdlacupiytfx&se=..."
endpoint_source = "wasbs://"+ storage_account_url + "/" + container_name
mountPoint_folder = "/mnt/projet8"
config = "fs.azure.sas."+ container_name + "."+ storage_account_url
but I ended with the following exception:
shaded.databricks.org.apache.hadoop.fs.azure.AzureException: shaded.databricks.org.apache.hadoop.fs.azure.AzureException: Container $root in account atabricksstorageaccount.blob.core.windows.net not found, and we can't create it using anoynomous credentials, and no credentials found for them in the configuration.
I cannot figure out why databricks cannot find the root container.
Any help would be mutch appreciated. Thanks in advance.
The storage account and folder exist, as can be seen from this capture, so I am puzzled out.
Using the same approach as yours, I got the same error:
Using the following code, I was able to mount successfully. Change the endpoint_source value to the format wasbs://<container-name>#<storage-account-name>.blob.core.windows.net.
endpoint_source = 'wasbs://data#blb2301.blob.core.windows.net'
mp = '/mnt/repro'
config = "fs.azure.sas.data.blb2301.blob.core.windows.net"
sas = "<sas>"
dbutils.fs.mount( source = endpoint_source, mount_point = mp, extra_configs = {config : sas})
My bad..., I put a "/" instead of "#" between the container_name and the storage_account_url and inverse the order, so the right synthax is:
endpoint_source = "wasbs://"+ container_name + "#" + storage_account_url

Not able to update the tester name in a Test Set from vbscript

I am been trying to search online for a solution but due to lack of knowledge in HP ALM I am not able to search proper hit tags
Set RunFactory = tsTest.RunFactory
Set obj_theRun = RunFactory.AddItem(CStr(testrunname))
obj_theRun.Status = sExecutionStatus '"Passed" '-- Status to be updated
obj_theRun.Tester = strTesterName
Getting error in this line object does not support obj_theRun.Tester
I just want to update the Tester column(Not Responsible tester) in Test set via vbscript. Please refer to the attached image at the very last column (TesterAny help is appreciated. Thank you in advance.
The documentation for ALM says the Tester Name can be specified by passing an array as the argument to AddItem.
https://admhelp.microfocus.com/alm/api_refs/ota/Content/ota/topic8805.html?Highlight=tester
An array consisting of the following elements:
Name - The name of the run (string. required).
Tester - The name of the user responsible (string. optional)
Location - The host name (string. optional). The default is the host name of the current machine
So change your code to this:
Set runFactory = tsTest.RunFactory
Dim newRunArgs(3)
newRunArgs(0) = testrunname ' `testrunname` is already a string so you don't need CStr.
newRunArgs(1) = "tester name goes here"
Set newRunArgs(2) = Nothing
Set newRun = RunFactory.AddItem( newRunArgs )
newRun.Status = sExecutionStatus '"Passed" '-- Status to be updated

iOS Parse Server set server url at runtime without application restart

I tried to set a new parse server url while inside the app, but there was no change what so ever.
Parse.server = #"https://serverNewUrl.com"; or [Parse setServer:#"https://serverNewUrl.com"];
NSLog(#"%#",Parse.server); -----> This prints the new server set
NSLog(#"%#",Parse.currentConfiguration.server); -----> This prints the old one set
How did you achieve the change ? Parse iOS SDK 1.18
Try to use the initialize function. I believe it should work even if you use it a second time to change the server URL.
let parseConfig = ParseClientConfiguration {
$0.applicationId = "parseAppId"
$0.clientKey = "parseClientKey"
$0.server = "parseServerUrlString"
}
Parse.initialize(with: parseConfig)

Refresh system variable using vbscript/QTP

I want to set system variable MQSERVER for connecting to MQ using QTP. Each time this value is changed from QTP, I need to restart QTP to reflect changes.
E.g. in the system variables window,
MQSERVER = ABCD
change the variable using
Set objWSH = CreateObject("WScript.Shell")
Set objSystemVariables = objWSH.Environment("SYSTEM")
objSystemVariables(MQVariableName) = MQVariableValue
The variable is set correctly but does not reflect in QTP code when connecting to websphere MQ.
Immediately when I restart QTP, the QTP reads the env variable correctly. Can you please let me know how I can use the below API method. I am getting type mismatch in QTP.
lnRetVal = SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, "Environment", 2, 1000, Null) 'Getting type mismatch here
Updating my original question with the code that connects to queue manager.
The very basic thing that I am trying to do is (which can't be done without restarting QTP)
1) Connect to a queue manager
2) Put the message
3) Connect to another queue manager
4) Read the output
Const MQOO_OUTPUT = 16
Const MQOO_INPUT_AS_Q_DEF = 1
Set MQS = CreateObject("MQAX200.MQSession")
Set QM = MQS.AccessQueueManager(Environment.Value("MQName")) 'This will pass the queue name and access the queue manager.
Set MQQueue = QM.AccessQueue(strQueName, MQOO_INPUT_AS_Q_DEF Or MQOO_OUTPUT)
Set PutOptions = MQS.AccessPutMessageOptions()
PutOptions.Options = MQPMO_NO_SYNCPOINT
Set PutMsg = MQS.AccessMessage()
PutMsg.CharacterSet = 1208
PutMsg.MessageData = PutMsgStr 'the message text
PutMsg.ApplicationIdData = "INTF_0439B"
MQQueue.Put PutMsg, PutOptions 'write the message to queue.
Also, my websphere MQ version is 7.0.1.8

WinCC export screen data to xls/csv

I am using TIA portal V13, with WinCC RT Advanced. I have been given a running project and need to export some values to excel for the client daily, monthly and yearly using a script. I have a screen with a table control that displays values of tags. The values are logged periodically.
How can I access the values from the screen or data logs using vbs? There is this command in the manual for accessing the dataLogs
HMIRuntime.Logging.DataLogs
But I cannot find how to access the data and save it to a file.
There is already a vbs script in the project(begin and end times are defined earlier in the script)but it just exports an empty csv with the column names but no values.
Set obj1 = obj.ScreenItems("Table view_1")
obj1.TimeColumnRangeType = 1
obj1.TimeColumnBeginTime = sBeginTime
obj1.TimeColumnEndTime = sEndTime
FolderName = "C:\Folder_name"
FileDate = sDay &"_" &sMonth &"_" &sYear
obj1.ExportDirectoryChangeable = True
obj1.ExportDirectoryname = FolderName
obj1.ExportFilenameChangeable = True
obj1.ExportFilename = "Filename " &FileDate
obj1.Export()

Resources