使用Neptune连接器执行Athena查询时NullPoInterException错误
我正在尝试从雅典娜执行查询,以显示海王星数据库的数据。我正在使用雅典娜海王星连接器连接到Neptune DB,并在Athena查询编辑中显示数据。
但是,当我运行以下查询
SELECT * FROM "datasource/datacatalog".<dbname>.<tablename> limit 10;
错误消息时,我会遇到错误:
Encountered an exception[java.lang.NullPointerException] from your LambdaFunction[neptune_connector lambda function name] executed in context[S3SpillLocation{bucket='S3 bucketname', key='<file prefix name/2e6fedb0-9366-4d83-8a69-20472d7ff850/', directory=true}]
到目前为止,我已经完成了。
- 创建了一个新的数据目录,数据库和表(手动,componentType:vertex)。
- 带有Neptune Connector lambda的连接DataCatalog
- 完全访问了雅典娜,S3,Neptune和Glue,已经扮演了Neptune Connector Lambda运行的角色。
- Connector Lambda的Spillbucket变量中已提供了现有的S3存储桶名。
参考:
- Amazon Athena Neptune连接器 -
- /EUG/connect-to-a-data-source-lambda.html#connect-to-a-data-source-lambda-connecting“ rel =” nofollow noreferrer“ athena/lestest/ug/connect-a-data-source-lambda.html#连接到to-a-data-source-lambda-connecting
但是,我可以在运行以下时看到表信息查询,但实际选择查询不起作用。
describe `datasource/datacatlogname`.<dbname>.<tablename>;
CloudWatch日志:
java.lang.NullPointerException: java.lang.NullPointerException
java.lang.NullPointerException at
com.amazonaws.athena.connectors.neptune.propertygraph.PropertyGraphHandler.executeQuery(PropertyGraphHandler.java:112)
at
com.amazonaws.athena.connectors.neptune.NeptuneRecordHandler.readWithConstraint(NeptuneRecordHandler.java:113)
at
com.amazonaws.athena.connector.lambda.handlers.RecordHandler.doReadRecords(RecordHandler.java:19 at
com.amazonaws.athena.connector.lambda.handlers.RecordHandler.doHandleRequest(RecordHandler.java:158)
at
com.amazonaws.athena.connector.lambda.handlers.CompositeHandler.handleRequest(CompositeHandler.java:138)
at
com.amazonaws.athena.connector.lambda.handlers.CompositeHandler.handleRequest(CompositeHandler.java:103)
I am trying to execute query from Athena to show data from Neptune database. I am using Athena Neptune connector to connect to Neptune DB and show the data in Athena query editor.
However I get error when I run the following query
SELECT * FROM "datasource/datacatalog".<dbname>.<tablename> limit 10;
Error Message:
Encountered an exception[java.lang.NullPointerException] from your LambdaFunction[neptune_connector lambda function name] executed in context[S3SpillLocation{bucket='S3 bucketname', key='<file prefix name/2e6fedb0-9366-4d83-8a69-20472d7ff850/', directory=true}]
I have done so far.
- Created a new data catalog and database and table (manually, componenttype: vertex).
- Connected datacatalog with neptune connector lambda
- Full access to Athena,S3,Neptune and Glue has been to the role under which Neptune connector lambda runs.
- An existing S3 bucket name has been provided in spillbucket variable for connector lambda.
References:
- Amazon Athena Neptune connector - https://github.com/awslabs/aws-athena-query-federation/tree/master/athena-neptune
- Connecting to the data source - https://docs.aws.amazon.com/athena/latest/ug/connect-to-a-data-source-lambda.html#connect-to-a-data-source-lambda-connecting
However I am able to see table info when I run the following query but the actual select query does not work.
describe `datasource/datacatlogname`.<dbname>.<tablename>;
Cloudwatch logs:
java.lang.NullPointerException: java.lang.NullPointerException
java.lang.NullPointerException at
com.amazonaws.athena.connectors.neptune.propertygraph.PropertyGraphHandler.executeQuery(PropertyGraphHandler.java:112)
at
com.amazonaws.athena.connectors.neptune.NeptuneRecordHandler.readWithConstraint(NeptuneRecordHandler.java:113)
at
com.amazonaws.athena.connector.lambda.handlers.RecordHandler.doReadRecords(RecordHandler.java:19 at
com.amazonaws.athena.connector.lambda.handlers.RecordHandler.doHandleRequest(RecordHandler.java:158)
at
com.amazonaws.athena.connector.lambda.handlers.CompositeHandler.handleRequest(CompositeHandler.java:138)
at
com.amazonaws.athena.connector.lambda.handlers.CompositeHandler.handleRequest(CompositeHandler.java:103)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
检查是否正确设置了Lambda配置以访问Neptune数据库。确保已连接的lambda安全组已正确设置以访问数据库
连接器可在无服务器应用程序中可用,请尝试从那里部署
Check if the lambda configuration is setup properly to access the Neptune database. Make sure the lambda security group attached is properly setup to access the database
The connector is available in Serverless Application Reppository, try deploying from there
我能够找出这个问题。当我在控制台中手动创建表时,我将在SERDE参数下插入saparatochar和componentType。
https://github.com/awslabs/aws-athena-query-federation/blob/master/thena-neptune/athena-neptune/docs/aws-glue-sample-spample-scripts/manual/sample/sample/sample/sample-cli- script.sh
它应该在表格属性下。
I was able to find out the issue. When I was creating the table manually in console I was inserting separatorChar and componenttype under Serde parameters.
https://github.com/awslabs/aws-athena-query-federation/blob/master/athena-neptune/docs/aws-glue-sample-scripts/manual/sample-cli-script.sh
It should be under table properties.