Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-32499][SQL] Use {} in conversions maps and structs to strings #29308

Closed
wants to merge 16 commits into from

Conversation

MaxGekk
Copy link
Member

@MaxGekk MaxGekk commented Jul 30, 2020

What changes were proposed in this pull request?

Change casting of map and struct values to strings by using the {} brackets instead of []. The behavior is controlled by the SQL config spark.sql.legacy.castComplexTypesToString.enabled. When it is true, CAST wraps maps and structs by [] in casting to strings. Otherwise, if this is false, which is the default, maps and structs are wrapped by {}.

Why are the changes needed?

  • To distinguish structs/maps from arrays.
  • To make show's output consistent with Hive and conversions to Hive strings.
  • To display dataframe content in the same form by spark-sql and show
  • To be consistent with the *.sql tests

Does this PR introduce any user-facing change?

Yes

How was this patch tested?

By existing test suite CastSuite.

@SparkQA
Copy link

SparkQA commented Jul 31, 2020

Test build #126805 has finished for PR 29308 at commit 117b276.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@MaxGekk
Copy link
Member Author

MaxGekk commented Jul 31, 2020

@maropu @cloud-fan Please, review this PR.

Copy link
Member

@maropu maropu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@SparkQA
Copy link

SparkQA commented Aug 3, 2020

Test build #126977 has finished for PR 29308 at commit 77b6637.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Aug 3, 2020

Test build #126991 has finished for PR 29308 at commit c494628.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Aug 4, 2020

Test build #127007 has finished for PR 29308 at commit 168dc00.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class ExecutorProcessLost(
  • case class RegExpExtractAll(subject: Expression, regexp: Expression, idx: Expression)
  • .doc(\"The name of a class that implements \" +
  • trait CachedBatch
  • trait CachedBatchSerializer extends Serializable
  • trait SimpleMetricsCachedBatch extends CachedBatch
  • abstract class SimpleMetricsCachedBatchSerializer extends CachedBatchSerializer with Logging
  • case class ColumnarToRowExec(child: SparkPlan) extends ColumnarToRowTransition with CodegenSupport
  • case class ApplyColumnarRulesAndInsertTransitions(
  • class ColumnStatisticsSchema(a: Attribute) extends Serializable
  • class PartitionStatistics(tableSchema: Seq[Attribute]) extends Serializable
  • case class DefaultCachedBatch(numRows: Int, buffers: Array[Array[Byte]], stats: InternalRow)
  • class DefaultCachedBatchSerializer extends SimpleMetricsCachedBatchSerializer
  • trait HashJoin extends BaseJoinExec with CodegenSupport

@SparkQA
Copy link

SparkQA commented Aug 4, 2020

Test build #127035 has finished for PR 29308 at commit 138b73c.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Aug 4, 2020

Test build #127042 has finished for PR 29308 at commit ae35de3.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Aug 4, 2020

Test build #127048 has finished for PR 29308 at commit 91acda1.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@cloud-fan
Copy link
Contributor

thanks, merging to master!

@cloud-fan cloud-fan closed this in 7eb6f45 Aug 4, 2020
@MaxGekk MaxGekk deleted the show-struct-map branch December 11, 2020 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants