Ran the two commands in Pyspark- spark.read.table("df1").collect() and spark.table("df1").collect() , both gave same output. What is the difference? - pyspark

Ran the two commands in Pyspark- spark.read.table("df1").collect() and spark.table("df1").collect() , both gave same output. What is the difference?

Related

How do I show the exact command being tested when a pytest script runs?

How is it possible that anyone uses pytest without having it output the exact command that it runs.
I have a set of 5 test scripts with a total of 41 different test combinations. The script functions all basically follow this same template where at some stage, the funciton does:
subprocess.Popen(cmdline_builder(opt, name, options))
When there's a failure, the output is nearly useless, it doesn't show the exact command that was run.
How does anybody use this ? How would you expect to debug a failed test without knowing what to run ?

Long PathClass (input line too large)

I'm trying to execute a .bat file using CMD on windows. the command: D:\Candidate_Retrieval\target\universal\candidate-retrieval-1.0\bin> candidate-retrieval
The error was:
The input line is too long.
The syntax of the command is incorrect.
I opened the .bat file and I found the classpath as follows:
set "APP_CLASSPATH=%APP_LIB_DIR%\..\conf\;
%APP_LIB_DIR%\candidate-retrieval.candidate-retrieval-1.0-sans-externalized.jar;%APP_LIB_DIR%\org.scala-lang.scala-library-2.11.7.jar;%APP_LIB_DIR%\com.typesafe.play.twirl-api_2.11-1.1.1.jar;%APP_LIB_DIR%\org.apache.commons.commons-lang3-3.4.jar;%APP_LIB_DIR%\org.scala-lang.modules.scala-xml_2.11-1.0.1.jar;%APP_LIB_DIR%\com.typesafe.play.play-server_2.11-2.4.8.jar;%APP_LIB_DIR%\com.typesafe.play.play_2.11-2.4.8.jar;%APP_LIB_DIR%\com.typesafe.play.build-link-2.4.8.jar;%APP_LIB_DIR%\com.typesafe.play.play-exceptions-2.4.8.jar;%APP_LIB_DIR%\org.javassist.javassist-3.19.0-GA.jar;%APP_LIB_DIR%\com.typesafe.play.play-iteratees_2.11-2.4.8.jar;%APP_LIB_DIR%\org.scala-stm.scala-stm_2.11-0.7.jar;%APP_LIB_DIR%\com.typesafe.config-1.3.0.jar; ... .jars
I made some search, the solutions could be one of these: https://www.scala-sbt.org/sbt-native-packager/recipes/longclasspath.html.
but I don't know how to apply them. could someone elaborate more in simple steps?
Can longpathtool helps? how?

What could cause a ".json is unexpected at this time" error when running a postman collection from command line using newman

I am attempting to use newman to run postman collection from the command line. I have been successful before, but with this most recent collection I am getting an error. I am using the following command
newman run [urlforjcollection] --reporters cli,json,html --reporter-json-
export C:\outputfile.json --reporter-
html-export C:\outputfile.html -e
c:\QAEnvironment.json
This fails to run and I get the error .json was unexpected at this time. As I said I used this exact command on another collection and it worked fine.
Does anyone know what could case this issue? Is it something wrong with my command or is there some setting in postman that can cause it?
I Googled your error and it seems to be a problem with the command line rather than Postman; specifically, the need to use double quotes while specifying file locations. Try this:
newman run [urlforjcollection] --reporters cli,json,html --reporter-json-
export "C:\outputfile.json" --reporter-
html-export "C:\outputfile.html" -e
"c:\QAEnvironment.json"

how to run a cmd file from matlab

I am trying to run a cmd file from MATLAB but unable to execute it. Can anybody see nay problem in the below code?
this is what I have inside my cmd file:
echo on
>test.log 2>&1 (
C:/testProj/Make/makeit.cmd param1
)
And this is the MATLAB code:
Out = 'C:/testProj/test.cmd';
system(Out);
But this actually does not run the cmd file.
Well for somereason it would not run if i would give the complete path of the cmd in bat file. so I had a cd command to change the directory and then run. now it runs fine, Thanks all appreciate your help!
What about using eval, like this:
eval(['!test.cmd']);
I have succesfully used this to run .bat files (and this output of the .bat script showed in my matlab command line). I also found this dos command, but I am not sure if it works allright:
You can just type the following strings to get things down:
!(c:/testProj/test.cmd)
This is actually no different from
system('c:/testProj/test.cmd')
I think you should check if the path is wrong. As to your code in the cmd file, that's beyond my ability to help.

No output from DOMPDF

I am trying to run DOMPDF from a windows command line. I am using the documentation from the domPDF website as a reference. DOMPDF usage
C:\>php -f C:\dompdf\dompdf.php -- C:\example.html
When I run this command I get nothing. No pdf, no errors, noting. I have tried using the -v and the -d flags to turn the verbosity up. I still get no output, neither to the screen or the command line.
When I run,
C:\>php -f C:\dompdf\dompdf.php -- -l
I actually get a listing of the paper sizes, so PHP is installed and I am correctly calling the dompdf php file.
Does anyone have any ideas on why this would not actually produce output?
The html file is on the C: and has information in it.
Does anyone have any example of running DOMPDF from the command line, or see what I am doing wrong?
Thanks for the help.