You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/09/23 18:27:13 UTC

[GitHub] [spark] MaxGekk commented on a change in pull request #34057: [SPARK-36825][SQL] Read/write dataframes with ANSI intervals from/to parquet files

MaxGekk commented on a change in pull request #34057:
URL: https://github.com/apache/spark/pull/34057#discussion_r715049977



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetIOSuite.scala
##########
@@ -1060,6 +1061,25 @@ class ParquetIOSuite extends QueryTest with ParquetTest with SharedSparkSession
       }
     }
   }
+
+  test("SPARK-36825: year-month/day-time intervals written and read as INT32/INT64") {
+    Seq(
+      YearMonthIntervalType() -> ((i: Int) => Period.of(i, i, 0)),
+      DayTimeIntervalType() -> ((i: Int) => Duration.ofDays(i).plusSeconds(i))
+    ).foreach { case (it, f) =>
+      val data = (1 to 10).map(i => Row(i, f(i)))
+      val schema = StructType(List(StructField("d", IntegerType, false),
+        StructField("i", it, false)).toArray)

Review comment:
       haha, I actually borrowed the code from your test https://github.com/apache/spark/pull/19702/files#diff-07f918aa5538eb47de4ef8065cf016e773bb472466dbef73898c1517272db191R244-R245 :-)




-- 
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