spark-instrumented-optimizer/R/pkg/inst/tests/testthat
eyal farago f151bd1af8 [SPARK-16839][SQL] Simplify Struct creation code path
## What changes were proposed in this pull request?

Simplify struct creation, especially the aspect of `CleanupAliases` which missed some aliases when handling trees created by `CreateStruct`.

This PR includes:

1. A failing test (create struct with nested aliases, some of the aliases survive `CleanupAliases`).
2. A fix that transforms `CreateStruct` into a `CreateNamedStruct` constructor, effectively eliminating `CreateStruct` from all expression trees.
3. A `NamePlaceHolder` used by `CreateStruct` when column names cannot be extracted from unresolved `NamedExpression`.
4. A new Analyzer rule that resolves `NamePlaceHolder` into a string literal once the `NamedExpression` is resolved.
5. `CleanupAliases` code was simplified as it no longer has to deal with `CreateStruct`'s top level columns.

## How was this patch tested?
Running all tests-suits in package org.apache.spark.sql, especially including the analysis suite, making sure added test initially fails, after applying suggested fix rerun the entire analysis package successfully.

Modified few tests that expected `CreateStruct` which is now transformed into `CreateNamedStruct`.

Author: eyal farago <eyal farago>
Author: Herman van Hovell <hvanhovell@databricks.com>
Author: eyal farago <eyal.farago@gmail.com>
Author: Eyal Farago <eyal.farago@actimize.com>
Author: Hyukjin Kwon <gurwls223@gmail.com>
Author: eyalfa <eyal.farago@gmail.com>

Closes #15718 from hvanhovell/SPARK-16839-2.
2016-11-02 11:12:20 +01:00
..
jarTest.R [SPARK-10683][SPARK-16510][SPARKR] Move SparkR include jar test to SparkSubmitSuite 2016-07-19 19:28:08 -07:00
packageInAJarTest.R [SPARKR][MINOR] R examples and test updates 2016-07-13 13:33:34 -07:00
test_binary_function.R [SPARK-16519][SPARKR] Handle SparkR RDD generics that create warnings in R CMD check 2016-08-16 11:19:18 -07:00
test_binaryFile.R [SPARK-16519][SPARKR] Handle SparkR RDD generics that create warnings in R CMD check 2016-08-16 11:19:18 -07:00
test_broadcast.R [SPARK-16519][SPARKR] Handle SparkR RDD generics that create warnings in R CMD check 2016-08-16 11:19:18 -07:00
test_client.R [MINOR] [SPARKR] Update data-manipulation.R to use native csv reader 2016-05-09 09:58:36 -07:00
test_context.R [SPARK-17577][FOLLOW-UP][SPARKR] SparkR spark.addFile supports adding directory recursively 2016-09-26 16:47:57 -07:00
test_includePackage.R [SPARK-16519][SPARKR] Handle SparkR RDD generics that create warnings in R CMD check 2016-08-16 11:19:18 -07:00
test_jvm_api.R [SPARK-16581][SPARKR] Fix JVM API tests in SparkR 2016-08-31 16:56:41 -07:00
test_mllib.R [SPARK-16137][SPARKR] randomForest for R 2016-10-30 16:19:19 -07:00
test_parallelize_collect.R [SPARK-16519][SPARKR] Handle SparkR RDD generics that create warnings in R CMD check 2016-08-16 11:19:18 -07:00
test_rdd.R [SPARK-16519][SPARKR] Handle SparkR RDD generics that create warnings in R CMD check 2016-08-16 11:19:18 -07:00
test_Serde.R [SPARK-16027][SPARKR] Fix R tests SparkSession init/stop 2016-07-17 19:02:21 -07:00
test_shuffle.R [SPARK-16519][SPARKR] Handle SparkR RDD generics that create warnings in R CMD check 2016-08-16 11:19:18 -07:00
test_sparkSQL.R [SPARK-16839][SQL] Simplify Struct creation code path 2016-11-02 11:12:20 +01:00
test_take.R [SPARK-16519][SPARKR] Handle SparkR RDD generics that create warnings in R CMD check 2016-08-16 11:19:18 -07:00
test_textFile.R [SPARK-16519][SPARKR] Handle SparkR RDD generics that create warnings in R CMD check 2016-08-16 11:19:18 -07:00
test_utils.R [SPARK-17838][SPARKR] Check named arguments for options and use formatted R friendly message from JVM exception message 2016-11-01 22:14:53 -07:00
test_Windows.R [SPARK-8603][SPARKR] Use shell() instead of system2() for SparkR on Windows 2016-05-26 20:55:06 -07:00