Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/14712
  
    Below is a test case for a table with empty column. Could you also add it 
here? 
    
    ```Scala
      test("statistics collection of a table with zero column") {
        val table_no_cols = "table_no_cols"
        withTable(table_no_cols) {
          val rddNoCols = sparkContext.parallelize(1 to 10).map(_ => Row.empty)
          val dfNoCols = spark.createDataFrame(rddNoCols, StructType(Seq.empty))
          dfNoCols.write.format("json").saveAsTable(table_no_cols)
          sql(s"ANALYZE TABLE $table_no_cols COMPUTE STATISTICS")
          checkLogicalRelationStats(table_no_cols, expectedStats =
            Some(Statistics(sizeInBytes = 30, rowCount = Some(10))))
        }
      }
    ``` 
    
    In the future, we will do column-level statistics collection. This might 
help you when you implement collection of column-level statistics.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to