标签: amazon-athena

亚马逊雅典娜:输入时没有可行的选择

在雅典娜创造一张桌子; 它给了我以下例外:

输入时没有可行的选择

amazon-web-services amazon-athena

32
推荐指数
3
解决办法
3万
查看次数

如何创建AWS Glue表,其中分区具有不同的列?( 'HIVE_PARTITION_SCHEMA_MISMATCH')

根据此AWS论坛主题,是否有人知道如何使用AWS Glue创建AWS Athena表,其分区包含不同的模式(在这种情况下,表模式中的列的不同子集)?

目前,当我对此数据运行爬虫并在Athena中进行查询时,我收到错误 'HIVE_PARTITION_SCHEMA_MISMATCH'

我的用例是:

  • 分区代表天
  • 文件代表事件
  • 每个事件都是单个s3文件中的json blob
  • 事件包含列的子集(取决于事件的类型)
  • 整个表的"模式"是所有事件类型的完整列(这由Glue crawler正确组合)
  • 每个分区的"模式"是当天发生的事件类型的列的子集(因此在Glue中,每个分区可能具有与表模式不同的列子集)
  • 这种不一致导致我认为雅典娜的错误

如果我要手动编写模式,我可以做到这一点,因为只有一个表模式,JSON文件中缺少的键将被视为Null.

提前致谢!

amazon-s3 amazon-web-services amazon-athena aws-glue

28
推荐指数
2
解决办法
6155
查看次数

如何在AWS Athena外部表中将输入文件名作为列

我在AWS Athena中创建了外部表来查询S3数据,但是,位置路径有1000多个文件.所以我需要将记录的相应文件名显示为表中的列.

select file_name , col1 from table where file_name = "test20170516"
Run Code Online (Sandbox Code Playgroud)

简而言之,我需要知道AWS Athena Presto中的INPUT__FILE__NAME(hive)等效或任何其他方法来实现相同的目标.

sql amazon-s3 amazon-web-services presto amazon-athena

27
推荐指数
2
解决办法
9996
查看次数

Amazon Athena CREATE EXTERNAL TABLE 不匹配输入“外部”invalidrequestException

我正在尝试在 Amazon Athena 中创建外部表。我的查询如下:

CREATE EXTERNAL TABLE priceTable (
  WeekDay STRING,
  MonthDay INT,
  price00 FLOAT,
  price01 FLOAT,
  price02 FLOAT,
  price03 FLOAT,
  price04 FLOAT,
  price05 FLOAT,
  price06 FLOAT,
  price07 FLOAT,
  price08 FLOAT,
  price09 FLOAT,
  price10 FLOAT,
  price11 FLOAT,
  price12 FLOAT,
  price13 FLOAT,
  price14 FLOAT,
  price15 FLOAT,
  price16 FLOAT,
  price17 FLOAT,
  price18 FLOAT,
  price19 FLOAT,
  price20 FLOAT,
  price21 FLOAT,
  price22 FLOAT,
  price23 FLOAT,
  )

  ROW FORMAT DELIMITED
  FIELDS TERMINATED BY ';'
  LINES TERMINATED BY '\n'
  LOCATION 's3://myquicksighttestbucket/C1_SphdemDD_CANARIAS_20190501_20190531_v2'
Run Code Online (Sandbox Code Playgroud)

其中 S3 中的文件只是一个用分号分隔的 csv。但是,我收到以下错误:

line …
Run Code Online (Sandbox Code Playgroud)

amazon-web-services amazon-athena

23
推荐指数
2
解决办法
5万
查看次数

如何在AWS Athena中自动执行MSCK REPAIR TABLE

我有一个火花批处理作业,每小时执行一次.每次运行都S3使用目录命名模式生成并存储新数据DATA/YEAR=?/MONTH=?/DATE=?/datafile.

上传数据后S3,我想使用它来调查它们Athena.更多,我想QuickSight通过连接到Athena作为数据源来将它们可视化.

问题是,每次运行我的Spark批处理后,S3Athena都不会发现存储的新生成的数据,除非我手动运行查询MSCK REPARI TABLE.

有没有办法让Athena自动更新数据,以便我可以创建一个全自动的数据可视化管道?

hive amazon-s3 amazon-web-services amazon-quicksight amazon-athena

21
推荐指数
3
解决办法
8598
查看次数

s3 select和athena有什么区别

我试图了解aws athena服务和新发布的s3 select之间的区别(仍在预览中).那两个用户的用途有何不同?这似乎都有助于从s3中选择部分数据.

amazon-s3 amazon-web-services amazon-athena amazon-s3-select

18
推荐指数
5
解决办法
9739
查看次数

Athena vs Redshift Spectrum

我有点评估Athena和Redshift Spectrum.两者都有相同的用途,Spectrum需要一个Redshift集群,而Athena则是纯无服务器集群.Athena使用Presto和Spectrum使用其Redshift的引擎

雅典娜或红移谱有任何特殊的缺点吗?使用Athena或Spectrum的任何限制?

amazon-web-services amazon-redshift amazon-athena amazon-redshift-spectrum

16
推荐指数
2
解决办法
7905
查看次数

带有双引号和逗号的 AWS Glue 问题

我有这个 CSV 文件:

reference,address
V7T452F4H9,"12410 W 62TH ST, AA D"
Run Code Online (Sandbox Code Playgroud)

表定义中使用了以下选项

ROW FORMAT SERDE 
  'org.apache.hadoop.hive.serde2.OpenCSVSerde' 
WITH SERDEPROPERTIES ( 
  'quoteChar'='\"', 
  'separatorChar'=',') 
Run Code Online (Sandbox Code Playgroud)

但它仍然无法识别数据中的双引号,并且双引号字段中的逗号弄乱了数据。当我运行 Athena 查询时,结果如下所示

reference     address
V7T452F4H9    "12410 W 62TH ST
Run Code Online (Sandbox Code Playgroud)

我该如何解决这个问题?

hadoop hive presto amazon-athena aws-glue

16
推荐指数
2
解决办法
1万
查看次数

通过JPA spring boot访问AWS athena

我正在尝试使用Spring atpaa数据源使用AWS athena.我尝试使用给定的属性设置数据源.

    spring.datasource.driver-class-name=com.amazonaws.athena.jdbc.AthenaDriver
    spring.datasource.url=jdbc:awsathena://athena.us-east-1.amazonaws.com:443/default
    spring.datasource.username=*****
    spring.datasource.password=***
    spring.datasource.tomcat.connectionProperties=s3_staging_dir=*****
Run Code Online (Sandbox Code Playgroud)

我正在低于例外

    Caused by:org.springframework.beans.BeanInstantiationException:    Failed to instantiate [org.springframework.orm.jpa.JpaVendorAdapter]: Factory method 'jpaVendorAdapter' threw exception; nested exception is java.lang.IllegalArgumentException: URL must start with 'jdbc'
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) ~[spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(Constructo`enter code here`rResolver.java:588) ~[spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
... 51 common frames omitted
    Caused by: java.lang.IllegalArgumentException: URL must start with 'jdbc'
at org.springframework.util.Assert.isTrue(Assert.java:92) ~[spring-core-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.boot.jdbc.DatabaseDriver.fromJdbcUrl(DatabaseDriver.java:268) ~[spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
at org.springframework.boot.autoconfigure.orm.jpa.DatabaseLookup.getDatabase(DatabaseLookup.java:73) ~[spring-boot-autoconfigure-1.5.2.RELEASE.jar:1.5.2.RELEASE]
at org.springframework.boot.autoconfigure.orm.jpa.JpaProperties.determineDatabase(JpaProperties.java:139) ~[spring-boot-autoconfigure-1.5.2.RELEASE.jar:1.5.2.RELEASE]
at org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration.jpaVendorAdapter(JpaBaseConfiguration.java:105) ~[spring-boot-autoconfigure-1.5.2.RELEASE.jar:1.5.2.RELEASE]
at org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration$$EnhancerBySpringCGLIB$$720f8624.CGLIB$jpaVendorAdapter$4(<generated>) ~[spring-boot-autoconfigure-1.5.2.RELEASE.jar:1.5.2.RELEASE]
at org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration$$EnhancerBySpringCGLIB$$720f8624$$FastClassBySpringCGLIB$$9766cf.invoke(<generated>) ~[spring-boot-autoconfigure-1.5.2.RELEASE.jar:1.5.2.RELEASE]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-4.3.7.RELEASE.jar:4.3.7.RELEASE] 
Run Code Online (Sandbox Code Playgroud)

jpa amazon-web-services spring-boot amazon-athena

15
推荐指数
1
解决办法
1441
查看次数

AWS Athena 并发限制:提交的查询数 VS 正在运行的查询数

根据AWS Athena 限制,您一次最多可以提交 20 个相同类型的查询,但这是一个软限制,可以根据要求增加。我曾经boto3与 Athena 进行交互,我的脚本提交了 16 个 CTAS 查询,每个查询大约需要 2 分钟才能完成。在 AWS 账户中,只有我在使用 Athena 服务。但是,当我通过控制台查看查询状态时,我发现尽管所有查询都处于 state 状态,但实际上只有少数查询(平均 5 个)正在执行Running。以下是通常会在 Athena 历史选项卡中看到的内容:

雅典娜历史选项卡

我了解,在我向 Athena 提交查询后,它会根据整体服务负载和传入请求的数量分配资源来处理查询。但是我尝试在不同的日期和时间运行它们,仍然会同时执行大约 5 个查询。

所以我的问题是它应该如何?如果是这样,那么如果其中大约 15 个查询处于空闲状态并等待可用插槽,那么能够提交多达 20 个查询又有什么意义呢?

更新 2019-09-26

刚刚在 presto 文档中偶然发现了 HIVE CONNECTOR,其中有一节AWS Glue Catalog Configuration Properties。在那里我们可以看到

hive.metastore.glue.max-connections:到 Glue 的最大并发连接数(默认为 5)。

这让我想知道它是否与我的问题有关。据我了解,Athena 只是一个在 EMR 集群上运行的 Presto,该集群配置为使用 AWS Glue 数据目录作为 Metastore。

那么,如果我的问题来自这样一个事实,即 Athena 的 EMR 集群只是使用默认值来连接到 Glue 的并发连接,即 5,这正是在我的情况下实际执行(平均)并发查询的数量。

更新 2019-11-27

Athena 团队最近为 Athena 部署了许多新功能。虽然 …

concurrency limit amazon-emr amazon-athena aws-glue

15
推荐指数
1
解决办法
6359
查看次数