0

I have created Hive table over EMR which look like

create external table tests3(
transaction_id String,
order_id String,
user_id String,
amount String,
subscriber_number String,
product_type String,
provider String,
region String,
status String,
created_time String,
last_updated_time BIGINT,

)
row format 
    serde 'org.openx.data.jsonserde.JsonSerDe'
location 's3://locationtobucket';

When I do select * from tests3 I get records . But running any tez task is giving me following error.

Query : select count(*) from tests3;

Vertex failed, vertexName=Map 1, vertexId=vertex_1513582536692_0022_1_00
, diagnostics=[Vertex vertex_1513582536692_0022_1_00 [Map 1] killed/failed due to:ROOT_INPUT_INIT_FAILURE, Vertex Input: tests3 initializer fail
ed, vertex=vertex_1513582536692_0022_1_00 [Map 1], com.amazon.ws.emr.hadoop.fs.shaded.com.amazonaws.services.s3.model.AmazonS3Exception: Bad Req
uest (Service: Amazon S3; Status Code: 400; Error Code: 400 Bad Request; Request ID: DEBA2E241B9DE8C3),
Cœur
  • 37,241
  • 25
  • 195
  • 267

2 Answers2

0

Please check if your account has the proper permission to S3 and the bucket you are trying to access. Also, check if S3 bucket url is correct e.g. s3://locationtobucket/missingfile

The standard first step is: try to use the AWS command line tools with the same credentials, through a command such as:

hdfs fs -ls s3a://locationtobucket/

  • I am able to get records when i do select * from tablename ; only mapreduce operation is failing . with no permission on bucket or with bad url ,it wouldn't have allowed query to read records. – user3459215 Dec 28 '17 at 10:00
  • did you resolved it? I'm experimenting the same issue – Giorgio Feb 15 '22 at 15:00
0

Just change the hive execution engine to MR and it will start work properly.

Manish Pansari
  • 371
  • 4
  • 9