shardulm94 opened a new issue #1111:
URL: https://github.com/apache/iceberg/issues/1111


   Created an unpartitioned table `test.unpartitioned_table`
   ```
   scala> 
spark.read.format("iceberg").load("test.unpartitioned_table.partitions").printSchema
   java.lang.AssertionError: assertion failed: each serializer expression 
should contain at least one `BoundReference`
     at scala.Predef$.assert(Predef.scala:170)
     at 
org.apache.spark.sql.catalyst.encoders.ExpressionEncoder$$anonfun$11.apply(ExpressionEncoder.scala:238)
     at 
org.apache.spark.sql.catalyst.encoders.ExpressionEncoder$$anonfun$11.apply(ExpressionEncoder.scala:236)
     at 
scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:241)
     at 
scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:241)
     at scala.collection.immutable.List.foreach(List.scala:381)
     at 
scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:241)
     at scala.collection.immutable.List.flatMap(List.scala:344)
     at 
org.apache.spark.sql.catalyst.encoders.ExpressionEncoder.<init>(ExpressionEncoder.scala:236)
     at 
org.apache.spark.sql.catalyst.encoders.RowEncoder$.apply(RowEncoder.scala:63)
     at org.apache.spark.sql.Dataset$.ofRows(Dataset.scala:75)
     at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:196)
     at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:174)
     ... 87 elided
   ```
   
   I was able to find a Spark Jira 
https://issues.apache.org/jira/browse/SPARK-20193 which suggests that it is due 
to Spark not fully supporting empty structs. Perhaps we should consider 
throwing a better error message when reading partitions metadata table for 
unpartitioned tables since the partition field will be an empty struct in such 
a case.


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

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