rdblue commented on a change in pull request #3422:
URL: https://github.com/apache/iceberg/pull/3422#discussion_r739848024



##########
File path: site/docs/spark-queries.md
##########
@@ -209,16 +209,30 @@ To show a table's data files and each file's metadata, 
run:
 ```sql
 SELECT * FROM prod.db.table.files
 ```
+
+For partitioned tables:
 ```text
-+-------------------------------------------------------------------------+-------------+--------------+--------------------+--------------------+------------------+-------------------+------------------+-----------------+-----------------+--------------+---------------+
-| file_path                                                               | 
file_format | record_count | file_size_in_bytes | column_sizes       | 
value_counts     | null_value_counts | nan_value_counts | lower_bounds    | 
upper_bounds    | key_metadata | split_offsets |
-+-------------------------------------------------------------------------+-------------+--------------+--------------------+--------------------+------------------+-------------------+------------------+-----------------+-----------------+--------------+---------------+
-| s3:/.../table/data/00000-3-8d6d60e8-d427-4809-bcf0-f5d45a4aad96.parquet | 
PARQUET     | 1            | 597                | [1 -> 90, 2 -> 62] | [1 -> 1, 
2 -> 1] | [1 -> 0, 2 -> 0]  | []               | [1 -> , 2 -> c] | [1 -> , 2 -> 
c] | null         | [4]           |
-| s3:/.../table/data/00001-4-8d6d60e8-d427-4809-bcf0-f5d45a4aad96.parquet | 
PARQUET     | 1            | 597                | [1 -> 90, 2 -> 62] | [1 -> 1, 
2 -> 1] | [1 -> 0, 2 -> 0]  | []               | [1 -> , 2 -> b] | [1 -> , 2 -> 
b] | null         | [4]           |
-| s3:/.../table/data/00002-5-8d6d60e8-d427-4809-bcf0-f5d45a4aad96.parquet | 
PARQUET     | 1            | 597                | [1 -> 90, 2 -> 62] | [1 -> 1, 
2 -> 1] | [1 -> 0, 2 -> 0]  | []               | [1 -> , 2 -> a] | [1 -> , 2 -> 
a] | null         | [4]           |
-+-------------------------------------------------------------------------+-------------+--------------+--------------------+--------------------+------------------+-------------------+------------------+-----------------+-----------------+--------------+---------------+
++-------+-------------------------------------------------------------------------+-----------+---------------+------------+------------------+---------------------------+------------------------+------------------------+----------------+---------------------------------------+---------------------------------------+------------+-------------+------------+-------------+

Review comment:
       Is it possible to not revert the formatting changes? I think it is less 
readable with the initial space removed.
   
   Maybe we should replace this with a real HTML table?
   
   Here's a snippet of code that we use in our notebooks to format PySpark 
dataframes as nicer tables:
   
   ```python
   from prettytable import PrettyTable
   from IPython.core.magic import register_line_cell_magic
   
   class DFTable(PrettyTable):
       def __repr__(self):
           return self.get_string()
   
       def _repr_html_(self):
           return self.get_html_string()
   
   def to_table(df, num_rows=100):
       cols = df.columns
   
       t = DFTable()
       t.field_names = cols
       t.align = "r"
       for row in df.limit(num_rows).collect():
           d = row.asDict()
           t.add_row([ d[col] for col in cols ])
   
       return t
   ```
   
   That will produce both HTML and text tables that have reasonable formatting.




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