简体   繁体   English

Athena 查询错误:外部输入'select' expecting

[英]Athena query error : extraneous input 'select' expecting

Got an error while running query:运行查询时出错:

extraneous input 'select' expecting {'(', 'add', 'all', 'some', 'any', 'at', 'no', 'substring', 'position', 'tinyint', 'smallint', 'integer', 'date', 'time', 'timestamp', 'interval', 'year', 'month', 'day', 'hour', 'minute', 'second', 'zone', 'filter', 'over', 'partition', 'range', 'rows', 'preceding', 'following', 'current', 'row', 'schema', 'comment', 'view', 'replace', 'grant', 'revoke', 'privileges', 'public', 'option', 'explain', 'analyze', 'format', 'type', 'text', 'graphviz', 'logical', 'distributed', 'validate', 'show', 'tables', 'views', 'schemas', 'catalogs', 'columns', 'column', 'use', 'partitions', 'functions', 'to', 'system', 'bernoulli', 'poissonized', 'tablesample', 'unnest', 'array', 'map', 'set', 'reset', 'session', 'data', 'start', 'transaction', 'commit', 'rollback', 'work', 'isolation', 'level', 'serializable', 'repeatable', 'committed', 'uncommitted', 'read', 'write', 'only', 'call', 'input', 'output', 'cascade', 'restrict', 'including', 'excluding', 'properties', 'function', 'lambda_invoke', 'returns', 'sagemaker_invoke_endpoint', 'nfd', 'nfc', 'nfkd', 'nfkc', 'if', 'nullif', 'coalesce', identifier, digit_identifier, quoted_identifier, backquoted_identifier}

query is right join table ss with dd,like:查询是右连接表 ss 与 dd,如:

select * from 
(
select platform, id, nextMonth
FROM "logs"."user_records"   as ss
right join 
select id as idRight, platform, month
FROM "logs"."user_records"  as dd

on ss.platform = dd.platform and ss.userid = dd.useridRight and ss.nextMonth=dd.month   ) 

You probably need to surround the subquery after your right join in parentheses.您可能需要在正确加入括号后将子查询括起来。 Untested, but I'd guess:未经测试,但我猜:

select * from 
(
select platform, id, nextMonth
FROM "logs"."user_records"   as ss
right join 
( select id as idRight, platform, month
FROM "logs"."user_records" )  as dd

on ss.platform = dd.platform and ss.userid = dd.useridRight and ss.nextMonth=dd.month   ) 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 通过 Lambda 运行 aws Athena 查询:未定义错误名称“response” - Run aws Athena query by Lambda: error name 'response' is not defined Aws Wrangler 给出未实现的错误:无法查询 aws athena - Aws Wrangler giving not implemented error: impossible to query aws athena 运行 information_schema 查询时出现 AWS Athena 错误 - AWS Athena error when running information_schema query 雅典娜 / 急速查询 - athena / presto query 为什么我在 Athena 上的 unpivot 查询不起作用? 我只是在网上关注样本,但我总是得到“输入不匹配......” - Why is my unpivot query on Athena not working? I just followed the samples online but i always get `mismatched input ...` Presto Hive SQL 错误:输入“PARTITIONED”不匹配。 期待:“评论”,“与”,<eof></eof> - Presto Hive SQL Error: mismatched input 'PARTITIONED'. Expecting: 'COMMENT', 'WITH', <EOF> AWS Athena 联合查询 - 为 PostgreSQL 运行数据库查询时出现 GENERIC_USER_ERROR - AWS Athena Federated Query - GENERIC_USER_ERROR when running DB query for PostgreSQL AWS Athena 查询错误:Hive 找不到文件:分区位置不存在 - AWS Athena query error: Hive File Not Found:partition location does not exist Athena 查询错误 HIVE_BAD_DATA:无效的 Parquet 文件。 csv /.元数据 - Athena query error HIVE_BAD_DATA: Not valid Parquet file . csv / .metadata 以下查询返回第 1:8 行:输入“EXTERNAL”不匹配。 期望:'OR'、'SCHEMA'、'TABLE'、'VIEW' - The following query returns line 1:8: mismatched input 'EXTERNAL'. Expecting: 'OR', 'SCHEMA', 'TABLE', 'VIEW'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM