You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (Jira)" <ji...@apache.org> on 2023/01/07 15:02:00 UTC
[jira] [Assigned] (SPARK-37303) ALTER TABLE .. REPLACE COLUMNS works incorrectly for v2 tables in tests
[ https://issues.apache.org/jira/browse/SPARK-37303?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Apache Spark reassigned SPARK-37303:
------------------------------------
Assignee: Apache Spark
> ALTER TABLE .. REPLACE COLUMNS works incorrectly for v2 tables in tests
> -----------------------------------------------------------------------
>
> Key: SPARK-37303
> URL: https://issues.apache.org/jira/browse/SPARK-37303
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 3.3.0
> Reporter: Max Gekk
> Assignee: Apache Spark
> Priority: Major
>
> The test demonstrates the issue:
> {code:scala}
> test("Replace columns in v2 table") {
> withNamespaceAndTable("ns", "tbl") { t =>
> sql(s"CREATE TABLE $t (i INT, data STRING) $defaultUsing")
> sql(s"INSERT INTO $t SELECT 0, 'abc'")
> sql(
> s"""
> |ALTER TABLE $t REPLACE COLUMNS (
> | new_i STRING,
> | new_data LONG)""".stripMargin)
> sql(s"INSERT INTO $t SELECT 'def', 1000")
> checkAnswer(
> sql(s"SELECT new_i, new_data FROM $t"),
> Seq(Row("def", 1000)))
> }
> }
> {code}
> The test fails:
> {code:java}
> == Results ==
> !== Correct Answer - 1 == == Spark Answer - 2 ==
> !struct<> struct<new_i:string,new_data:bigint>
> ![def,1000] [,103079215107]
> ! [def,1000]
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org