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,520 points
33 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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,120 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
1,358 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
• 3,770 points
1,533 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,120 points
84 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,120 points
181 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,520 points
98 views
0 votes
2 answers
0 votes
1 answer

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.