In Spark 1.6 and earlier, Spark SQL does not support NATURAL JOIN queries. However, its SQL parser does not consider NATURAL to be a reserved word, which causes natural joins to be parsed as regular joins where the left table has been aliased. For instance,
gets interpreted as "foo JOIN bar" where "foo" is aliased to "natural".
Rather than doing this, which leads to confusing / wrong results for users who expect NATURAL JOIN behavior, Spark should immediately reject these queries at analysis time and should provide an informative error message.
We're going to add natural join support in Spark 2.0, but for earlier versions we should add a bugfix to throw errors.