Repository navigation
fix: check LATERAL VIEW generator functions in adapter and validator - #2956
Merged
manticore-projects merged 1 commit intoNov 24, 2026
Merged
manticore-projects merged 1 commit into
manticore-projects merged 1 commit into
Conversation
Contributor
|
Thank you much! I am thinking of introducing an org. chart and making you "head of Visitors", while @minleejae would become "head of DDLs" :-) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PlainSelectkeeps Hive/SparkLATERAL VIEWclauses ingetLateralViews(), butSelectVisitorAdapter.visit(PlainSelect)still has them as a commented-out@todoandSelectValidator.visit(PlainSelect)never looks at them, so the generator function is only walked byTablesNamesFinderand the deparser.StatementFeatureVisitorbuilds on the adapter, which means a call in that slot never reaches the pure-function check:SELECT a FROM t LATERAL VIEW explode(purge_audit()) v AS ccomes back withmayModifyData() == falseand no unresolved reference and passes the read-only guard in usage.rst, whileSELECT explode(purge_audit()) FROM tleavesMODIFIES_DATApossible withunresolved=[purge_audit]. Hive and Spark evaluate the generator and its arguments like a select-list call, soreflect/java_methodand user UDTFs run there too. On the Validation side, withFeature.functionremoved,SELECT a FROM t LATERAL VIEW explode(b) v AS cvalidates with no errors althoughexplodeis a function call. I noticed it while comparing whichPlainSelectpartsTablesNamesFinderwalks against the adapter, after #2928 and #2879 closed similar gaps for other clauses. The adapter now hands each generator function to its expression visitor, andSelectValidatorvalidates it as an expression right after the joins. The newfunctionIsCheckedandtestValidateFunctionOutsideWherecases fail before (3 failures) and pass after; Spotless, Checkstyle, PMD and SpotBugs pass, and the rest of./gradlew checkis unchanged (the only failures locally are 33 Mockito inline-mock-maker init errors and 2 temp-file permission errors that fail the same way on master on this machine).