[ https://issues.apache.org/jira/browse/SPARK-18854?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Reynold Xin updated SPARK-18854: -------------------------------- Target Version/s: 2.0.3, 2.1.1, 2.2.0 (was: 2.1.1, 2.2.0) > getNodeNumbered and generateTreeString are not consistent > --------------------------------------------------------- > > Key: SPARK-18854 > URL: https://issues.apache.org/jira/browse/SPARK-18854 > Project: Spark > Issue Type: Bug > Components: SQL > Reporter: Reynold Xin > > This is a bug introduced by subquery handling. generateTreeString numbers > trees including innerChildren (used to print subqueries), but getNodeNumbered > ignores that. As a result, getNodeNumbered is not always correct. > Repro: > {code} > val df = sql("select * from range(10) where id not in " + > "(select id from range(2) union all select id from range(2))") > println("-------------------------------------------------------") > println(df.queryExecution.analyzed.numberedTreeString) > println("-------------------------------------------------------") > println("-------------------------------------------------------") > println(df.queryExecution.analyzed(3)) > println("-------------------------------------------------------") > {code} > Output looks like > {noformat} > ------------------------------------------------------- > 00 Project [id#1L] > 01 +- Filter NOT predicate-subquery#0 [(id#1L = id#2L)] > 02 : +- Union > 03 : :- Project [id#2L] > 04 : : +- Range (0, 2, step=1, splits=None) > 05 : +- Project [id#3L] > 06 : +- Range (0, 2, step=1, splits=None) > 07 +- Range (0, 10, step=1, splits=None) > ------------------------------------------------------- > ------------------------------------------------------- > null > ------------------------------------------------------- > {noformat} > Note that 3 should be the Project node, but getNodeNumbered ignores > innerChild and as a result returns the wrong one. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org