You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "wangyum (via GitHub)" <gi...@apache.org> on 2023/09/08 03:17:38 UTC

[GitHub] [spark] wangyum commented on a diff in pull request #42850: [SPARK-44805][SQL] getBytes/getShorts/getInts/etc. should work in a column vector that has a dictionary

wangyum commented on code in PR #42850:
URL: https://github.com/apache/spark/pull/42850#discussion_r1319309285


##########
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetQuerySuite.scala:
##########
@@ -1108,6 +1108,17 @@ abstract class ParquetQuerySuite extends QueryTest with ParquetTest with SharedS
       checkAnswer(sql("select * from tbl"), expected)
     }
   }
+
+  test("SPARK-44805: cast of struct with two arrays") {
+    withTable("tbl") {
+      sql("create table tbl (value struct<f1:array<int>,f2:array<int>>) using parquet")
+      sql("insert into tbl values (named_struct('f1', array(1, 2, 3), 'f2', array(1, 1, 2)))")
+      val df = sql("""select cast(value as struct<f1:array<double>,f2:array<int>>) AS value
+                     |from tbl""".stripMargin)

Review Comment:
   ```suggestion
         val df = sql("select cast(value as struct<f1:array<double>,f2:array<int>>) AS value from tbl")
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org