HEX
Server: Apache
System: Linux vps-cdc32557.vps.ovh.ca 5.15.0-156-generic #166-Ubuntu SMP Sat Aug 9 00:02:46 UTC 2025 x86_64
User: hanode (1017)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //lib/python3/dist-packages/awscli/examples/athena/get-query-results.rst
**To return the results of a query**

The following ``get-query-results`` example returns the results of the query that has the specified query ID. ::

    aws athena get-query-results \
        --query-execution-id a1b2c3d4-5678-90ab-cdef-EXAMPLE11111

Output::

    {
        "ResultSet": {
            "Rows": [
                {
                    "Data": [
                        {
                            "VarCharValue": "date"
                        },
                        {
                            "VarCharValue": "location"
                        },
                        {
                            "VarCharValue": "browser"
                        },
                        {
                            "VarCharValue": "uri"
                        },
                        {
                            "VarCharValue": "status"
                        }
                    ]
                },
                {
                    "Data": [
                        {
                            "VarCharValue": "2014-07-05"
                        },
                        {
                            "VarCharValue": "SFO4"
                        },
                        {
                            "VarCharValue": "Safari"
                        },
                        {
                            "VarCharValue": "/test-image-2.jpeg"
                        },
                        {
                            "VarCharValue": "200"
                        }
                    ]
                },
                {
                    "Data": [
                        {
                            "VarCharValue": "2014-07-05"
                        },
                        {
                            "VarCharValue": "SFO4"
                        },
                        {
                            "VarCharValue": "Opera"
                        },
                        {
                            "VarCharValue": "/test-image-2.jpeg"
                        },
                        {
                            "VarCharValue": "200"
                        }
                    ]
                },
                {
                    "Data": [
                        {
                            "VarCharValue": "2014-07-05"
                        },
                        {
                            "VarCharValue": "SFO4"
                        },
                        {
                            "VarCharValue": "Firefox"
                        },
                        {
                            "VarCharValue": "/test-image-3.jpeg"
                        },
                        {
                            "VarCharValue": "200"
                        }
                    ]
                },
                {
                    "Data": [
                        {
                            "VarCharValue": "2014-07-05"
                        },
                        {
                            "VarCharValue": "SFO4"
                        },
                        {
                            "VarCharValue": "Lynx"
                        },
                        {
                            "VarCharValue": "/test-image-3.jpeg"
                        },
                        {
                            "VarCharValue": "200"
                        }
                    ]
                },
                {
                    "Data": [
                        {
                            "VarCharValue": "2014-07-05"
                        },
                        {
                            "VarCharValue": "SFO4"
                        },
                        {
                            "VarCharValue": "IE"
                        },
                        {
                            "VarCharValue": "/test-image-2.jpeg"
                        },
                        {
                            "VarCharValue": "200"
                        }
                    ]
                },
                {
                    "Data": [
                        {
                            "VarCharValue": "2014-07-05"
                        },
                        {
                            "VarCharValue": "SFO4"
                        },
                        {
                            "VarCharValue": "Opera"
                        },
                        {
                            "VarCharValue": "/test-image-1.jpeg"
                        },
                        {
                            "VarCharValue": "200"
                        }
                    ]
                },
                {
                    "Data": [
                        {
                            "VarCharValue": "2014-07-05"
                        },
                        {
                            "VarCharValue": "SFO4"
                        },
                        {
                            "VarCharValue": "Chrome"
                        },
                        {
                            "VarCharValue": "/test-image-3.jpeg"
                        },
                        {
                            "VarCharValue": "200"
                        }
                    ]
                },
                {
                    "Data": [
                        {
                            "VarCharValue": "2014-07-05"
                        },
                        {
                            "VarCharValue": "SFO4"
                        },
                        {
                            "VarCharValue": "Firefox"
                        },
                        {
                            "VarCharValue": "/test-image-2.jpeg"
                        },
                        {
                            "VarCharValue": "200"
                        }
                    ]
                },
                {
                    "Data": [
                        {
                            "VarCharValue": "2014-07-05"
                        },
                        {
                            "VarCharValue": "SFO4"
                        },
                        {
                            "VarCharValue": "Chrome"
                        },
                        {
                            "VarCharValue": "/test-image-3.jpeg"
                        },
                        {
                            "VarCharValue": "200"
                        }
                    ]
                },
                {
                    "Data": [
                        {
                            "VarCharValue": "2014-07-05"
                        },
                        {
                            "VarCharValue": "SFO4"
                        },
                        {
                            "VarCharValue": "IE"
                        },
                        {
                            "VarCharValue": "/test-image-2.jpeg"
                        },
                        {
                            "VarCharValue": "200"
                        }
                    ]
                }
            ],
            "ResultSetMetadata": {
                "ColumnInfo": [
                    {
                        "CatalogName": "hive",
                        "SchemaName": "",
                        "TableName": "",
                        "Name": "date",
                        "Label": "date",
                        "Type": "date",
                        "Precision": 0,
                        "Scale": 0,
                        "Nullable": "UNKNOWN",
                        "CaseSensitive": false
                    },
                    {
                        "CatalogName": "hive",
                        "SchemaName": "",
                        "TableName": "",
                        "Name": "location",
                        "Label": "location",
                        "Type": "varchar",
                        "Precision": 2147483647,
                    "Data": [
    
                        "Scale": 0,
                        "Nullable": "UNKNOWN",
                        "CaseSensitive": true
                    },
                    {
                        "CatalogName": "hive",
                        "SchemaName": "",
                        "TableName": "",
                        "Name": "browser",
                        "Label": "browser",
                        "Type": "varchar",
                        "Precision": 2147483647,
                        "Scale": 0,
                        "Nullable": "UNKNOWN",
                        "CaseSensitive": true
                    },
                    {
                        "CatalogName": "hive",
                        "SchemaName": "",
                        "TableName": "",
                        "Name": "uri",
                        "Label": "uri",
                        "Type": "varchar",
                        "Precision": 2147483647,
                        "Scale": 0,
                        "Nullable": "UNKNOWN",
                        "CaseSensitive": true
                    },
                    {
                        "CatalogName": "hive",
                        "SchemaName": "",
                        "TableName": "",
                        "Name": "status",
                        "Label": "status",
                        "Type": "integer",
                        "Precision": 10,
                        "Scale": 0,
                        "Nullable": "UNKNOWN",
                        "CaseSensitive": false
                    }
                ]
            }
        },
        "UpdateCount": 0
    }

For more information, see `Working with Query Results, Output Files, and Query History <https://docs.aws.amazon.com/athena/latest/ug/querying.html>`__ in the *Amazon Athena User Guide*.