Max Gekk created SPARK-51649:
--------------------------------

             Summary: Cannot read partitioned parquet files with TIME partition 
values
                 Key: SPARK-51649
                 URL: https://issues.apache.org/jira/browse/SPARK-51649
             Project: Spark
          Issue Type: Sub-task
          Components: SQL
    Affects Versions: 4.1.0
            Reporter: Max Gekk
            Assignee: Max Gekk


The code below demonstrates the issue:

{code:scala}
scala> sql("SELECT time'12:00' AS t, 0 as 
id").write.partitionBy("t").parquet("/Users/maxim.gekk/tmp/time_parquet")

scala> spark.read.schema("t TIME, id 
INT").parquet("/Users/maxim.gekk/tmp/time_parquet").show(false)
org.apache.spark.SparkRuntimeException: [INVALID_PARTITION_VALUE] Failed to 
cast value '12%3A00%3A00' to data type "TIME(6)" for partition column `t`. 
Ensure the value matches the expected data type for this partition column. 
SQLSTATE: 42846
  at 
org.apache.spark.sql.errors.QueryExecutionErrors$.failedToCastValueToDataTypeForPartitionColumnError(QueryExecutionErrors.scala:808)
  at 
org.apache.spark.sql.execution.datasources.PartitioningUtils$.$anonfun$parsePartitions$11(PartitioningUtils.scala:204)
{code}




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to