【发布时间】:2018-12-06 16:28:11
【问题描述】:
我在 S3 中有一些数据,在 Glue 目录中创建了一个模式,然后通过 Athena 将其公开给 QuickSight。当我通过在控制台中单击创建它时,所有这些都非常有用。
然后我将其转换为以下 CloudFormation:
AnalyticsDatabase:
Type: AWS::Glue::Database
Properties:
DatabaseInput:
Name: analytics
CatalogId: !Ref AWS::AccountId
RawAnalysisAnalyticsTable:
Type: AWS::Glue::Table
Properties:
DatabaseName: !Ref AnalyticsDatabase
CatalogId: !Ref AWS::AccountId
TableInput:
Name: analysis_raw
TableType: EXTERNAL_TABLE
Parameters:
classification: json
StorageDescriptor:
Columns:
- {Name: id, Type: string}
- {Name: treeid, Type: string}
- {Name: patientid, Type: string}
Compressed: false
InputFormat: org.apache.hadoop.mapred.TextInputFormat
OutputFormat: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
Location: s3://my-bucket/dynamodb/Analysis/
NumberOfBuckets: 0
SerdeInfo:
Parameters: {paths: 'id,patientid,treeid'}
SerializationLibrary: org.openx.data.jsonserde.JsonSerDe
SortColumns: []
StoredAsSubDirectories: false
但是,当我尝试将 CF 创建的表拉入 QuickSight 时,我得到:
Your database generated a SQL exception. This can be caused by query timeouts, resource constraints, unexpected DDL alterations before or during a query, and other database errors. Check your database settings and your query, and try again.
region: us-east-1
timestamp: 1544113019756
requestId: 5ab8f9a2-f972-11e8-b201-154c30728c75
sourceErrorCode: 0
sourceErrorMessage: [Simba][JDBC](11380) Null pointer exception.
sourceErrorState: HY000
sourceException: java.sql.SQLException
sourceType: ATHENA
有谁知道这个错误是什么意思或者我可以如何解决它?我已经将手动创建的表的所有属性与 CloudFormation 创建的表进行了比较,它们看起来是相同的。
【问题讨论】:
-
您是否确保所有正确的权限都可用于云形成?
-
是的,权限似乎没问题。 CloudFormation 成功创建堆栈。我可以进入 Athena 并针对表运行查询。就在我尝试将其导入 QuickSight 时,我遇到了这个问题。这不应该是 Athena 中的权限问题,因为两个表(点击创建的和 CF 创建的)都使用来自 S3 的相同数据。
-
可能是 QuickSight 中的权限问题。确保您转到 QuickSight 中的设置并将其设置为触摸您 AWS 账户中的任何存储桶。
-
@GaryHoliday 尝试但没有成功。
-
添加“PartitionKeys: []”docs.aws.amazon.com/glue/latest/webapi/API_TableInput.html
标签: amazon-web-services amazon-cloudformation amazon-athena aws-glue amazon-quicksight