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
[SPARK-27016][SQL][BUILD] Treat all antlr warnings as errors while generating parser from the sql grammar file. #23925
Conversation
…ser from the sql grammar file.
I am expecting the build to fail due to an existing issue with the grammar file. After 23897 is merged, the error should go away. |
@srowen Hi Sean, need your help here. In my dev environment, when i use maven to build, i get the expected result and the build fails with the following error :
However, from jenkins, it uses sbt and the build seems to skip pass this error/warning. Would you know what may be happening and how to fix this ? Appreciate your help. |
Hm, I'm not sure. SBT 'reads' the pom file via a plugin, but I think the translation is imperfect. I'm still surprised. Sometimes we've worked around it by duplicating the config and hacking it into the SBT build. I'm not sure how to do it here. We use Maven (also) in the test jobs that aren't PR builders, so this would still get caught eventually, and I presume is a pretty rare thing to update the schemas. We might just live with it unless someone has a better idea. (Also, I wonder if we should make the PR builders use Maven, as it's the build of record really) |
@srowen Thanks a lot for quick response.
IMHO we should especially if sbt swallows exceptions/errors like this :-) |
@srowen Update : I looked around. In my understanding, we seem to use the sbt-antlr plugin to generate the parser when compiling through sbt (SparkBuild.scala). Unfortunately, there is no (at least i couldn't find) "fail build on warning" option that is exposed through the sbt-antlr plugin |
Test build #102876 has finished for PR 23925 at commit
|
@dilipbiswal . Could you update the PR description |
@dongjoon-hyun Sure.. Let me do it. |
Test build #4586 has started for PR 23925 at commit |
retest this please |
Test build #102942 has finished for PR 23925 at commit
|
Merged to master |
What changes were proposed in this pull request?
Use the maven plugin option
treatWarningsAsErrors
to make sure the warnings are treated as errors while generating the parser file. In the absence of it, we may inadvertently introducing problems while making grammar changes. Please refer to PR-23897 to know more about the context.How was this patch tested?
We can use two ways to build Spark 1) sbt 2) Maven
This PR, we made a change to configure the maven antlr plugin to include a parameter that makes antlr4 report error on warning. However, when spark is built using sbt, we use the sbt antlr plugin which does not allow us to pass this additional compilation flag. More info on sbt-antlr plugin can be found at link
In summary, this fix only applicable when we use maven to build.