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

[Enhancement] Make error message more understandable if starrocks.columns contains non-existed columns #97

Merged
merged 1 commit into from
Dec 22, 2023

Conversation

banmoy
Copy link
Collaborator

@banmoy banmoy commented Dec 22, 2023

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Which issues of this PR fixes :

Fixes #
If starrocks.columns contains non-existed columns, the connector will throw a NPE which is not clear. We should make the error message more understandable to tell the user what's the problem.

java.lang.NullPointerException
	at com.starrocks.connector.spark.sql.schema.InferSchema.inferSchema(InferSchema.java:60)
	at com.starrocks.connector.spark.sql.StarRocksTableProvider.inferSchema(StarRocksTableProvider.java:65)
	at org.apache.spark.sql.execution.datasources.v2.DataSourceV2Utils$.getTableFromProvider(DataSourceV2Utils.scala:90)
	at org.apache.spark.sql.DataFrameWriter.getTable$1(DataFrameWriter.scala:280)
	at org.apache.spark.sql.DataFrameWriter.saveInternal(DataFrameWriter.scala:296)
	at org.apache.spark.sql.DataFrameWriter.save(DataFrameWriter.scala:247)
	at com.starrocks.connector.spark.sql.ConfigurationITTest.testDataFrameBase(ConfigurationITTest.java:178)
	at com.starrocks.connector.spark.sql.ConfigurationITTest.testWriteConfigurationBase(ConfigurationITTest.java:146)
	at com.starrocks.connector.spark.sql.ConfigurationITTest.testTransactionConfiguration(ConfigurationITTest.java:117)

Problem Summary(Required) :

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr will affect users' behaviors
  • This pr needs user documentation (for new or modified features or behaviors)
  • I have added documentation for my new feature or new function

…n-existed column

Signed-off-by: PengFei Li <lpengfei2016@gmail.com>
@banmoy banmoy changed the title [Enhancement] Make the error log more understandable if starrocks.columns contains non-existed columns [Enhancement] Make error log more understandable if starrocks.columns contains non-existed columns Dec 22, 2023
@banmoy banmoy changed the title [Enhancement] Make error log more understandable if starrocks.columns contains non-existed columns [Enhancement] Make error message more understandable if starrocks.columns contains non-existed columns Dec 22, 2023
@banmoy banmoy merged commit 84ea326 into StarRocks:main Dec 22, 2023
3 checks passed
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.

None yet

2 participants