Cmdlets for Amazon Athena

Build 23.0.8839

QueryResults Output Object (Select-AmazonAthena Cmdlet)

クエリの結果。

Syntax

PSObject QueryResults

Remarks

検索を実行すると、結果がPSObject のパイプラインに一度に一行ずつ返されます。各行オブジェクトは対応する値を持つテーブルのカラムを含みます。行オブジェクトにはテーブルと接続も含まれ、パイプライン経由でこれらの値をほかのcmdlet に簡単にインプットできます。以下に、JSON 形式の行オブジェクトの例を示します。

PS C:\> $conn  = Connect-AmazonAthena AWSAccessKey "a123" -AWSSecretKey "s123" -AWSRegion "IRELAND" -Database "sampledb" -S3StagingDirectory "s3://bucket/staging/"
PS C:\> $row = Select-AmazonAthena -Connection $conn -Table "[AwsDataCatalog].[sampledb].Customers" -Columns (Name, TotalDue)  -Where "CustomerId = '12345'" | select -first 1
PS C:\> $row | ConvertTo-Json
{
  "Connection":  {

  },
    "Table":  "[AwsDataCatalog].[sampledb].Customers",
    "Columns":  [

    ],
    "Name":  "MyName",
    "TotalDue":  "MyTotalDue"
}

Copyright (c) 2024 CData Software, Inc. - All rights reserved.
Build 23.0.8839