Github user maropu commented on a diff in the pull request: https://github.com/apache/spark/pull/7474#discussion_r35733198 --- Diff: sql/core/src/main/scala/org/apache/spark/sql/DataFrame.scala --- @@ -1365,6 +1365,20 @@ class DataFrame private[sql]( def foreachPartition(f: Iterator[Row] => Unit): Unit = rdd.foreachPartition(f) /** + * Zips this [[DataFrame]] with another one, returning a new [[DataFrame]], like RDD.zip(). + * Assumes that the two DataFrames have the *same number of rows*, the two underlying RDDs + * have the *same number of partitions* and the *same number of elements in each partition* + * (e.g. one [[DataFrame]] was made through a select on the other). + * @group rdd + * @since 1.5.0 + */ + def zip(other: DataFrame): DataFrame = { + val newSchema: StructType = StructType(Array.concat(schema.fields, other.schema.fields)) --- End diff -- We need to use StructType#merge for schema-consistent checks (e.g., avoiding schema conflicts).
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org