dilipbiswal commented on a change in pull request #23897: [SPARK-26215][SQL][FOLLOW-UP][MINOR] Fix the warning from ANTR4 URL: https://github.com/apache/spark/pull/23897#discussion_r260655276
########## File path: sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4 ########## @@ -1014,7 +1014,8 @@ SORTED: 'SORTED'; PURGE: 'PURGE'; INPUTFORMAT: 'INPUTFORMAT'; OUTPUTFORMAT: 'OUTPUTFORMAT'; -DATABASE: 'DATABASE' | 'SCHEMA'; +SCHEMA: 'SCHEMA'; +DATABASE: 'DATABASE'; Review comment: @gatorsmile Hi Sean, i found out, one of the way we can get this checked is by failing the build on a warning. I tried using `treatWarningsAsErrors` option. Do you think, this is a acceptable solution ? If so, should this be under a separate ticket as, if something goes wrong with this option, we can rollback that fix. Please let me know what you think. https://www.antlr.org/api/maven-plugin/latest/antlr4-mojo.html Here is the error when i used this option. ``` INFO] [INFO] --- antlr4-maven-plugin:4.7.1:antlr4 (default) @ spark-catalyst_2.12 --- [INFO] ANTLR 4: Processing source directory /Users/dbiswal/mygit/apache/spark/sql/catalyst/src/main/antlr4 [INFO] Processing grammar: org/apache/spark/sql/catalyst/parser/SqlBase.g4 [WARNING] warning(125): org/apache/spark/sql/catalyst/parser/SqlBase.g4:785:90: implicit definition of token SCHEMA in parser [WARNING] /Users/dbiswal/mygit/apache/spark/org/apache/spark/sql/catalyst/parser/SqlBase.g4 [785:90]: implicit definition of token SCHEMA in parser [ERROR] error(10): warning treated as error [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 9.901 s [INFO] Finished at: 2019-02-27T01:01:27-08:00 ``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
