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 27, 2018 in AWS by Jino
• 5,820 points
1,176 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 27, 2018 by Priyaj
• 58,020 points

Related Questions In AWS

0 votes
1 answer

how to get the RDS snapshot list last 24 hours list by using the lambda functions

Hi@shalk, You can list down your RDS snapshot. ...READ MORE

answered Sep 24, 2020 in AWS by MD
• 95,460 points
3,121 views
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, 2019 in AWS by anonymous
22,315 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,170 points
19,887 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
• 58,020 points
6,013 views
–1 vote
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
• 58,020 points
5,233 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,820 points
2,885 views
0 votes
2 answers
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP