ConeyLiu commented on issue #8175:
URL: https://github.com/apache/iceberg/issues/8175#issuecomment-1671588362

   I mean what's the problem are you met. I could create a table on a struct 
field:
   ```
   scala> spark.sql("create table local.db.test_partition_struct(id long, data 
struct<id: long, ts: timestamp>) using iceberg partitioned by 
(years(data.ts))").show()
   
   scala> spark.sql("insert into local.db.test_partition_struct values(1, 
struct(2, timestamp('2023-01-01')))").show()
   
   scala> spark.sql("select * from local.db.test_partition_struct").show()
   +---+--------------------+
   | id|                data|
   +---+--------------------+
   |  1|{2, 2023-01-01 00...|
   +---+--------------------+
   
   scala> spark.sql("desc table local.db.test_partition_struct").show()
   +--------------+--------------------+-------+
   |      col_name|           data_type|comment|
   +--------------+--------------------+-------+
   |            id|              bigint|   null|
   |          data|struct<id:bigint,...|   null|
   |              |                    |       |
   |# Partitioning|                    |       |
   |        Part 0|      years(data.ts)|       |
   +--------------+--------------------+-------+
   ```


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to