使用Neptune连接器执行Athena查询时NullPoInterException错误

发布于 2025-02-10 05:08:00 字数 1991 浏览 2 评论 0原文

我正在尝试从雅典娜执行查询,以显示海王星数据库的数据。我正在使用雅典娜海王星连接器连接到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}]

到目前为止,我已经完成了。

  1. 创建了一个新的数据目录,数据库和表(手动,componentType:vertex)。
  2. 带有Neptune Connector lambda的连接DataCatalog
  3. 完全访问了雅典娜,S3,Neptune和Glue,已经扮演了Neptune Connector Lambda运行的角色。
  4. Connector Lambda的Spillbucket变量中已提供了现有的S3存储桶名。

参考:

  1. Amazon Athena Neptune连接器 -
  2. ​/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.

  1. Created a new data catalog and database and table (manually, componenttype: vertex).
  2. Connected datacatalog with neptune connector lambda
  3. Full access to Athena,S3,Neptune and Glue has been to the role under which Neptune connector lambda runs.
  4. An existing S3 bucket name has been provided in spillbucket variable for connector lambda.

References:

  1. Amazon Athena Neptune connector - https://github.com/awslabs/aws-athena-query-federation/tree/master/athena-neptune
  2. 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

骑趴 2025-02-17 05:08:00

检查是否正确设置了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

我为君王 2025-02-17 05:08:00

我能够找出这个问题。当我在控制台中手动创建表时,我将在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.

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文