Error when trying to use the lag function in explicit-pass through [Hive] [SAS over Hadoop] - hadoop

The following query is giving me the error:
Execute error: Error while processing statement: FAILED: Execution Error, return code 2 from
org.apache.hadoop.hive.ql.exec.mr.MapRedTask
Does anyone know why or how to resolve this issue?
proc sql;
connect to hadoop(server='xxx' port=10000 schema=xxx SUBPROTOCOL=hive2 sql_functions=all);
execute(
create table a as
select
*,
lag(claim_flg,1) over (order by ptnt_id,month) as lag1
from b
) by hadoop;
disconnect from hadoop;
quit;

It appears to be a limitation issue in HIVE database:
Hive Limit of 127 Expressions per Table
Due to a limitation in the Hive database, tables can contain a maximum of 127 expressions. When the 128th expression is read, the directive fails and the SAS log receives a message similar to the following:
ERROR: java.sql.SQLException: Error while processing statement: FAILED:
Execution Error, return
code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask
ERROR: Unable to execute Hadoop query.
ERROR: Execute error.
SQL_IP_TRACE: None of the SQL was directly passed to the DBMS.
The Hive limitation applies anytime a table is read as part of a directive. For SAS Data Loader, the error can occur in aggregations, profiles, when viewing results, and when viewing sample data.
Source: http://support.sas.com/documentation/cdl/en/dmddug/67908/HTML/default/viewer.htm#p1fl149uastoudn1v7r2u5ff8aft.htm

Related

HIVE: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask

I setup HIVE in my system. When I am running normal queries like below, queries are executing fine.
select * from employee;
select * from employee where age=29
But when I ran with distinct keyword, I am getting following error.
Error during job, obtaining debugging information...
FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask
MapReduce Jobs Launched:
Apart from plain queries, most of the HiveQL statement are getting failed with the same error (Ex: insert into table employee1 select * from employee limit 5)
Can I know, how to find out the root cause and probable solutions here..

Analyze Table Syntax Error

The following sql statement raises a syntax error:
analyze table my_table sample_size 0;
This is the raised error:
Syntax error in SQL statement "ANALYZE TABLE MY_TABLE SAMPLE_SIZE[*] 0 "; expected "integer";
The official documentation gives the following:
ANALYZE [TABLE tableName] [SAMPLE_SIZE rowCountInt]
(...)
The value 0 means all rows are read.
How to workaround this problem?
H2 1.4.196
The error results from a bug in the h2 database parsing code. A fix has been sent.
I don't know in which version it willl be available.

HIVE LLAP doesn't work with complex types

I turned on LLAP on the Ambari sandbox and my queries aren't working anymore.
I have a table that has primitive types and complextypes(structs/arrays).
I'm querying against the primitive type and it errors out.
select * from test.data
where policynumber = '4'
Error: java.sql.SQLException: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.tez.TezTask

Monetdb unable to execute queries with a where clause against remote tables

I have been trying remote tables in monetdb. I have setup a remote table mapped to an existing table on a monetdb instance running on another host.
I am able to perform some basic queries, However I am unable to use the where clause: If I try to execute a simple query like :
select * from "T1" where product_id > 1757;
The query execution fails with the error (of course the query runs fine on the local table):
TypeException:user.l4[6]:'algebra.thetasubselect' undefined in: algebra.thetasubselect(X_40:bat[:int],X_41:any,">":str);
SQLState: 22000
ErrorCode: 0
Error: (mapi:monetdb://monetdb#192.168.1.46/visokio) 'algebra.thetasubselect' undefined in: algebra.thetasubselect(X_46:bat[:int],X_47:any,">":str);
SQLState: 22000
ErrorCode: 0
I receive similar errors on every query containing a where clause.
Am I doing something wrong? Is there a reason why I cannot execute a query containing a where clause?
Thank you for your help.

Talend: tHiveInput throwing error only when 'Where' clause is used in the Query. Works fine if i remove the clause

I am a newbie to both Talend and Hive.
I want to query the Hive table and output the data to csv file.
Created
tHiveConnection (I was able to connect to Hive Database)
tHiveInput (used the use existing connection and wrote the Query)
connected tHiveInput to tMap
connected tMap to tfileOutputDelimited
tHiveClose
in the point 2) when i write a query select * from table_name everything is working fine, I was able to collect the data in csv file
but when i change my query to select * from table_name where column_name = value it is failing
Below is the error log
Exception in component tHiveInput_1 java.sql.SQLException: Error while
processing statement: FAILED: Execution Error, return code 1 from
org.apache.hadoop.hive.ql.exec.mr.MapRedTask at
org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:277) at
org.apache.hive.jdbc.HiveStatement.executeQuery(HiveStatement.java:376)
tHiveInput_1 Error while processing statement: FAILED: Execution Error, return code 1 from
org.apache.hadoop.hive.ql.exec.mr.MapRedTask

Resources