Questions tagged [amazon-athena]

The Amazon Athena tool is designed for executing SQL queries on data that is stored within the Amazon S3 platform. This feature is just one piece of the overall suite of services offered by Amazon Web Services (AWS).

Steps to prevent inputting an entire JSON object into a sole field in AWS Athena

Currently, I am trying to import JSON data from S3 into an Athena table. The structure of my JSON data is as follows; [{"a":"a_value", "b":"b_value", "my_data":{"c":"c_value", "d&q ...

Generate fresh columns from string columns formatted as JSON

I have a table with a single column that is of string type, but the content resembles a JSON structure. The data in the column looks like this: 'old_id' column with values: [{"name":"Entitas Penugasan","id":"6415","value":"HIJRA"}, {"name":"Function","i ...

json_extract_scalar is failing to retrieve a value from a JSON string that contains single quotes

I have a record in my Athena database that contains a JSON string as follows. {'is_referred': False, 'landing_page': '/account/register'} When attempting to extract the value of landing_page using the query below, it returns a null value. select json ...

Having trouble with executing Athena query using athena-express when using req.body as input

Seeking guidance on querying specific data from AWS Athena using req.body parameters. When attempting to execute the query with req.body in postman, encountering the following error: Error: SYNTAX_ERROR: line 1:1: Incorrect number of parameters: expected 1 ...

Harvesting information from a Nested Array using Hive

Greetings! I am in search of a way to extract data from an array of arrays using Athena. create external table test ( customer string ) Location 'something-something' The contents of the single row in this table are as follows: select * from c ...

How can I use Presto/Athena to find the frequency of JSON attributes in a query?

I created a Hive table with a single column that stores JSON data: CREATE EXTERNAL TABLE IF NOT EXISTS my.rawdata ( json string ) PARTITIONED BY (dt string) ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde' WITH SERDEPROPERTIES ( 'separat ...

While pyodbc has the ability to fetch the column names from a table, attempting to run a query on the same table may result in a "does

I have established a successful connection to an AWS Athena table using pyodbc. I am able to retrieve the column names, but encountering an issue when trying to query the table as it seems to be non-existent. import pyodbc import pandas as pd cnxn = pyod ...