Cannot create Temporary Table in Hive using Dbvisualizer - hive

When I run the command ->
create temporary table temp_sbm_test as select * from tablename limit 1;
I am getting below error in DBVisualizer.
Can someone explain why the temporary table is going to a database in HIVE database not temporary location?
[Code: 40000, SQL State: 42000] Error while compiling statement: FAILED: HiveAccessControlException Permission denied: user [userid] does not have [CREATE] privilege on [somedatabse/temp_sbm_test]

Related

Dynamically drop partition in hive sql

I need to drop data from the table which is older than 6 months, this needs to be part of a job and run everyday. I am using the below code
ALTER TABLE ab_test_cart_sbu_tableau_test_2 DROP IF EXISTS PARTITION (partition_day = add_months(current_date(),-6))
and getting the following error
Error: Error while compiling statement: FAILED: ParseException line
1:104 cannot recognize input near 'add_months' '(' 'current_date' in
constant (state=42000,code=40000)
ALTER TABLE ab_test_cart_sbu_tableau_test_2 DROP IF EXISTS PARTITION (partition_day = add_months(current_date(),-6))

pgpointcloud backup fails due to a missing relation

I'm trying to backup a schema of only pointclouds, I try to use the built in backup in pgadmin4 and I receive the following error. It complains that ERROR: relation "pointcloud_formats" does not exist I test the select schema, srid from pointcloud_formats where pcid = 1 query and it returns without issue. Any ideas?
pg_dump: Dumping the contents of table "pc_0201507091159" failed: PQgetResult() failed.
pg_dump: Error message from server: ERROR: relation "pointcloud_formats" does not exist
LINE 1: select schema, srid from pointcloud_formats where pcid = 1
^
QUERY: select schema, srid from pointcloud_formats where pcid = 1
pg_dump: The command was: COPY pointcloud_99_526.pc_0201507091159 (id, pa) TO stdout;

hive insert into query from CLI not working

I'm trying to insert into statement from CLI but getting following error. If I run the same query in hive prompt records are getting inserted. Any help would appreciated. I'm using hive 2.x version.
hive -e "insert into table dim.mpp_dim_count (run_date ,run_type , count1,count2 ,dup_check_all_dim ,fact_dim_sk_match ) values ('05-04-2019','before',100,100,'Y','Y')"
FAILED: SemanticException [Error 10293]: Unable to create temp file
for insert values AlreadyExistsException(message:Table
Values__Tmp__Table__1 already exists.)

TABLE DROP statement

I am trying to drop a table that I created in SQL Server. I typed the command as follows:
DROP TABLE [Exercise2].
I received the following error message:
Msg 3701, Level 11, State 5, Line 1
Cannot drop the table 'Exercise2', because it does not exist or you do not have permission.
I have dropped multiple tables trying to clean out my database, but this one will not drop and I'm not sure why.

Failing update table in db2 with SQLCODE: -668, SQLSTATE: 57016, SQLERRMC: 7;

I am using db2 9.5 i have created a column in table which is created successfully but i am not able to update table column and getting following error
[Error] Script lines: 1-1 --------------------------
DB2 SQL error: SQLCODE: -668, SQLSTATE: 57016, SQLERRMC: 7;DB2ADMIN.XCATENTRYEXT
Message: Operation not allowed for reason code "7" on table "DB2ADMIN.XCATENTRYEXT".
Following the some blog/sites on google i found the REORG command as solution as mentioned in following link
http://bytes.com/topic/db2/answers/508869-reorg-tablespace
i have tried the following queries to run on database to solve the problem.
Database["DB2"].ExecuteNonQuery("call SYSPROC.ADMIN_CMD ('REORG TABLE DB2ADMIN.XCATENTRYEXT index CATENTRY_ID INPLACE')")
REORG TABLE DB2ADMIN.XCATENTRYEXT index CATENTRY_ID INPLACE
REORG TABLE DB2ADMIN.XCATENTRYEXT
REORG INDEXES I0000908 FOR TABLE DB2ADMIN.XCATENTRYEXT
but all queries have the same error in result like
DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: Database;BEGIN-OF-STATEMENT;<variable_set>
Message: An unexpected token "Database" was found following "BEGIN-OF-STATEMENT". Expected tokens may include: "<variable_set>".
I am stuck on this error, I am not even able to update any column of that particular table.
It is possible to do REORG through an SQL statement:
CALL SYSPROC.ADMIN_CMD('REORG TABLE SCHEMA.TABLENAME');
It follows from the error message, that you somehow submit the entire string Database["DB2"].ExecuteNonQuery("call SYSPROC.ADMIN_CMD ('REORG TABLE DB2ADMIN.XCATENTRYEXT index CATENTRY_ID INPLACE')") as a SQL statement, which obviously is incorrect.
Simply issue these on the shell command line:
db2 connect to <your database name here>
db2 REORG TABLE DB2ADMIN.XCATENTRYEXT
If you are using tool like dbeaver , you can go to Schema --> table name --> right click --> select tools and you should see option for reorg table