Error running hive query executor
I have a problem while trying to run the hive query executor. When I try to run a simple sql query like:
CREATE EXTERNAL TABLE clientes(ID_CLIENTE bigint, name string, surnames string, dni string, birthDate date, registerDate date, economicIndex int, province string, city string, address string, cp int, phone bigint, mail string, sex string, asignado string, oficina int) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\;' STORED AS TEXTFILE tblproperties ("skip.header.line.count"="1",'serialization.encoding'='CP1252');
It works, however when I try to run a query that involve mapreduce tasks, (the query works on the hive shell) something like this for example:
CREATE table means as
SELECT
AVG(PRIMA_TARIFA) as mean_tarifa,
AVG(IMP_SINIESTRO) as mean_imp,
AVG(TIEMPO_RESOL) as mean_tiempo FROM(
select C.ID_CLIENTE,
SUM(C.PRIMA_TARIFA)AS PRIMA_TARIFA,
SUM(D.tiempo_resol)AS TIEMPO_RESOL,
SUM(D.IMP_SINIESTRO)AS IMP_SINIESTRO
from polizas C
LEFT OUTER JOIN siniestros D
ON C.ID_POLIZA = D.ID_POLIZA
GROUP BY C.ID_CLIENTE) t1;
It gives me the following error
Pipeline Status: START_ERROR: CONTAINER_0791 - Pipeline lifecycle event stage run error: com.streamsets.datacollector.runner.PipelineRuntimeException: CONTAINER_0792 - Pipeline lifecycle event stage generated error record: QUERY_EXECUTOR_001 - Failed to execute queries. Details : Failed to execute query 'CREATE table means as SELECT AVG(PRIMA_TARIFA) as mean_tarifa, AVG(IMP_SINIESTRO) as mean_imp, AVG(TIEMPO_RESOL) as mean_tiempo FROM( select C.ID_CLIENTE, SUM(C.PRIMA_TARIFA)AS PRIMA_TARIFA, SUM(D.tiempo_resol)AS TIEMPO_RESOL, SUM(D.IMP_SINIESTRO)AS IMP_SINIESTRO from polizas C LEFT OUTER JOIN siniestros D ON C.ID_POLIZA = D.ID_POLIZA GROUP BY C.ID_CLIENTE) t1'. Reason: java.sql.SQLException: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask
I have tried executing the same query in other places like a hive query as a start event or running it as a script from a shell box and not of them works. I have found that some people say that it may be a permissions issue, but I have given permissions as they say to /tmp and hive/warehouse but nothing works. I do not know what else I can try, I can't get to execute a simple hive query.