abetomo/convert-athena-query-results-to-array
最新稳定版本:v3.0.0
Composer 安装命令:
composer require abetomo/convert-athena-query-results-to-array
包简介
Convert AWS Athena QueryResults to Array.
README 文档
README
Convert AWS Athena QueryResults to Array. Since the response of GetQueryResults is complicated, it converts it to a simple array.
Installation
% composer require abetomo/convert-athena-query-results-to-array
Usage
Convert the response of GetQueryResults into an array.
<?php // ... startQueryExecution, etc. $getQueryResultsResponse = $athenaClient->getQueryResults([ 'QueryExecutionId' => $queryExecutionId ]); use Abetomo\ConvertAthenaQueryResultstoArray\ConvertAthenaQueryResultstoArray; print "/// Original value\n"; print_r($getQueryResultsResponse->get('ResultSet')); print "\n/// Convert to array \n"; print_r(ConvertAthenaQueryResultstoArray::convert( $getQueryResultsResponse->get('ResultSet'), true // $isSkipHeader ));
Example of results
Convert to array
Array ( [0] => Array ( [account_id] => id1 [count] => 49 ) [1] => Array ( [account_id] => id2 [count] => 68 ) ) Original value
Array ( [Rows] => Array ( [0] => Array ( [Data] => Array ( [0] => Array ( [VarCharValue] => account_id ) [1] => Array ( [VarCharValue] => count ) ) ) [1] => Array ( [Data] => Array ( [0] => Array ( [VarCharValue] => id1 ) [1] => Array ( [VarCharValue] => 49 ) ) ) [2] => Array ( [Data] => Array ( [0] => Array ( [VarCharValue] => id2 ) [1] => Array ( [VarCharValue] => 68 ) ) ) ) [ResultSetMetadata] => Array ( [ColumnInfo] => Array ( [0] => Array ( [CatalogName] => hive [SchemaName] => [TableName] => [Name] => account_id [Label] => account_id [Type] => varchar [Precision] => 2147483647 [Scale] => 0 [Nullable] => UNKNOWN [CaseSensitive] => 1 ) [1] => Array ( [CatalogName] => hive [SchemaName] => [TableName] => [Name] => count [Label] => count [Type] => integer [Precision] => 10 [Scale] => 0 [Nullable] => UNKNOWN [CaseSensitive] => ) ) ) ) 统计信息
- 总下载量: 52.11k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-04