spark-instrumented-optimizer/python/pyspark/sql
Yijie Shen 52302a8039 [SPARK-8407] [SQL] complex type constructors: struct and named_struct
This is a follow up of [SPARK-8283](https://issues.apache.org/jira/browse/SPARK-8283) ([PR-6828](https://github.com/apache/spark/pull/6828)), to support both `struct` and `named_struct` in Spark SQL.

After [#6725](https://github.com/apache/spark/pull/6828), the semantic of [`CreateStruct`](https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypes.scala#L56) methods have changed a little and do not limited to cols of `NamedExpressions`, it will name non-NamedExpression fields following the hive convention, col1, col2 ...

This PR would both loosen [`struct`](https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/functions.scala#L723) to take children of `Expression` type and add `named_struct` support.

Author: Yijie Shen <henry.yijieshen@gmail.com>

Closes #6874 from yijieshen/SPARK-8283 and squashes the following commits:

4cd3375ac [Yijie Shen] change struct documentation
d599d0b [Yijie Shen] rebase code
9a7039e [Yijie Shen] fix reviews and regenerate golden answers
b487354 [Yijie Shen] replace assert using checkAnswer
f07e114 [Yijie Shen] tiny fix
9613be9 [Yijie Shen] review fix
7fef712 [Yijie Shen] Fix checkInputTypes' implementation using foldable and nullable
60812a7 [Yijie Shen] Fix type check
828d694 [Yijie Shen] remove unnecessary resolved assertion inside dataType method
fd3cd8e [Yijie Shen] remove type check from eval
7a71255 [Yijie Shen] tiny fix
ccbbd86 [Yijie Shen] Fix reviews
47da332 [Yijie Shen] remove nameStruct API from DataFrame
917e680 [Yijie Shen] Fix reviews
4bd75ad [Yijie Shen] loosen struct method in functions.scala to take Expression children
0acb7be [Yijie Shen] Add CreateNamedStruct in both DataFrame function API and FunctionRegistery
2015-07-02 10:12:25 -07:00
..
__init__.py [SPARK-8060] Improve DataFrame Python test coverage and documentation. 2015-06-03 00:23:34 -07:00
column.py [SPARK-8573] [SPARK-8568] [SQL] [PYSPARK] raise Exception if column is used in booelan expression 2015-06-23 15:51:16 -07:00
context.py [SPARK-8535] [PYSPARK] PySpark : Can't create DataFrame from Pandas dataframe with no explicit column name 2015-06-30 20:35:46 -07:00
dataframe.py [SPARK-8770][SQL] Create BinaryOperator abstract class. 2015-07-01 21:14:13 -07:00
functions.py [SPARK-8407] [SQL] complex type constructors: struct and named_struct 2015-07-02 10:12:25 -07:00
group.py [SPARK-8770][SQL] Create BinaryOperator abstract class. 2015-07-01 21:14:13 -07:00
readwriter.py [SPARK-8698] partitionBy in Python DataFrame reader/writer interface should not default to empty tuple. 2015-06-29 00:22:44 -07:00
tests.py [SPARK-8766] support non-ascii character in column names 2015-07-01 16:43:18 -07:00
types.py [SPARK-8766] support non-ascii character in column names 2015-07-01 16:43:18 -07:00
utils.py [SPARK-8766] support non-ascii character in column names 2015-07-01 16:43:18 -07:00
window.py [SPARK-8146] DataFrame Python API: Alias replace in df.na 2015-06-07 01:21:02 -07:00