Unable to fetch the last coloumn using Athena

0 votes
{"name":"Shuvodip","age":28,"subject":"AWS"}

{"name":"Nabarupa","age":23,"subject":"Azure"}

I created an external table using the following commands:

CREATE EXTERNAL TABLE IF NOT EXISTS sampledatabase.testdb (
  `name` string,
  `age` int,
  `subjects` string
)
ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'
WITH SERDEPROPERTIES (
  'serialization.format' = '1'
) LOCATION 's3://jino/jino1/'
TBLPROPERTIES ('has_encrypted_data'='false');

I am not getting the last entry.

Nov 26, 2018 in AWS by Jino
• 5,560 points
45 views

1 answer to this question.

0 votes

the error that i found was with the entry name:

in you json file you have subject but in external table you have subjects hence i cant find the entry related to it.

CREATE EXTERNAL TABLE IF NOT EXISTS sampledatabase.testdb (
  `name` string,
  `age` int,
  `subject` string
)
ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'
WITH SERDEPROPERTIES (
  'serialization.format' = '1'
) LOCATION 's3://jino/jino1/'
TBLPROPERTIES ('has_encrypted_data'='false');

This worked absolutely fine.

Hope it helped you too!

answered Nov 26, 2018 by Priyaj
• 56,900 points

Related Questions In AWS

0 votes
2 answers

How to display just the name of files using aws s3 ls command?

aws s3 ls s3://<your_bucket_name>/ | awk '{print ...READ MORE

answered Mar 17 in AWS by anonymous
3,541 views
0 votes
1 answer

How to download the latest file in a S3 bucket using AWS CLI?

You can use the below command $ aws ...READ MORE

answered Sep 6, 2018 in AWS by Archana
• 4,090 points
4,313 views
0 votes
1 answer

AWS S3 uploading hidden files by default

versioning is enabled in your bucket. docs.aws.amazon.com/AmazonS3/latest/user-guide/….... the ...READ MORE

answered Oct 4, 2018 in AWS by Priyaj
• 56,900 points
256 views
0 votes
1 answer

How to decrypt the encrypted S3 file using aws-encryption-cli --decrypt

Use command : aws s3 presign s3://mybucket/abc_count.png you get ...READ MORE

answered Oct 22, 2018 in AWS by Priyaj
• 56,900 points
548 views
0 votes
1 answer

Import my AWS credentials using python script

Using AWS Cli  Configure your IAM user then ...READ MORE

answered Nov 16, 2018 in AWS by Jino
• 5,560 points
367 views
0 votes
2 answers
0 votes
1 answer