Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coral-Schema: Add support for LogicalValues #298

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ljfgem
Copy link
Collaborator

@ljfgem ljfgem commented Aug 31, 2022

I encountered the following exception while querying a simple view SELECT 1 intCol on Spark shell:

Caused by: java.lang.NullPointerException
	at com.linkedin.coral.schema.avro.RelToAvroSchemaConverter$SchemaRelShuttle.visit(RelToAvroSchemaConverter.java:224)
	at coral_dali.org.apache.calcite.rel.logical.LogicalProject.accept(LogicalProject.java:121)
	at com.linkedin.coral.schema.avro.RelToAvroSchemaConverter.convert(RelToAvroSchemaConverter.java:127)
	at com.linkedin.coral.schema.avro.ViewToAvroSchemaConverter.inferAvroSchema(ViewToAvroSchemaConverter.java:199)
	at com.linkedin.coral.schema.avro.ViewToAvroSchemaConverter.toAvroSchema(ViewToAvroSchemaConverter.java:102)

It happened because there is no handling for LogicalValues when there is no base table. Adding the support for LogicalValues fixes this issue.

Tests:

  1. Unit test
  2. Tested on Spark shell, the affected view can be queried well

@ljfgem ljfgem marked this pull request as ready for review August 31, 2022 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant