- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
使用AWS::Glue::Table,您可以设置像here这样的Athena表。 Athena supports partitioning data基于S3中的文件夹结构。我想从我的Glue模板对Athena表进行分区。
从AWS Glue Table TableInput看来,我可以使用PartitionKeys
对数据进行分区,但是当我尝试使用以下模板时,Athena失败并且无法获取任何数据。
Resources:
...
MyGlueTable:
Type: AWS::Glue::Table
Properties:
DatabaseName: !Ref MyGlueDatabase
CatalogId: !Ref AWS::AccountId
TableInput:
Name: my-glue-table
Parameters: { "classification" : "json" }
PartitionKeys:
- {Name: dt, Type: string}
StorageDescriptor:
Location: "s3://elasticmapreduce/samples/hive-ads/tables/impressions/"
InputFormat: "org.apache.hadoop.mapred.TextInputFormat"
OutputFormat: "org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat"
SerdeInfo:
Parameters: { "separatorChar" : "," }
SerializationLibrary: "org.apache.hive.hcatalog.data.JsonSerDe"
StoredAsSubDirectories: false
Columns:
- {Name: requestBeginTime, Type: string}
- {Name: adId, Type: string}
- {Name: impressionId, Type: string}
- {Name: referrer, Type: string}
- {Name: userAgent, Type: string}
- {Name: userCookie, Type: string}
- {Name: ip, Type: string}
- {Name: number, Type: string}
- {Name: processId, Type: string}
- {Name: browserCookie, Type: string}
- {Name: requestEndTime, Type: string}
- {Name: timers, Type: "struct<modellookup:string,requesttime:string>"}
- {Name: threadId, Type: string}
- {Name: hostname, Type: string}
- {Name: sessionId, Type: string}
最佳答案
得到它了!非常痛苦,因为我必须运行Glue Crawler,它会正确创建带有分区的表,然后使用CLI提取正确的模板参数。这是模板,
AWSTemplateFormatVersion: 2010-09-09
Description: A partitioned Glue Table
Resources:
MyGlueDatabase:
Type: AWS::Glue::Database
Properties:
DatabaseInput:
Name: my_glue_database
Description: "Glue beats tape"
CatalogId: !Ref AWS::AccountId
MyGlueTable:
Type: AWS::Glue::Table
Properties:
DatabaseName: !Ref MyGlueDatabase
CatalogId: !Ref AWS::AccountId
TableInput:
Name: my_glue_table
TableType: EXTERNAL_TABLE
Parameters:
CrawlerSchemaDeserializerVersion': "1.0"
CrawlerSchemaSerializerVersion': "1.0"
classification': json
compressionType': none
typeOfData': file
PartitionKeys:
- {Name: dt, Type: string}
StorageDescriptor:
BucketColumns: []
Columns:
- {Name: number, Type: string}
- {Name: referrer, Type: string}
- {Name: processid, Type: string}
- {Name: adid, Type: string}
- {Name: browsercookie, Type: string}
- {Name: usercookie, Type: string}
- {Name: requestendtime, Type: string}
- {Name: impressionid, Type: string}
- {Name: useragent, Type: string}
- {Name: timers, Type: 'struct<modelLookup:string,requestTime:string>'}
- {Name: threadid, Type: string}
- {Name: ip, Type: string}
- {Name: modelid, Type: string}
- {Name: hostname, Type: string}
- {Name: sessionid, Type: string}
- {Name: requestbegintime, Type: string}
Compressed: false
InputFormat: org.apache.hadoop.mapred.TextInputFormat
Location: s3://elasticmapreduce/samples/hive-ads/tables/impressions/
NumberOfBuckets: -1
OutputFormat: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
Parameters: {CrawlerSchemaDeserializerVersion: '1.0', CrawlerSchemaSerializerVersion: '1.0',
UPDATED_BY_CRAWLER: test, averageRecordSize: '644', classification: json,
compressionType: none, objectCount: '241', recordCount: '1000109', sizeKey: '648533598',
typeOfData: file}
SerdeInfo:
Parameters: {paths: 'adId,browserCookie,hostname,impressionId,ip,modelId,number,processId,referrer,requestBeginTime,requestEndTime,sessionId,threadId,timers,userAgent,userCookie'}
SerializationLibrary: org.openx.data.jsonserde.JsonSerDe
SortColumns: []
StoredAsSubDirectories: false
MSCK REPAIR TABLE my_glue_table;
Repair: Added partition to metastore my_glue_table:dt=2009-04-12-13-00
Repair: Added partition to metastore my_glue_table:dt=2009-04-12-13-05
%% SELECT * FROM "my_glue_database"."my_glue_table" WHERE dt = '2009-04-14-13-00' LIMIT 10;
1 7663 cartoonnetwork.com 1178 SxRBJCmJBCLcfTS545t6qD1M8L64SC nsdfvfvger 3VCLfFfF75BDgHgDoowHegOpkCivMJ 1239714024000 RTM6Vtrc1O3KX2FlUghUSiAQHiix8F Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; GTB6; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0) {modellookup=0.3538, requesttime=0.7532} 15 37.215.88.35 bxxiuxduad ec2-50-32-48-14.amazon.com BIBIlA7dgXc2eWekUJ6hSXa7p6dQEx 1239714024000 2009-04-14-13-00
2 17646 coursera.org 1255 Fskm4W6JKX6vf7UMaW55KObTJCtm1E xftjotkexc jH6DRWtkeH3tVg6c4mcLW36UW3LvqX 1239714027000 uQqO1fNoeM8KdesiVg86o4iK7FkqLt Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322) {modellookup=0.2986, requesttime=0.9616} 21 37.218.101.204 bxxiuxduad ec2-50-32-48-14.amazon.com OjgTQWOqHJopoWf9LpJ4We1UE7uJao 1239714026000 2009-04-14-13-00
关于amazon-web-services - 从胶水Cloudformation模板对Athena表进行分区,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50279209/
有没有办法在试运行模式下运行 AWS cloudformation 更新?因为我意识到 aws validate 不会拾取所有错误,并且当您运行更新时会抛出新错误。 最佳答案 最接近的方法是运行模拟测
我是 cloudformation 的新手,我正在尝试按照 AWS 文档创建具有方法限制的使用计划。我需要定义一个 ApiStage具有 Throttle 属性。 我尝试了以下方法,但收到错误 - 属
我正在整理一个用于运行 cloudformation/sam 的角色/策略,以尽可能地限制访问。是否有一组通用的策略操作应该用于运行 create-stack? 这是一个代码构建,我使用它在应用程序运
我正在尝试创建一个资源,其属性之一不是常量值。听起来像是堆栈参数的工作,只不过它是一个在某些情况下可以采用 Ref 函数形式的字符串。具体来说,如果是初始创建,我希望参数值是对另一个资源的 Ref,如
我的实际任务是: 在 CloudFormation 外部创建 AMI 使用 CloudFormation 从 AMI 启动实例 分离所有现有卷(包括根卷和数据卷) 附加根据最新快照创建的新卷(根卷和数
我在 cloudformation 中有一个启动实例的模板。它工作正常,但它没有创建我在模板中提到的标签。下面是我的模板 { "AWSTemplateFormatVersion": "2010-0
我尝试通过 Cloudformation 使用 AWS Conformance Pack。我创建了一些非常简单的东西: 以下堆栈创建 S3 存储桶 + 一致性包。然后我将一致性包模板存储到另一个 S3
我的目标是编写一个 Lambda 函数,根据标签将角色附加到 EC2 实例。因此,每当创建新的 Ec2 实例时,都必须自动为其附加一个角色。我希望根据 EC2 实例状态更改(正在运行)触发 lambd
我想使用 CloudFormation 配置 OpenVPN,我想我可以从市场获取 AMI ID 并启动它,因为我想启动一个具有 10 个连接的实例,但不幸的是我无法从市场获取 AMI ID 。如何获
我有一个正在创建 ACM 证书的 cloudformation 堆栈。昨天的代码运行良好,因此我将其移至嵌套堆栈中。 该模板来自一个非常漂亮的示例。我有一个托管区域,这就是我请求证书的地方,模板有一个
我目前正在使用 terraform 和 CloudFormation 之间犹豫。有一个问题我还没有看到答案(或者也许,我只是还没有找到它)。 在 terraform 中,您可以为所有事物指定准确的名称
我收到以下错误,但不知道它来自哪里,希望有人可以提供帮助。 模板验证错误:模板格式错误:任何 Properties 成员都必须是 JSON 对象。 cloudformation脚本 { "AWST
我目前将所有参数存储在 Systems Manager Parameter Store 中,并在 CloudFormation 堆栈中引用它们。 我现在陷入了同一 Cloudformation 模板的
我正在创建一条通往互联网网关的公共(public)路由。当我通过 GUI 进行配置时,完全没有问题。当我尝试通过我的 Cloudformation 模板执行此操作时,每次都会失败。这是网关的构建,没有
在cloudformation模板中,有一个输出部分,用于与跨堆栈对话。 如果我们在一个 AWS 账户中只创建一个堆栈,那么这部分不应存在,这样说是否正确? 最佳答案 输出部分可用于通过 Export
我有以下结构(几乎是样板文件)。我的问题是,我在 ParentStack 中定义的映射在 ChildSTack 中可用还是我需要复制它们?我知道我可以将参数传递给 ChildStack,但想知道 Ma
我有一个主 Cloudformation 模板,它调用两个子模板。我运行了第一个模板,并在资源的 Outputs 部分中捕获了输出。我已经在嵌套的第二个模板中使用 ChildStack01 输出值进行
除了Web控制台中的“检查漂移”功能之外,是否还有其他触发器可以进行检查? cloudformation 是否会在堆栈更新之前自动检查偏差? 假设我有一个创建 s3 存储桶的 cf 堆栈。然后我从 W
有没有办法在 CFN 模板中包含自定义验证器? 我知道我们可以像这样添加规则执行: https://aws.amazon.com/blogs/mt/how-to-perform-cross-param
我正在使用 CloudFormation 模板创建 KMS key ,然后使用该模板在另一个模板中创建 IAM 角色,因为它引用了 KMS key 。需要更新创建 KMS key 的堆栈以将 IAM
我是一名优秀的程序员,十分优秀!