0

My script keeps falling with the same error

java.lang.RuntimeException: native snappy library not available: this version of libhadoop was built without snappy support

The code itself looks like this

WITH step1 AS(
  SELECT columns
  FROM t1 stg
  WHERE time_key < '2017-04-08' AND time_key >= DATE_ADD('2017-04-08', -31)
  GROUP BY columns
  HAVING conditions1
)
, step2 AS(
  SELECT columns
  FROM t2
  WHERE conditions2
)
, step3 AS(
  SELECT columns
  FROM stg
  JOIN comverse_sub
  ON conditions3
)
INSERT INTO TABLE t1 PARTITION(time_key = '2017-04-08')
SELECT columns
FROM step3
WHERE conditions4

I checked if there is snappy installed

hadoop checknative -a

and got

snappy:  true /usr/hdp/2.5.0.0-1245/hadoop/lib/native/libsnappy.so.1

My settings for tez are

set tez.queue.name=adhoc;
set hive.execution.engine=tez;
set hive.tez.container.size=4096;
set hive.auto.convert.join=true;
set hive.exec.parallel=true;
set hive.tez.auto.reducer.parallelism=true;
SET hive.exec.compress.output=true;
SET tez.runtime.compress=true;
SET tez.runtime.compress.codec=org.apache.hadoop.io.compress.SnappyCodec;

I should also note that not all script on tez fail. Some work. Like this one

WITH hist AS(
  SELECT columns
  FROM t1
  WHERE conditions1
)
INSERT INTO TABLE t1 PARTITION(time_key)
SELECT columns
FROM hist
INNER JOIN t2
  on conditions2
INNER JOIN t3
  ON conditions3
WHERE conditions4

Why does this happen?

I checked this and this and this. Didn't help. Also, when I run the scripts on MR they all work.

gjin
  • 860
  • 1
  • 14
  • 28

1 Answers1

0

Well, I solved it. I just kept adding settings untill it worked. Still don't know what the problem was and the solution is not very good, but it'll do for the time being.

set tez.queue.name=adhoc;
set hive.execution.engine=tez;
set hive.tez.container.size=4096;
set hive.auto.convert.join=true;
set hive.exec.parallel=true;
set hive.tez.auto.reducer.parallelism=true;
SET hive.exec.compress.output=true;
SET tez.runtime.compress=true;
SET tez.runtime.compress.codec=org.apache.hadoop.io.compress.SnappyCodec;
SET das.reduce-tasks-per-node=12;
SET das.map-tasks-per-node=12;
SET das.job.map-task.memory=4096;
SET das.job.reduce-task.memory=4096;
SET das.job.application-manager.memory=4096;
SET tez.runtime.io.sort.mb=512;
SET tez.runtime.io.sort.factor=100;
set hive.tez.min.partition.factor=0.25;
set hive.tez.max.partition.factor=2.0;
set mapred.reduce.tasks = -1;
gjin
  • 860
  • 1
  • 14
  • 28