clickhouse-client import file not found - linux

I'm trying to import the example data from the link but when I run the below command it can't find the csv file, Error: -bash: full_dataset .csv: No such file or directory and installed with clickhouse docker.
Where do I need to keep the "full_dataset.csv" file?

You need to either supply entire path or move the CSV file to clickhouse bin folder where the clickhouse-client resides.

I solved this problem by moving the "full_dataset.csv" file to the "root" directory.

you need to download the csv dataset from the link and then only execute the code on the clickhouse documentation page, this is indicated https://recipenlg.cs.put.poznan.pl/dataset

Related

getting a spec file instead of a exe with pyinstaller [duplicate]

I am completely new to python and trying to create an application (or .exe) file for python using pyinstaller. I ran the command pyinstaller -[DIRECTORY].py and it saved it to an output directory "C:\Windows\System32\Dist\Foo", however when i tried to locate the directory it did not seem to exist (Dist).
NOTE: i'm trying to convert a .py file to .exe file in Python 3.5
Thanks for any help :)
If you set your command directory to the .py script location and run pyinstaller yourscript.py, it will generate folders in the same location as your script. The folder named dist/ will contain the .exe file.
Could you please try easily the command:
`pyinstaller yourscript.py`
You will get your output folder anyway if everything is correct with your software/module.
Second you can have no rights into System32 folder, so you could try a different folder.
Third you might have inconsistency with the path \ or /.
Hope those three suggestions will lead you to the correct solution :-)
Have a nice day.

Pyspark list files by filtetypes in a directory

I want to list files by filetypes in a directory. The directory has .csv,.pdf etc files types and I want to list all the .csv files.
I am using the following command
dbutils.fs.ls("/mnt/test-output/*.csv")
I am expecting to get the list of all csv files in that directory.
I am getting the following error in databricks
java.io.FileNotFoundException: No such file or directory: /test-output/*.csv
Try using a shell cell with %sh. You can access DBFS and the mnt directory from there, too.
%sh
ls /dbfs/mnt/*.csv
Should get you a result like
/dbfs/mnt/temp.csv
%fs is a shortcut to dbutils and its access to the file system. dbutils doesn't support all unix shell functions and syntax, so that's probably the issue you ran into. Notice also how when running the %sh cell we access DBFS with /dbfs/.
I think you're mixing DBFS with local file system. Where is /mnt/test-output/*.csv?
If you're trying to read from DBFS then it will work.
Can you try running dbutils.fs.ls("/") to ensure that /mnt exist in DBFS.

Untar file in specific directory

I try to download a tar.gz file and uncompress it on /tmp/apps.
However i don't want to uncompress it if the directory already exists.
If the file exists or even doesn't exist it is downloaded and uncompressed.
I cant find my code is missing a parameters on my exec block or if I made a mistake somewhere else.
I'm using Puppet 3.8.
Gist file of my puppet
Use the puppet/archive module, https://forge.puppet.com/puppet/archive. It will download the archive, check for existing files and even tidy up after itself.

how to always open a file in your project folder

Right now, whenever I open a file in my python folder, I would have to do this:
f = open("/Users/LazyLinh/PycharmProjects/TimeGenGUI/mass.mas12.txt", "r")
Even though TimeGenGUI is my python folder, and the file mass.mas12.txt does show up under my project files. Is there a way I can always address this file as part of my python folder or find the full directory of this file, as the full directory can change if I change the folder's location?
Thank you!
Oh thanks to #zondo's recommendation, I've figured out the problem. My __init__.py is in a package under TimeGenGUI, so as soon as I put the file into the folder for this package instead of parent folder TimeGenGUI, I can use open("mass.mas12.txt", "r")!

jd-gui stops working when I try to save all resources

I opened a jar file in jd-gui but when I try to save the all resources it stops working. I don't know where to look for the logs of jd-gui.
How can I save all the decompiled source files?
I met the same problem, and resoled it as below:
unzip the target jar file.
remove unnecessary folder
zip the remaining class files into a new-small jar file.
download the jd-cli project from here: https://github.com/kwart/jd-cli/releases/tag/jd-cli-1.2.0
use jd-cli to de-compile the jar , and with the log option, e.g.
jd-cli target.jar -od jar_result -g ALL
check the output log and find out which block.class file block the de-compile proccess. if there is, then remove it from the target.jar and then re-run the jd-cli again. You can manually copy/paste the block.class source code from jd-gui.
Open "jd-gui.cfg" with a text editor. "LastUri", in section "Decompilation", contains the name of the CLASS file causing the crash. A workaround is to open the JAR file and remove or change extension of this CLASS file.
Regards.
It seems a bug. I solved it simply trying to export sources to other folder ($home -using debian-)

Resources