I recently have started to use Beelines CLI to interface with a hive server.
The problem is that create file command is failing for me.
I have tried the following:
add FILE[S] 'example.txt';
Which returns this error:
Error: Error while processing statement: null (state=,code=1)
You should remove the quotes from the path. i.e.
beeline> add file example.txt;
Also be sure that you are only adding files to the server hive is running on.
Related
We are executing SQL loader command from shell script on RH Linux OS. The command passes both control file and data file as command line parameters. The syntax used is given below (masked sensitive data):
sqlldr userid=$connstring control=/local/abc-1.2.3/instances/www.abc.com/apps/int/script/bin/ABC_CONTROL.ctl data=$f log=/local/abc-1.2.3/instances/www.abc.com/apps/int/script/logs/ABC.log bad=/local/abc-1.2.3/instances/www.abc.com/apps/int/script/logs/ABC.bad
The data file name is passed as dynamic variable in a FOR loop to process multiple files. The data file extension is *.app and path is /local/abc-1.2.3/instances/www.abc.com/apps/int/script/input.
We have verified that $f variable is able to correctly point to data file. Also verified file permissions. We tried changing the directory paths as well.
Still script fails with below error: **SQL Loader-500 Unable to open file (ABC_CTL.dat)**, SQL Loader-553 File not found, SQL Loader-509 System error: No such file or directory
The same script runs with exact same syntax on another server. Please suggest any solutions.
I am trying to import a sample database "employees.sql" from official phpMyAdmin webpage. I am using uwamp server and getting the following error when using phpMyAdmin "import" option:
Unrecognized statement type. (near "source" at position 0)
.SQL FILE AT LINE WHERE ERROR IS REPORTED:
SELECT 'LOADING departments' as 'INFO';
source load_departments.dump ;
I am not sure what to change to successfully import the database. I also tried different things like putting load_departments.dump in quotes, but it still didn't work.
How do you use MySQL's source command to import large files in windows
must read and you will definitely get many ideas!
I think you should fire source command from cmd (command prompt)
I suggest you to create an empty database and import that sql file inside of it. Check it out..
Assumption: MySQL Server was installed and you have downloaded the employees database from github. Unzip the package and go to the directory from command prompt.
Enter the following command and on prompt, provide the sql password.
mysql -u root -p -t < employees.sql
Verify your installation by entering the following command.
mysql -u root -p -t < test_employees_md5.sql
I'm getting the following exception while trying to start the hive in Ubuntu 14.04 LTS,Caused by: java.sql.SQLException: Failed to create database 'metastore_db', see the next exception for details. Hadoop installation is correct and it's working fine. Please tell me anyone what's problem?
It is because you're not in the same folder where you have created your metadata. I was facing the same problem because I was in my main user folder. When I changed the folder from main user to hduser my hive stated working.
See the mistake
I tried to find the xml file but it was not their so I searched and found where it was.
Similar to #dk14, In my case, I was in a folder on which I had no permission to write as user, moved directory and worked fine.
The reason for above error is, the user through which you are login doesn't have permission to write in that particular directory. I mean the directory in which you are running the schematool command.
For example my setup of Apache Hive was in /opt/apache-hive-3.1.2-bin I ran the command :-
sudo chown -R hadoopusr /opt/apache-hive-3.1.2-bin/
it is happening because you are on the other folder than your hive is installed.
so first of all change directory to the folder where your hive is installed and you and after that try to run hive once again.
and the hive should work properly.
Best of luck.
After spending some(lot) of time I got that issue is with creating that directory metastore_db inside DERBY_HOME/bin path was already there and I didn't had admin access for this you either:
delete that folder by using admin rights.
open hive-site.xml inside HIVE_HOME/conf path open in notepad and check connection string there change the database name to something else, it worked for me.
I'm using Powershell 4 to install SQL 2014. everything goes ok except at the very end where I have a function that will run a script from a .sql file using invoke-sqlcmd. I get the following error:
"The term 'invoke-sqlcmd' is not recognized as the name of a cmdlet, function, script file..."
If I try and import the sqlps module I get:
The specified module 'sqlps' was not loaded because no valid module file was found in any module directory.
But here's the kicker. If I open a separate PowerShell terminal, IT WORKS THERE. :/ and continues to fail in the initial terminal.
I'm trying to understand why this is so any assistance would be greatly appreciated. I'd like to avoid writing in a reboot once script.
Thanks,
Dan
Existing Powershell session isn't aware about Sql's modules that were just installed. Take a look at environment variable $env:PSModulePath. Compare new shell's variable to existing and you should see a missing path like ...\Microsoft SQL Server\110\Tools\PowerShell\Modules\.
For a work-around, modify the path to include module dir. Like so,
$env:PSModulePath += ";c:\some\path\to\sql"
I want to upload .prpt (Pentaho Report File) in Pentaho BI Server. I am using the following command:
./import-export.sh --import --url=https://server/pentaho/ --username=user --password=pass --source=file-system --type=files --charset=UTF-8 --path=/public--file-path=/home/kishan/folder/Clients/abc/Daily_Reports/Prpt/xyz.prpt --logfile=/home/user/upload.log --permission=true --overwrite=true --retainOwnership=true
So, I want to pick up the file located at the file-path value above and upload it to the BI server in the public folder. However, I am getting the following error:
CommandLineProcessor.ERROR_0001 - Missing Arguments: file-path
Why is it saying this even though I have this argument in the command above.
I got it working. Here's the command that worked for me:
./import-export.sh --import --url=http://localhost:8080/pentaho --username=admin --password=password --charset=UTF-8 --path=/public --file-path=/home/some_directoryN/Daily_Reports/Prpt/xyz.prpt --logfile=/home/kishan/upload.log --permission=true" + "--overwrite=true --retainOwnership=true
So, for this to work you need the file on the server file system (file-path argument) to which you want to upload the file. path argument is the path on BI server where you want to upload the report